The image context was backend/, so COPY frontend/ failed. Build from the repo root, place Python modules on the import path, and pin packages that exist on PyPI. The web process no longer loads the LLM at startup.
39 lines
609 B
Python
39 lines
609 B
Python
from typing import Dict, List, Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
message: str
|
|
top_k: int = 3
|
|
|
|
|
|
class ChatResponse(BaseModel):
|
|
query: str
|
|
response: str
|
|
sources: List[Dict]
|
|
|
|
|
|
class BookInfo(BaseModel):
|
|
title: str
|
|
source: str
|
|
|
|
|
|
class UploadResponse(BaseModel):
|
|
message: str
|
|
filename: str
|
|
|
|
|
|
class ScheduleInfo(BaseModel):
|
|
id: int
|
|
time: str
|
|
book: Optional[str] = None
|
|
enabled: bool
|
|
next_run: Optional[str] = None
|
|
|
|
|
|
class ScheduleRequest(BaseModel):
|
|
time: str
|
|
book: Optional[str] = None
|
|
enabled: bool = True
|