File size: 578 Bytes
e94d3a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import List, Optional
from pydantic import BaseModel, Field


class Citation(BaseModel):
    citation_type: str = Field(description="Citation type.")
    url: str = Field(description="Citation URL.")
    start_index: int = Field(description="Citation start index in response.")
    end_index: int = Field(description="Citation end index in response.")


class AnalyzerResult(BaseModel):
    response_str: str = Field(description="Final response string.")
    citation: Optional[List[Citation]] = Field(
        default=[], description="Final response string."
    )