Files
openrouter-python-sdk-retry…/src/openrouter/models/fileannotationdetail.py
T

85 lines
1.7 KiB
Python

"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from typing import List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
TypeFile = Literal["file"]
ContentTypeImageURL = Literal["image_url"]
class FileAnnotationDetailImageURLTypedDict(TypedDict):
url: str
class FileAnnotationDetailImageURL(BaseModel):
url: str
class ContentImageURLTypedDict(TypedDict):
type: ContentTypeImageURL
image_url: FileAnnotationDetailImageURLTypedDict
class ContentImageURL(BaseModel):
type: ContentTypeImageURL
image_url: FileAnnotationDetailImageURL
ContentTypeText = Literal["text"]
class ContentTextTypedDict(TypedDict):
type: ContentTypeText
text: str
class ContentText(BaseModel):
type: ContentTypeText
text: str
FileAnnotationDetailContentUnionTypedDict = TypeAliasType(
"FileAnnotationDetailContentUnionTypedDict",
Union[ContentTextTypedDict, ContentImageURLTypedDict],
)
FileAnnotationDetailContentUnion = TypeAliasType(
"FileAnnotationDetailContentUnion", Union[ContentText, ContentImageURL]
)
class FileTypedDict(TypedDict):
hash: str
content: List[FileAnnotationDetailContentUnionTypedDict]
name: NotRequired[str]
class File(BaseModel):
hash: str
content: List[FileAnnotationDetailContentUnion]
name: Optional[str] = None
class FileAnnotationDetailTypedDict(TypedDict):
r"""File annotation with content"""
type: TypeFile
file: FileTypedDict
class FileAnnotationDetail(BaseModel):
r"""File annotation with content"""
type: TypeFile
file: File