Download src/models/structured_output.py from DataEyond/Agentic-Service-Data-Eyond-Catalog: direct link, hf CLI and curl.
- Browser
- Download file 803 Bytes
-
https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/models/structured_output.py
- Command line
-
hf download hf://spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog@717452f69ec32394dea2a8fc11aba47eebe5bc53/src/models/structured_output.py
-
curl -L -o structured_output.py https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/models/structured_output.py
803 Bytes
| """Structured output models for LLM.""" | |
| from pydantic import BaseModel, Field | |
| class IntentClassification(BaseModel): | |
| """Intent classification output.""" | |
| intent: str = Field( | |
| description="The user's intent: 'question', 'greeting', 'goodbye', 'other'" | |
| ) | |
| needs_search: bool = Field( | |
| description="Whether document search is needed" | |
| ) | |
| search_query: str = Field( | |
| default="", | |
| description="The query to use for document search if needed" | |
| ) | |
| direct_response: str = Field( | |
| default="", | |
| description="Direct response if no search needed (for greetings, etc.)" | |
| ) | |
| source_hint: str = Field( | |
| default="both", | |
| description="Which sources to search: 'document' (PDF/DOCX/TXT), 'schema' (DB/CSV/XLSX), or 'both'" | |
| ) | |