File size: 1,287 Bytes
1f891e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
Pydantic models for the API endpoints.
"""
from pydantic import BaseModel, Field
from typing import Optional, List, Dict, Any


class QueryRequest(BaseModel):
    """Model for legal query requests."""
    query: str = Field(..., description="The legal query or request from the user")
    session_id: Optional[str] = Field(None, description="Session identifier for tracking conversation context")
    options: Optional[Dict[str, Any]] = Field(None, description="Additional options for query processing")


class QueryResponse(BaseModel):
    """Model for legal query responses."""
    response: str = Field(..., description="The response from the legal assistant")
    session_id: Optional[str] = Field(None, description="Session identifier that tracks the conversation")
    metadata: Optional[Dict[str, Any]] = Field(None, description="Additional metadata about the response")
    processing_time: Optional[float] = Field(None, description="Time taken to process the query in seconds")


class HealthResponse(BaseModel):
    """Model for health check responses."""
    status: str = Field(..., description="Health status of the API")
    version: str = Field(..., description="API version")
    components: Dict[str, str] = Field(..., description="Status of individual components")