Represents the content of a document, either as a direct string or URL.
class DocumentContent:
type: Literal["url", "string"] # Content type
value: str # URL or actual content
filename: Optional[str] # Required for URL type, None for string type
DocumentResult
A document search result with relevance score.
class DocumentResult:
score: float # Highest chunk score
document_id: str # external_id
metadata: Dict[str, Any]
content: DocumentContent # type and value fields
additional_metadata: Dict[str, Any] # e.g., frame descriptions and transcripts
Search Models
ChunkResult
Represents a matching chunk from a semantic search.
class ChunkResult:
content: str
score: float
document_id: str # external_id
chunk_number: int
metadata: Dict[str, Any]
content_type: str
filename: Optional[str]
download_url: Optional[str]
def augmented_content(self, doc: DocumentResult) -> str:
"""Get augmented content for video chunks with frame/transcript info"""
Query Models
CompletionResponse
The response from an AI completion request.
class CompletionResponse:
completion: str
usage: TokenUsage # completion_tokens, prompt_tokens, total_tokens
TokenUsage
Details about token usage in completion requests.
class TokenUsage:
completion_tokens: int
prompt_tokens: int
total_tokens: int