Download app/schemas/chat.py from acpcchatbotadmin/acpcchatbot_testing_first: direct link, hf CLI and curl.
- Browser
- Download file 483 Bytes
-
https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/main/app/schemas/chat.py
- Command line
-
hf download hf://spaces/acpcchatbotadmin/acpcchatbot_testing_first/app/schemas/chat.py
-
curl -L -o chat.py https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/main/app/schemas/chat.py
483 Bytes
| from pydantic import BaseModel, Field | |
| from typing import Optional | |
| class Source(BaseModel): | |
| rank: int | |
| score: float | |
| file_name: str | |
| url: str | |
| text_preview: str | |
| class ChatRequest(BaseModel): | |
| message: str = Field(..., min_length=1, max_length=2000) | |
| session_id: Optional[str] = None | |
| class ChatResponse(BaseModel): | |
| answer: str | |
| sources: list[Source] | |
| session_id: str | |
| confidence: float | |
| trace_id: Optional[str] = None | |