Spaces:
Sleeping
Sleeping
Download api/models.py from shiva9876/Langchain_Chat_Bot: direct link, hf CLI and curl.
- Browser
- Download file 638 Bytes
-
https://huggingface.co/spaces/shiva9876/Langchain_Chat_Bot/resolve/main/api/models.py
- Command line
-
hf download hf://spaces/shiva9876/Langchain_Chat_Bot/api/models.py
-
curl -L -o models.py https://huggingface.co/spaces/shiva9876/Langchain_Chat_Bot/resolve/main/api/models.py
638 Bytes
| from pydantic import BaseModel, Field | |
| from typing import Optional | |
| class PromptRequest(BaseModel): | |
| prompt: str = Field(..., description="The user's prompt or question") | |
| session_id: Optional[str] = Field(None, description="Session ID for conversation history") | |
| response_type: Optional[str] = Field("both", description="Type of response: 'code', 'explanation', 'conversation', or 'both'") | |
| max_history: Optional[int] = Field(10, description="Maximum number of conversation turns to remember") | |
| class HistoryRequest(BaseModel): | |
| session_id: str = Field(..., description="Session ID to retrieve or clear history") |