This commit is contained in:
David Alberto Adler
2025-09-07 20:40:53 +01:00
parent 0fc7236673
commit da48e8c4ea
166 changed files with 1689 additions and 4514 deletions
+240 -440
View File
@@ -3,6 +3,7 @@
from typing import TYPE_CHECKING
from importlib import import_module
import builtins
import sys
if TYPE_CHECKING:
from .annotationdetail import AnnotationDetail, AnnotationDetailTypedDict
@@ -45,6 +46,10 @@ if TYPE_CHECKING:
ChatCompletionChunkChoiceDeltaToolCallType,
ChatCompletionChunkChoiceDeltaToolCallTypedDict,
)
from .chatcompletionchunkwrapper import (
ChatCompletionChunkWrapper,
ChatCompletionChunkWrapperTypedDict,
)
from .chatcompletioncontentpart import (
ChatCompletionContentPart,
ChatCompletionContentPartTypedDict,
@@ -71,79 +76,79 @@ if TYPE_CHECKING:
ChatCompletionContentPartTextTypedDict,
)
from .chatcompletioncreateparams import (
Audio,
AudioTypedDict,
ChatCompletionCreateParams,
ChatCompletionCreateParamsAudio,
ChatCompletionCreateParamsAudioTypedDict,
ChatCompletionCreateParamsCompletion,
ChatCompletionCreateParamsCompletionTypedDict,
ChatCompletionCreateParamsDataCollection,
ChatCompletionCreateParamsEffort,
ChatCompletionCreateParamsEngine,
ChatCompletionCreateParamsIDChainOfThought,
ChatCompletionCreateParamsIDFileParser,
ChatCompletionCreateParamsIDModeration,
ChatCompletionCreateParamsIDWeb,
ChatCompletionCreateParamsIgnoreEnum,
ChatCompletionCreateParamsIgnoreUnion,
ChatCompletionCreateParamsIgnoreUnionTypedDict,
ChatCompletionCreateParamsImage,
ChatCompletionCreateParamsImageTypedDict,
ChatCompletionCreateParamsJSONSchema,
ChatCompletionCreateParamsJSONSchemaTypedDict,
ChatCompletionCreateParamsMaxPrice,
ChatCompletionCreateParamsMaxPriceTypedDict,
ChatCompletionCreateParamsOnlyEnum,
ChatCompletionCreateParamsOnlyUnion,
ChatCompletionCreateParamsOnlyUnionTypedDict,
ChatCompletionCreateParamsOrderEnum,
ChatCompletionCreateParamsOrderUnion,
ChatCompletionCreateParamsOrderUnionTypedDict,
ChatCompletionCreateParamsPdf,
ChatCompletionCreateParamsPdfEngine,
ChatCompletionCreateParamsPdfTypedDict,
ChatCompletionCreateParamsPluginChainOfThought,
ChatCompletionCreateParamsPluginChainOfThoughtTypedDict,
ChatCompletionCreateParamsPluginFileParser,
ChatCompletionCreateParamsPluginFileParserTypedDict,
ChatCompletionCreateParamsPluginModeration,
ChatCompletionCreateParamsPluginModerationTypedDict,
ChatCompletionCreateParamsPluginUnion,
ChatCompletionCreateParamsPluginUnionTypedDict,
ChatCompletionCreateParamsPluginWeb,
ChatCompletionCreateParamsPluginWebTypedDict,
ChatCompletionCreateParamsPrompt,
ChatCompletionCreateParamsPromptTypedDict,
ChatCompletionCreateParamsProvider,
ChatCompletionCreateParamsProviderTypedDict,
ChatCompletionCreateParamsQuantization,
ChatCompletionCreateParamsReasoning,
ChatCompletionCreateParamsReasoningEffort,
ChatCompletionCreateParamsReasoningTypedDict,
ChatCompletionCreateParamsRequest,
ChatCompletionCreateParamsRequestTypedDict,
ChatCompletionCreateParamsResponseFormatGrammar,
ChatCompletionCreateParamsResponseFormatGrammarTypedDict,
ChatCompletionCreateParamsResponseFormatJSONObject,
ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict,
ChatCompletionCreateParamsResponseFormatJSONSchema,
ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
ChatCompletionCreateParamsResponseFormatPython,
ChatCompletionCreateParamsResponseFormatPythonTypedDict,
ChatCompletionCreateParamsResponseFormatText,
ChatCompletionCreateParamsResponseFormatTextTypedDict,
ChatCompletionCreateParamsResponseFormatUnion,
ChatCompletionCreateParamsResponseFormatUnionTypedDict,
ChatCompletionCreateParamsSort,
ChatCompletionCreateParamsStop,
ChatCompletionCreateParamsStopTypedDict,
ChatCompletionCreateParamsStreamOptions,
ChatCompletionCreateParamsStreamOptionsTypedDict,
ChatCompletionCreateParamsTypeGrammar,
ChatCompletionCreateParamsTypeJSONObject,
ChatCompletionCreateParamsTypeJSONSchema,
ChatCompletionCreateParamsTypePython,
ChatCompletionCreateParamsTypeText,
ChatCompletionCreateParamsTypedDict,
Completion,
CompletionTypedDict,
DataCollection,
Effort,
Engine,
IDChainOfThought,
IDFileParser,
IDModeration,
IDWeb,
Ignore,
IgnoreEnum,
IgnoreTypedDict,
Image,
ImageTypedDict,
JSONSchema,
JSONSchemaTypedDict,
MaxPrice,
MaxPriceTypedDict,
Only,
OnlyEnum,
OnlyTypedDict,
Order,
OrderEnum,
OrderTypedDict,
Pdf,
PdfEngine,
PdfTypedDict,
Plugin,
PluginChainOfThought,
PluginChainOfThoughtTypedDict,
PluginFileParser,
PluginFileParserTypedDict,
PluginModeration,
PluginModerationTypedDict,
PluginTypedDict,
PluginWeb,
PluginWebTypedDict,
Prompt,
PromptTypedDict,
Provider,
ProviderTypedDict,
Quantization,
Reasoning,
ReasoningEffort,
ReasoningTypedDict,
Request,
RequestTypedDict,
ResponseFormat,
ResponseFormatGrammar,
ResponseFormatGrammarTypedDict,
ResponseFormatJSONObject,
ResponseFormatJSONObjectTypedDict,
ResponseFormatJSONSchema,
ResponseFormatJSONSchemaTypedDict,
ResponseFormatPython,
ResponseFormatPythonTypedDict,
ResponseFormatText,
ResponseFormatTextTypedDict,
ResponseFormatTypedDict,
Sort,
Stop,
StopTypedDict,
StreamOptions,
StreamOptionsTypedDict,
TypeGrammar,
TypeJSONObject,
TypeJSONSchema,
TypePython,
)
from .chatcompletionerror import Error, ErrorTypedDict
from .chatcompletionmessage import (
@@ -216,81 +221,6 @@ if TYPE_CHECKING:
ChatCompletionUserMessageParamRole,
ChatCompletionUserMessageParamTypedDict,
)
from .chatstreamcompletioncreateparams import (
ChatStreamCompletionCreateParams,
ChatStreamCompletionCreateParamsAudio,
ChatStreamCompletionCreateParamsAudioTypedDict,
ChatStreamCompletionCreateParamsCompletion,
ChatStreamCompletionCreateParamsCompletionTypedDict,
ChatStreamCompletionCreateParamsDataCollection,
ChatStreamCompletionCreateParamsEffort,
ChatStreamCompletionCreateParamsEngine,
ChatStreamCompletionCreateParamsIDChainOfThought,
ChatStreamCompletionCreateParamsIDFileParser,
ChatStreamCompletionCreateParamsIDModeration,
ChatStreamCompletionCreateParamsIDWeb,
ChatStreamCompletionCreateParamsIgnoreEnum,
ChatStreamCompletionCreateParamsIgnoreUnion,
ChatStreamCompletionCreateParamsIgnoreUnionTypedDict,
ChatStreamCompletionCreateParamsImage,
ChatStreamCompletionCreateParamsImageTypedDict,
ChatStreamCompletionCreateParamsJSONSchema,
ChatStreamCompletionCreateParamsJSONSchemaTypedDict,
ChatStreamCompletionCreateParamsMaxPrice,
ChatStreamCompletionCreateParamsMaxPriceTypedDict,
ChatStreamCompletionCreateParamsOnlyEnum,
ChatStreamCompletionCreateParamsOnlyUnion,
ChatStreamCompletionCreateParamsOnlyUnionTypedDict,
ChatStreamCompletionCreateParamsOrderEnum,
ChatStreamCompletionCreateParamsOrderUnion,
ChatStreamCompletionCreateParamsOrderUnionTypedDict,
ChatStreamCompletionCreateParamsPdf,
ChatStreamCompletionCreateParamsPdfEngine,
ChatStreamCompletionCreateParamsPdfTypedDict,
ChatStreamCompletionCreateParamsPluginChainOfThought,
ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict,
ChatStreamCompletionCreateParamsPluginFileParser,
ChatStreamCompletionCreateParamsPluginFileParserTypedDict,
ChatStreamCompletionCreateParamsPluginModeration,
ChatStreamCompletionCreateParamsPluginModerationTypedDict,
ChatStreamCompletionCreateParamsPluginUnion,
ChatStreamCompletionCreateParamsPluginUnionTypedDict,
ChatStreamCompletionCreateParamsPluginWeb,
ChatStreamCompletionCreateParamsPluginWebTypedDict,
ChatStreamCompletionCreateParamsPrompt,
ChatStreamCompletionCreateParamsPromptTypedDict,
ChatStreamCompletionCreateParamsProvider,
ChatStreamCompletionCreateParamsProviderTypedDict,
ChatStreamCompletionCreateParamsQuantization,
ChatStreamCompletionCreateParamsReasoning,
ChatStreamCompletionCreateParamsReasoningEffort,
ChatStreamCompletionCreateParamsReasoningTypedDict,
ChatStreamCompletionCreateParamsRequest,
ChatStreamCompletionCreateParamsRequestTypedDict,
ChatStreamCompletionCreateParamsResponseFormatGrammar,
ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict,
ChatStreamCompletionCreateParamsResponseFormatJSONObject,
ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict,
ChatStreamCompletionCreateParamsResponseFormatJSONSchema,
ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
ChatStreamCompletionCreateParamsResponseFormatPython,
ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict,
ChatStreamCompletionCreateParamsResponseFormatText,
ChatStreamCompletionCreateParamsResponseFormatTextTypedDict,
ChatStreamCompletionCreateParamsResponseFormatUnion,
ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict,
ChatStreamCompletionCreateParamsSort,
ChatStreamCompletionCreateParamsStop,
ChatStreamCompletionCreateParamsStopTypedDict,
ChatStreamCompletionCreateParamsStreamOptions,
ChatStreamCompletionCreateParamsStreamOptionsTypedDict,
ChatStreamCompletionCreateParamsTypeGrammar,
ChatStreamCompletionCreateParamsTypeJSONObject,
ChatStreamCompletionCreateParamsTypeJSONSchema,
ChatStreamCompletionCreateParamsTypePython,
ChatStreamCompletionCreateParamsTypeText,
ChatStreamCompletionCreateParamsTypedDict,
)
from .completionusage import (
CompletionTokensDetails,
CompletionTokensDetailsTypedDict,
@@ -299,6 +229,10 @@ if TYPE_CHECKING:
PromptTokensDetails,
PromptTokensDetailsTypedDict,
)
from .createchatcompletionop import (
CreateChatCompletionResponse,
CreateChatCompletionResponseTypedDict,
)
from .fileannotationdetail import (
ContentImageURL,
ContentImageURLTypedDict,
@@ -340,10 +274,6 @@ if TYPE_CHECKING:
ResponseFormatJSONSchemaSchemaTypedDict,
)
from .security import Security, SecurityTypedDict
from .streamchatcompletionop import (
StreamChatCompletionResponseBody,
StreamChatCompletionResponseBodyTypedDict,
)
from .urlcitationannotationdetail import (
URLCitation,
URLCitationAnnotationDetail,
@@ -355,6 +285,8 @@ if TYPE_CHECKING:
__all__ = [
"AnnotationDetail",
"AnnotationDetailTypedDict",
"Audio",
"AudioTypedDict",
"ChatCompletion",
"ChatCompletionAssistantMessageParam",
"ChatCompletionAssistantMessageParamContent",
@@ -378,6 +310,8 @@ __all__ = [
"ChatCompletionChunkChoiceTypedDict",
"ChatCompletionChunkObject",
"ChatCompletionChunkTypedDict",
"ChatCompletionChunkWrapper",
"ChatCompletionChunkWrapperTypedDict",
"ChatCompletionContentPart",
"ChatCompletionContentPartAudio",
"ChatCompletionContentPartAudioFormat",
@@ -393,76 +327,6 @@ __all__ = [
"ChatCompletionContentPartTextTypedDict",
"ChatCompletionContentPartTypedDict",
"ChatCompletionCreateParams",
"ChatCompletionCreateParamsAudio",
"ChatCompletionCreateParamsAudioTypedDict",
"ChatCompletionCreateParamsCompletion",
"ChatCompletionCreateParamsCompletionTypedDict",
"ChatCompletionCreateParamsDataCollection",
"ChatCompletionCreateParamsEffort",
"ChatCompletionCreateParamsEngine",
"ChatCompletionCreateParamsIDChainOfThought",
"ChatCompletionCreateParamsIDFileParser",
"ChatCompletionCreateParamsIDModeration",
"ChatCompletionCreateParamsIDWeb",
"ChatCompletionCreateParamsIgnoreEnum",
"ChatCompletionCreateParamsIgnoreUnion",
"ChatCompletionCreateParamsIgnoreUnionTypedDict",
"ChatCompletionCreateParamsImage",
"ChatCompletionCreateParamsImageTypedDict",
"ChatCompletionCreateParamsJSONSchema",
"ChatCompletionCreateParamsJSONSchemaTypedDict",
"ChatCompletionCreateParamsMaxPrice",
"ChatCompletionCreateParamsMaxPriceTypedDict",
"ChatCompletionCreateParamsOnlyEnum",
"ChatCompletionCreateParamsOnlyUnion",
"ChatCompletionCreateParamsOnlyUnionTypedDict",
"ChatCompletionCreateParamsOrderEnum",
"ChatCompletionCreateParamsOrderUnion",
"ChatCompletionCreateParamsOrderUnionTypedDict",
"ChatCompletionCreateParamsPdf",
"ChatCompletionCreateParamsPdfEngine",
"ChatCompletionCreateParamsPdfTypedDict",
"ChatCompletionCreateParamsPluginChainOfThought",
"ChatCompletionCreateParamsPluginChainOfThoughtTypedDict",
"ChatCompletionCreateParamsPluginFileParser",
"ChatCompletionCreateParamsPluginFileParserTypedDict",
"ChatCompletionCreateParamsPluginModeration",
"ChatCompletionCreateParamsPluginModerationTypedDict",
"ChatCompletionCreateParamsPluginUnion",
"ChatCompletionCreateParamsPluginUnionTypedDict",
"ChatCompletionCreateParamsPluginWeb",
"ChatCompletionCreateParamsPluginWebTypedDict",
"ChatCompletionCreateParamsPrompt",
"ChatCompletionCreateParamsPromptTypedDict",
"ChatCompletionCreateParamsProvider",
"ChatCompletionCreateParamsProviderTypedDict",
"ChatCompletionCreateParamsQuantization",
"ChatCompletionCreateParamsReasoning",
"ChatCompletionCreateParamsReasoningEffort",
"ChatCompletionCreateParamsReasoningTypedDict",
"ChatCompletionCreateParamsRequest",
"ChatCompletionCreateParamsRequestTypedDict",
"ChatCompletionCreateParamsResponseFormatGrammar",
"ChatCompletionCreateParamsResponseFormatGrammarTypedDict",
"ChatCompletionCreateParamsResponseFormatJSONObject",
"ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict",
"ChatCompletionCreateParamsResponseFormatJSONSchema",
"ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict",
"ChatCompletionCreateParamsResponseFormatPython",
"ChatCompletionCreateParamsResponseFormatPythonTypedDict",
"ChatCompletionCreateParamsResponseFormatText",
"ChatCompletionCreateParamsResponseFormatTextTypedDict",
"ChatCompletionCreateParamsResponseFormatUnion",
"ChatCompletionCreateParamsResponseFormatUnionTypedDict",
"ChatCompletionCreateParamsSort",
"ChatCompletionCreateParamsStop",
"ChatCompletionCreateParamsStopTypedDict",
"ChatCompletionCreateParamsStreamOptions",
"ChatCompletionCreateParamsStreamOptionsTypedDict",
"ChatCompletionCreateParamsTypeGrammar",
"ChatCompletionCreateParamsTypeJSONObject",
"ChatCompletionCreateParamsTypeJSONSchema",
"ChatCompletionCreateParamsTypePython",
"ChatCompletionCreateParamsTypeText",
"ChatCompletionCreateParamsTypedDict",
"ChatCompletionMessage",
@@ -511,81 +375,10 @@ __all__ = [
"ChatCompletionUserMessageParamContentTypedDict",
"ChatCompletionUserMessageParamRole",
"ChatCompletionUserMessageParamTypedDict",
"ChatStreamCompletionCreateParams",
"ChatStreamCompletionCreateParamsAudio",
"ChatStreamCompletionCreateParamsAudioTypedDict",
"ChatStreamCompletionCreateParamsCompletion",
"ChatStreamCompletionCreateParamsCompletionTypedDict",
"ChatStreamCompletionCreateParamsDataCollection",
"ChatStreamCompletionCreateParamsEffort",
"ChatStreamCompletionCreateParamsEngine",
"ChatStreamCompletionCreateParamsIDChainOfThought",
"ChatStreamCompletionCreateParamsIDFileParser",
"ChatStreamCompletionCreateParamsIDModeration",
"ChatStreamCompletionCreateParamsIDWeb",
"ChatStreamCompletionCreateParamsIgnoreEnum",
"ChatStreamCompletionCreateParamsIgnoreUnion",
"ChatStreamCompletionCreateParamsIgnoreUnionTypedDict",
"ChatStreamCompletionCreateParamsImage",
"ChatStreamCompletionCreateParamsImageTypedDict",
"ChatStreamCompletionCreateParamsJSONSchema",
"ChatStreamCompletionCreateParamsJSONSchemaTypedDict",
"ChatStreamCompletionCreateParamsMaxPrice",
"ChatStreamCompletionCreateParamsMaxPriceTypedDict",
"ChatStreamCompletionCreateParamsOnlyEnum",
"ChatStreamCompletionCreateParamsOnlyUnion",
"ChatStreamCompletionCreateParamsOnlyUnionTypedDict",
"ChatStreamCompletionCreateParamsOrderEnum",
"ChatStreamCompletionCreateParamsOrderUnion",
"ChatStreamCompletionCreateParamsOrderUnionTypedDict",
"ChatStreamCompletionCreateParamsPdf",
"ChatStreamCompletionCreateParamsPdfEngine",
"ChatStreamCompletionCreateParamsPdfTypedDict",
"ChatStreamCompletionCreateParamsPluginChainOfThought",
"ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict",
"ChatStreamCompletionCreateParamsPluginFileParser",
"ChatStreamCompletionCreateParamsPluginFileParserTypedDict",
"ChatStreamCompletionCreateParamsPluginModeration",
"ChatStreamCompletionCreateParamsPluginModerationTypedDict",
"ChatStreamCompletionCreateParamsPluginUnion",
"ChatStreamCompletionCreateParamsPluginUnionTypedDict",
"ChatStreamCompletionCreateParamsPluginWeb",
"ChatStreamCompletionCreateParamsPluginWebTypedDict",
"ChatStreamCompletionCreateParamsPrompt",
"ChatStreamCompletionCreateParamsPromptTypedDict",
"ChatStreamCompletionCreateParamsProvider",
"ChatStreamCompletionCreateParamsProviderTypedDict",
"ChatStreamCompletionCreateParamsQuantization",
"ChatStreamCompletionCreateParamsReasoning",
"ChatStreamCompletionCreateParamsReasoningEffort",
"ChatStreamCompletionCreateParamsReasoningTypedDict",
"ChatStreamCompletionCreateParamsRequest",
"ChatStreamCompletionCreateParamsRequestTypedDict",
"ChatStreamCompletionCreateParamsResponseFormatGrammar",
"ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict",
"ChatStreamCompletionCreateParamsResponseFormatJSONObject",
"ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict",
"ChatStreamCompletionCreateParamsResponseFormatJSONSchema",
"ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict",
"ChatStreamCompletionCreateParamsResponseFormatPython",
"ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict",
"ChatStreamCompletionCreateParamsResponseFormatText",
"ChatStreamCompletionCreateParamsResponseFormatTextTypedDict",
"ChatStreamCompletionCreateParamsResponseFormatUnion",
"ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict",
"ChatStreamCompletionCreateParamsSort",
"ChatStreamCompletionCreateParamsStop",
"ChatStreamCompletionCreateParamsStopTypedDict",
"ChatStreamCompletionCreateParamsStreamOptions",
"ChatStreamCompletionCreateParamsStreamOptionsTypedDict",
"ChatStreamCompletionCreateParamsTypeGrammar",
"ChatStreamCompletionCreateParamsTypeJSONObject",
"ChatStreamCompletionCreateParamsTypeJSONSchema",
"ChatStreamCompletionCreateParamsTypePython",
"ChatStreamCompletionCreateParamsTypeText",
"ChatStreamCompletionCreateParamsTypedDict",
"Completion",
"CompletionTokensDetails",
"CompletionTokensDetailsTypedDict",
"CompletionTypedDict",
"CompletionUsage",
"CompletionUsageTypedDict",
"ContentImageURL",
@@ -594,7 +387,12 @@ __all__ = [
"ContentTextTypedDict",
"ContentTypeImageURL",
"ContentTypeText",
"CreateChatCompletionResponse",
"CreateChatCompletionResponseTypedDict",
"DataCollection",
"Detail",
"Effort",
"Engine",
"Error",
"ErrorTypedDict",
"File",
@@ -605,12 +403,50 @@ __all__ = [
"FileAnnotationDetailImageURLTypedDict",
"FileAnnotationDetailTypedDict",
"FileTypedDict",
"IDChainOfThought",
"IDFileParser",
"IDModeration",
"IDWeb",
"Ignore",
"IgnoreEnum",
"IgnoreTypedDict",
"Image",
"ImageTypedDict",
"InputAudio",
"InputAudioTypedDict",
"JSONSchema",
"JSONSchemaTypedDict",
"MaxPrice",
"MaxPriceTypedDict",
"Only",
"OnlyEnum",
"OnlyTypedDict",
"Order",
"OrderEnum",
"OrderTypedDict",
"Parameters",
"ParametersTypedDict",
"Pdf",
"PdfEngine",
"PdfTypedDict",
"Plugin",
"PluginChainOfThought",
"PluginChainOfThoughtTypedDict",
"PluginFileParser",
"PluginFileParserTypedDict",
"PluginModeration",
"PluginModerationTypedDict",
"PluginTypedDict",
"PluginWeb",
"PluginWebTypedDict",
"Prompt",
"PromptTokensDetails",
"PromptTokensDetailsTypedDict",
"PromptTypedDict",
"Provider",
"ProviderTypedDict",
"Quantization",
"Reasoning",
"ReasoningDetail",
"ReasoningDetailEncrypted",
"ReasoningDetailEncryptedFormat",
@@ -625,15 +461,38 @@ __all__ = [
"ReasoningDetailTextType",
"ReasoningDetailTextTypedDict",
"ReasoningDetailTypedDict",
"ReasoningEffort",
"ReasoningTypedDict",
"Request",
"RequestTypedDict",
"ResponseFormat",
"ResponseFormatGrammar",
"ResponseFormatGrammarTypedDict",
"ResponseFormatJSONObject",
"ResponseFormatJSONObjectTypedDict",
"ResponseFormatJSONSchema",
"ResponseFormatJSONSchemaSchema",
"ResponseFormatJSONSchemaSchemaTypedDict",
"ResponseFormatJSONSchemaTypedDict",
"ResponseFormatPython",
"ResponseFormatPythonTypedDict",
"ResponseFormatText",
"ResponseFormatTextTypedDict",
"ResponseFormatTypedDict",
"Security",
"SecurityTypedDict",
"StreamChatCompletionResponseBody",
"StreamChatCompletionResponseBodyTypedDict",
"Sort",
"Stop",
"StopTypedDict",
"StreamOptions",
"StreamOptionsTypedDict",
"TopLogprob",
"TopLogprobTypedDict",
"TypeFile",
"TypeGrammar",
"TypeJSONObject",
"TypeJSONSchema",
"TypePython",
"URLCitation",
"URLCitationAnnotationDetail",
"URLCitationAnnotationDetailType",
@@ -669,6 +528,8 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionChunkChoiceDeltaToolCallFunctionTypedDict": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkChoiceDeltaToolCallType": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkChoiceDeltaToolCallTypedDict": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkWrapper": ".chatcompletionchunkwrapper",
"ChatCompletionChunkWrapperTypedDict": ".chatcompletionchunkwrapper",
"ChatCompletionContentPart": ".chatcompletioncontentpart",
"ChatCompletionContentPartTypedDict": ".chatcompletioncontentpart",
"ChatCompletionContentPartAudio": ".chatcompletioncontentpartaudio",
@@ -686,79 +547,79 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionContentPartText": ".chatcompletioncontentparttext",
"ChatCompletionContentPartTextType": ".chatcompletioncontentparttext",
"ChatCompletionContentPartTextTypedDict": ".chatcompletioncontentparttext",
"Audio": ".chatcompletioncreateparams",
"AudioTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParams": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsAudio": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsAudioTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsCompletion": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsCompletionTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsDataCollection": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsEffort": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsEngine": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIDChainOfThought": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIDFileParser": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIDModeration": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIDWeb": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIgnoreEnum": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIgnoreUnion": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsIgnoreUnionTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsImage": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsImageTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsJSONSchema": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsJSONSchemaTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsMaxPrice": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsMaxPriceTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsOnlyEnum": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsOnlyUnion": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsOnlyUnionTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsOrderEnum": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsOrderUnion": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsOrderUnionTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPdf": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPdfEngine": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPdfTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginChainOfThought": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginChainOfThoughtTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginFileParser": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginFileParserTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginModeration": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginModerationTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginUnion": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginUnionTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginWeb": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPluginWebTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPrompt": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsPromptTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsProvider": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsProviderTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsQuantization": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsReasoning": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsReasoningEffort": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsReasoningTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsRequest": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsRequestTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatGrammar": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatGrammarTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatJSONObject": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatJSONSchema": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatPython": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatPythonTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatText": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatTextTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatUnion": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsResponseFormatUnionTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsSort": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsStop": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsStopTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsStreamOptions": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsStreamOptionsTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypeGrammar": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypeJSONObject": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypeJSONSchema": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypePython": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypeText": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypedDict": ".chatcompletioncreateparams",
"Completion": ".chatcompletioncreateparams",
"CompletionTypedDict": ".chatcompletioncreateparams",
"DataCollection": ".chatcompletioncreateparams",
"Effort": ".chatcompletioncreateparams",
"Engine": ".chatcompletioncreateparams",
"IDChainOfThought": ".chatcompletioncreateparams",
"IDFileParser": ".chatcompletioncreateparams",
"IDModeration": ".chatcompletioncreateparams",
"IDWeb": ".chatcompletioncreateparams",
"Ignore": ".chatcompletioncreateparams",
"IgnoreEnum": ".chatcompletioncreateparams",
"IgnoreTypedDict": ".chatcompletioncreateparams",
"Image": ".chatcompletioncreateparams",
"ImageTypedDict": ".chatcompletioncreateparams",
"JSONSchema": ".chatcompletioncreateparams",
"JSONSchemaTypedDict": ".chatcompletioncreateparams",
"MaxPrice": ".chatcompletioncreateparams",
"MaxPriceTypedDict": ".chatcompletioncreateparams",
"Only": ".chatcompletioncreateparams",
"OnlyEnum": ".chatcompletioncreateparams",
"OnlyTypedDict": ".chatcompletioncreateparams",
"Order": ".chatcompletioncreateparams",
"OrderEnum": ".chatcompletioncreateparams",
"OrderTypedDict": ".chatcompletioncreateparams",
"Pdf": ".chatcompletioncreateparams",
"PdfEngine": ".chatcompletioncreateparams",
"PdfTypedDict": ".chatcompletioncreateparams",
"Plugin": ".chatcompletioncreateparams",
"PluginChainOfThought": ".chatcompletioncreateparams",
"PluginChainOfThoughtTypedDict": ".chatcompletioncreateparams",
"PluginFileParser": ".chatcompletioncreateparams",
"PluginFileParserTypedDict": ".chatcompletioncreateparams",
"PluginModeration": ".chatcompletioncreateparams",
"PluginModerationTypedDict": ".chatcompletioncreateparams",
"PluginTypedDict": ".chatcompletioncreateparams",
"PluginWeb": ".chatcompletioncreateparams",
"PluginWebTypedDict": ".chatcompletioncreateparams",
"Prompt": ".chatcompletioncreateparams",
"PromptTypedDict": ".chatcompletioncreateparams",
"Provider": ".chatcompletioncreateparams",
"ProviderTypedDict": ".chatcompletioncreateparams",
"Quantization": ".chatcompletioncreateparams",
"Reasoning": ".chatcompletioncreateparams",
"ReasoningEffort": ".chatcompletioncreateparams",
"ReasoningTypedDict": ".chatcompletioncreateparams",
"Request": ".chatcompletioncreateparams",
"RequestTypedDict": ".chatcompletioncreateparams",
"ResponseFormat": ".chatcompletioncreateparams",
"ResponseFormatGrammar": ".chatcompletioncreateparams",
"ResponseFormatGrammarTypedDict": ".chatcompletioncreateparams",
"ResponseFormatJSONObject": ".chatcompletioncreateparams",
"ResponseFormatJSONObjectTypedDict": ".chatcompletioncreateparams",
"ResponseFormatJSONSchema": ".chatcompletioncreateparams",
"ResponseFormatJSONSchemaTypedDict": ".chatcompletioncreateparams",
"ResponseFormatPython": ".chatcompletioncreateparams",
"ResponseFormatPythonTypedDict": ".chatcompletioncreateparams",
"ResponseFormatText": ".chatcompletioncreateparams",
"ResponseFormatTextTypedDict": ".chatcompletioncreateparams",
"ResponseFormatTypedDict": ".chatcompletioncreateparams",
"Sort": ".chatcompletioncreateparams",
"Stop": ".chatcompletioncreateparams",
"StopTypedDict": ".chatcompletioncreateparams",
"StreamOptions": ".chatcompletioncreateparams",
"StreamOptionsTypedDict": ".chatcompletioncreateparams",
"TypeGrammar": ".chatcompletioncreateparams",
"TypeJSONObject": ".chatcompletioncreateparams",
"TypeJSONSchema": ".chatcompletioncreateparams",
"TypePython": ".chatcompletioncreateparams",
"Error": ".chatcompletionerror",
"ErrorTypedDict": ".chatcompletionerror",
"ChatCompletionMessage": ".chatcompletionmessage",
@@ -809,85 +670,14 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionUserMessageParamContentTypedDict": ".chatcompletionusermessageparam",
"ChatCompletionUserMessageParamRole": ".chatcompletionusermessageparam",
"ChatCompletionUserMessageParamTypedDict": ".chatcompletionusermessageparam",
"ChatStreamCompletionCreateParams": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsAudio": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsAudioTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsCompletion": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsCompletionTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsDataCollection": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsEffort": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsEngine": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIDChainOfThought": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIDFileParser": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIDModeration": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIDWeb": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIgnoreEnum": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIgnoreUnion": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsIgnoreUnionTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsImage": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsImageTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsJSONSchema": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsJSONSchemaTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsMaxPrice": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsMaxPriceTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsOnlyEnum": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsOnlyUnion": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsOnlyUnionTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsOrderEnum": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsOrderUnion": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsOrderUnionTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPdf": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPdfEngine": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPdfTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginChainOfThought": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginFileParser": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginFileParserTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginModeration": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginModerationTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginUnion": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginUnionTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginWeb": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPluginWebTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPrompt": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsPromptTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsProvider": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsProviderTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsQuantization": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsReasoning": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsReasoningEffort": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsReasoningTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsRequest": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsRequestTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatGrammar": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatJSONObject": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatJSONSchema": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatPython": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatText": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatTextTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatUnion": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsSort": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsStop": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsStopTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsStreamOptions": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsStreamOptionsTypedDict": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsTypeGrammar": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsTypeJSONObject": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsTypeJSONSchema": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsTypePython": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsTypeText": ".chatstreamcompletioncreateparams",
"ChatStreamCompletionCreateParamsTypedDict": ".chatstreamcompletioncreateparams",
"CompletionTokensDetails": ".completionusage",
"CompletionTokensDetailsTypedDict": ".completionusage",
"CompletionUsage": ".completionusage",
"CompletionUsageTypedDict": ".completionusage",
"PromptTokensDetails": ".completionusage",
"PromptTokensDetailsTypedDict": ".completionusage",
"CreateChatCompletionResponse": ".createchatcompletionop",
"CreateChatCompletionResponseTypedDict": ".createchatcompletionop",
"ContentImageURL": ".fileannotationdetail",
"ContentImageURLTypedDict": ".fileannotationdetail",
"ContentText": ".fileannotationdetail",
@@ -921,8 +711,6 @@ _dynamic_imports: dict[str, str] = {
"ResponseFormatJSONSchemaSchemaTypedDict": ".responseformatjsonschemaschema",
"Security": ".security",
"SecurityTypedDict": ".security",
"StreamChatCompletionResponseBody": ".streamchatcompletionop",
"StreamChatCompletionResponseBodyTypedDict": ".streamchatcompletionop",
"URLCitation": ".urlcitationannotationdetail",
"URLCitationAnnotationDetail": ".urlcitationannotationdetail",
"URLCitationAnnotationDetailType": ".urlcitationannotationdetail",
@@ -931,6 +719,18 @@ _dynamic_imports: dict[str, str] = {
}
def dynamic_import(modname, retries=3):
for attempt in range(retries):
try:
return import_module(modname, __package__)
except KeyError:
# Clear any half-initialized module and retry
sys.modules.pop(modname, None)
if attempt == retries - 1:
break
raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
def __getattr__(attr_name: str) -> object:
module_name = _dynamic_imports.get(attr_name)
if module_name is None:
@@ -939,7 +739,7 @@ def __getattr__(attr_name: str) -> object:
)
try:
module = import_module(module_name, __package__)
module = dynamic_import(module_name)
result = getattr(module, attr_name)
return result
except ImportError as e:
+2 -4
View File
@@ -3,7 +3,6 @@
from __future__ import annotations
from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict
from .completionusage import CompletionUsage, CompletionUsageTypedDict
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -12,12 +11,11 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import List, Optional
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionObject(str, Enum):
CHAT_COMPLETION = "chat.completion"
ChatCompletionObject = Literal["chat.completion"]
class ChatCompletionTypedDict(TypedDict):
@@ -9,7 +9,6 @@ from .chatcompletionmessagetoolcall import (
ChatCompletionMessageToolCall,
ChatCompletionMessageToolCallTypedDict,
)
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -18,13 +17,11 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import Any, List, Optional, Union
from typing import Any, List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
class ChatCompletionAssistantMessageParamRole(str, Enum):
ASSISTANT = "assistant"
ChatCompletionAssistantMessageParamRole = Literal["assistant"]
ChatCompletionAssistantMessageParamContentTypedDict = TypeAliasType(
"ChatCompletionAssistantMessageParamContentTypedDict",
@@ -6,7 +6,6 @@ from .chatcompletiontokenlogprobs import (
ChatCompletionTokenLogprobs,
ChatCompletionTokenLogprobsTypedDict,
)
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -15,17 +14,14 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import Literal
from typing_extensions import NotRequired, TypedDict
class ChatCompletionChoiceFinishReason(str, Enum):
r"""Reason the completion finished"""
TOOL_CALLS = "tool_calls"
STOP = "stop"
LENGTH = "length"
CONTENT_FILTER = "content_filter"
ERROR = "error"
ChatCompletionChoiceFinishReason = Literal[
"tool_calls", "stop", "length", "content_filter", "error"
]
r"""Reason the completion finished"""
class ChatCompletionChoiceTypedDict(TypedDict):
+2 -4
View File
@@ -6,7 +6,6 @@ from .chatcompletionchunkchoice import (
ChatCompletionChunkChoiceTypedDict,
)
from .completionusage import CompletionUsage, CompletionUsageTypedDict
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -15,12 +14,11 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import List, Optional
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionChunkObject(str, Enum):
CHAT_COMPLETION_CHUNK = "chat.completion.chunk"
ChatCompletionChunkObject = Literal["chat.completion.chunk"]
class ChatCompletionChunkTypedDict(TypedDict):
@@ -9,7 +9,6 @@ from .chatcompletiontokenlogprobs import (
ChatCompletionTokenLogprobs,
ChatCompletionTokenLogprobsTypedDict,
)
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -18,15 +17,13 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import Literal
from typing_extensions import NotRequired, TypedDict
class ChatCompletionChunkChoiceFinishReason(str, Enum):
TOOL_CALLS = "tool_calls"
STOP = "stop"
LENGTH = "length"
CONTENT_FILTER = "content_filter"
ERROR = "error"
ChatCompletionChunkChoiceFinishReason = Literal[
"tool_calls", "stop", "length", "content_filter", "error"
]
class ChatCompletionChunkChoiceTypedDict(TypedDict):
@@ -7,7 +7,6 @@ from .chatcompletionchunkchoicedeltatoolcall import (
ChatCompletionChunkChoiceDeltaToolCallTypedDict,
)
from .reasoningdetail import ReasoningDetail, ReasoningDetailTypedDict
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -16,14 +15,12 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import List, Optional
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionChunkChoiceDeltaRole(str, Enum):
r"""The role of the message author"""
ASSISTANT = "assistant"
ChatCompletionChunkChoiceDeltaRole = Literal["assistant"]
r"""The role of the message author"""
class ChatCompletionChunkChoiceDeltaTypedDict(TypedDict):
@@ -1,16 +1,13 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import Optional
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionChunkChoiceDeltaToolCallType(str, Enum):
r"""Tool call type"""
FUNCTION = "function"
ChatCompletionChunkChoiceDeltaToolCallType = Literal["function"]
r"""Tool call type"""
class ChatCompletionChunkChoiceDeltaToolCallFunctionTypedDict(TypedDict):
@@ -6,15 +6,11 @@ from openrouter.types import BaseModel
from typing_extensions import TypedDict
class StreamChatCompletionResponseBodyTypedDict(TypedDict):
r"""Successful chat completion response"""
class ChatCompletionChunkWrapperTypedDict(TypedDict):
data: ChatCompletionChunkTypedDict
r"""Streaming chat completion chunk"""
class StreamChatCompletionResponseBody(BaseModel):
r"""Successful chat completion response"""
class ChatCompletionChunkWrapper(BaseModel):
data: ChatCompletionChunk
r"""Streaming chat completion chunk"""
@@ -1,26 +1,18 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
import pydantic
from typing import Literal
from typing_extensions import Annotated, TypedDict
class ChatCompletionContentPartAudioType(str, Enum):
INPUT_AUDIO = "input_audio"
ChatCompletionContentPartAudioType = Literal["input_audio"]
class ChatCompletionContentPartAudioFormat(str, Enum):
r"""Audio format"""
WAV = "wav"
MP3 = "mp3"
FLAC = "flac"
M4A = "m4a"
OGG = "ogg"
PCM16 = "pcm16"
PCM24 = "pcm24"
ChatCompletionContentPartAudioFormat = Literal[
"wav", "mp3", "flac", "m4a", "ogg", "pcm16", "pcm24"
]
r"""Audio format"""
class InputAudioTypedDict(TypedDict):
@@ -1,22 +1,15 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import Optional
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionContentPartImageType(str, Enum):
IMAGE_URL = "image_url"
ChatCompletionContentPartImageType = Literal["image_url"]
class Detail(str, Enum):
r"""Image detail level for vision models"""
AUTO = "auto"
LOW = "low"
HIGH = "high"
Detail = Literal["auto", "low", "high"]
r"""Image detail level for vision models"""
class ChatCompletionContentPartImageImageURLTypedDict(TypedDict):
@@ -1,13 +1,12 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import Literal
from typing_extensions import TypedDict
class ChatCompletionContentPartTextType(str, Enum):
TEXT = "text"
ChatCompletionContentPartTextType = Literal["text"]
class ChatCompletionContentPartTextTypedDict(TypedDict):
File diff suppressed because it is too large Load Diff
+16 -9
View File
@@ -1,34 +1,41 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing_extensions import TypedDict
from typing import Optional
from typing_extensions import NotRequired, TypedDict
class ErrorTypedDict(TypedDict):
r"""Error object structure"""
code: Nullable[str]
code: Nullable[float]
message: str
param: Nullable[str]
type: str
param: NotRequired[Nullable[str]]
type: NotRequired[str]
class Error(BaseModel):
r"""Error object structure"""
code: Nullable[str]
code: Nullable[float]
message: str
param: Nullable[str]
param: OptionalNullable[str] = UNSET
type: str
type: Optional[str] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = []
optional_fields = ["param", "type"]
nullable_fields = ["code", "param"]
null_default_fields = []
@@ -7,7 +7,6 @@ from .chatcompletionmessagetoolcall import (
ChatCompletionMessageToolCallTypedDict,
)
from .reasoningdetail import ReasoningDetail, ReasoningDetailTypedDict
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -16,12 +15,11 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import List, Optional
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionMessageRole(str, Enum):
ASSISTANT = "assistant"
ChatCompletionMessageRole = Literal["assistant"]
class ChatCompletionMessageTypedDict(TypedDict):
@@ -1,13 +1,12 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import Literal
from typing_extensions import TypedDict
class ChatCompletionMessageToolCallType(str, Enum):
FUNCTION = "function"
ChatCompletionMessageToolCallType = Literal["function"]
class ChatCompletionMessageToolCallFunctionTypedDict(TypedDict):
@@ -1,13 +1,12 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import Literal
from typing_extensions import TypedDict
class ChatCompletionNamedToolChoiceType(str, Enum):
FUNCTION = "function"
ChatCompletionNamedToolChoiceType = Literal["function"]
class ChatCompletionNamedToolChoiceFunctionTypedDict(TypedDict):
@@ -5,15 +5,12 @@ from .chatcompletioncontentparttext import (
ChatCompletionContentPartText,
ChatCompletionContentPartTextTypedDict,
)
from enum import Enum
from openrouter.types import BaseModel
from typing import List, Optional, Union
from typing import List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
class ChatCompletionSystemMessageParamRole(str, Enum):
SYSTEM = "system"
ChatCompletionSystemMessageParamRole = Literal["system"]
ChatCompletionSystemMessageParamContentTypedDict = TypeAliasType(
"ChatCompletionSystemMessageParamContentTypedDict",
+2 -4
View File
@@ -1,7 +1,6 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -10,12 +9,11 @@ from openrouter.types import (
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing import Optional
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
class ChatCompletionToolType(str, Enum):
FUNCTION = "function"
ChatCompletionToolType = Literal["function"]
class ParametersTypedDict(TypedDict):
@@ -5,22 +5,15 @@ from .chatcompletionnamedtoolchoice import (
ChatCompletionNamedToolChoice,
ChatCompletionNamedToolChoiceTypedDict,
)
from enum import Enum
from typing import Union
from typing import Literal, Union
from typing_extensions import TypeAliasType
class ChatCompletionToolChoiceOptionRequired(str, Enum):
REQUIRED = "required"
ChatCompletionToolChoiceOptionRequired = Literal["required"]
ChatCompletionToolChoiceOptionAuto = Literal["auto"]
class ChatCompletionToolChoiceOptionAuto(str, Enum):
AUTO = "auto"
class ChatCompletionToolChoiceOptionNone(str, Enum):
NONE = "none"
ChatCompletionToolChoiceOptionNone = Literal["none"]
ChatCompletionToolChoiceOptionTypedDict = TypeAliasType(
"ChatCompletionToolChoiceOptionTypedDict",
@@ -5,15 +5,12 @@ from .chatcompletioncontentpart import (
ChatCompletionContentPart,
ChatCompletionContentPartTypedDict,
)
from enum import Enum
from openrouter.types import BaseModel
from typing import List, Union
from typing import List, Literal, Union
from typing_extensions import TypeAliasType, TypedDict
class ChatCompletionToolMessageParamRole(str, Enum):
TOOL = "tool"
ChatCompletionToolMessageParamRole = Literal["tool"]
ChatCompletionToolMessageParamContentTypedDict = TypeAliasType(
"ChatCompletionToolMessageParamContentTypedDict",
@@ -5,15 +5,12 @@ from .chatcompletioncontentpart import (
ChatCompletionContentPart,
ChatCompletionContentPartTypedDict,
)
from enum import Enum
from openrouter.types import BaseModel
from typing import List, Optional, Union
from typing import List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
class ChatCompletionUserMessageParamRole(str, Enum):
USER = "user"
ChatCompletionUserMessageParamRole = Literal["user"]
ChatCompletionUserMessageParamContentTypedDict = TypeAliasType(
"ChatCompletionUserMessageParamContentTypedDict",
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,35 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .chatcompletion import ChatCompletion, ChatCompletionTypedDict
from .chatcompletionchunkwrapper import (
ChatCompletionChunkWrapper,
ChatCompletionChunkWrapperTypedDict,
)
from openrouter.utils import eventstreaming
from typing import Union
from typing_extensions import TypeAliasType
CreateChatCompletionResponseTypedDict = TypeAliasType(
"CreateChatCompletionResponseTypedDict",
Union[
ChatCompletionTypedDict,
Union[
eventstreaming.EventStream[ChatCompletionChunkWrapperTypedDict],
eventstreaming.EventStreamAsync[ChatCompletionChunkWrapperTypedDict],
],
],
)
CreateChatCompletionResponse = TypeAliasType(
"CreateChatCompletionResponse",
Union[
ChatCompletion,
Union[
eventstreaming.EventStream[ChatCompletionChunkWrapper],
eventstreaming.EventStreamAsync[ChatCompletionChunkWrapper],
],
],
)
@@ -1,18 +1,14 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import List, Optional, Union
from typing import List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
class TypeFile(str, Enum):
FILE = "file"
TypeFile = Literal["file"]
class ContentTypeImageURL(str, Enum):
IMAGE_URL = "image_url"
ContentTypeImageURL = Literal["image_url"]
class FileAnnotationDetailImageURLTypedDict(TypedDict):
@@ -34,8 +30,7 @@ class ContentImageURL(BaseModel):
image_url: FileAnnotationDetailImageURL
class ContentTypeText(str, Enum):
TEXT = "text"
ContentTypeText = Literal["text"]
class ContentTextTypedDict(TypedDict):
@@ -1,7 +1,6 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -11,18 +10,15 @@ from openrouter.types import (
)
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class ReasoningDetailEncryptedType(str, Enum):
REASONING_ENCRYPTED = "reasoning.encrypted"
ReasoningDetailEncryptedType = Literal["reasoning.encrypted"]
class ReasoningDetailEncryptedFormat(str, Enum):
UNKNOWN = "unknown"
OPENAI_RESPONSES_V1 = "openai-responses-v1"
ANTHROPIC_CLAUDE_V1 = "anthropic-claude-v1"
ReasoningDetailEncryptedFormat = Literal[
"unknown", "openai-responses-v1", "anthropic-claude-v1"
]
class ReasoningDetailEncryptedTypedDict(TypedDict):
@@ -46,7 +42,7 @@ class ReasoningDetailEncrypted(BaseModel):
format_: Annotated[
OptionalNullable[ReasoningDetailEncryptedFormat], pydantic.Field(alias="format")
] = ReasoningDetailEncryptedFormat.ANTHROPIC_CLAUDE_V1
] = "anthropic-claude-v1"
index: Optional[float] = None
@@ -1,7 +1,6 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -11,18 +10,15 @@ from openrouter.types import (
)
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class ReasoningDetailSummaryType(str, Enum):
REASONING_SUMMARY = "reasoning.summary"
ReasoningDetailSummaryType = Literal["reasoning.summary"]
class ReasoningDetailSummaryFormat(str, Enum):
UNKNOWN = "unknown"
OPENAI_RESPONSES_V1 = "openai-responses-v1"
ANTHROPIC_CLAUDE_V1 = "anthropic-claude-v1"
ReasoningDetailSummaryFormat = Literal[
"unknown", "openai-responses-v1", "anthropic-claude-v1"
]
class ReasoningDetailSummaryTypedDict(TypedDict):
@@ -46,7 +42,7 @@ class ReasoningDetailSummary(BaseModel):
format_: Annotated[
OptionalNullable[ReasoningDetailSummaryFormat], pydantic.Field(alias="format")
] = ReasoningDetailSummaryFormat.ANTHROPIC_CLAUDE_V1
] = "anthropic-claude-v1"
index: Optional[float] = None
+6 -10
View File
@@ -1,7 +1,6 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import (
BaseModel,
Nullable,
@@ -11,18 +10,15 @@ from openrouter.types import (
)
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class ReasoningDetailTextType(str, Enum):
REASONING_TEXT = "reasoning.text"
ReasoningDetailTextType = Literal["reasoning.text"]
class ReasoningDetailTextFormat(str, Enum):
UNKNOWN = "unknown"
OPENAI_RESPONSES_V1 = "openai-responses-v1"
ANTHROPIC_CLAUDE_V1 = "anthropic-claude-v1"
ReasoningDetailTextFormat = Literal[
"unknown", "openai-responses-v1", "anthropic-claude-v1"
]
class ReasoningDetailTextTypedDict(TypedDict):
@@ -49,7 +45,7 @@ class ReasoningDetailText(BaseModel):
format_: Annotated[
OptionalNullable[ReasoningDetailTextFormat], pydantic.Field(alias="format")
] = ReasoningDetailTextFormat.ANTHROPIC_CLAUDE_V1
] = "anthropic-claude-v1"
index: Optional[float] = None
+2 -2
View File
@@ -8,11 +8,11 @@ from typing_extensions import Annotated, NotRequired, TypedDict
class SecurityTypedDict(TypedDict):
bearer_auth: NotRequired[str]
api_key: NotRequired[str]
class Security(BaseModel):
bearer_auth: Annotated[
api_key: Annotated[
Optional[str],
FieldMetadata(
security=SecurityMetadata(
@@ -1,14 +1,12 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from openrouter.types import BaseModel
from typing import Optional
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
class URLCitationAnnotationDetailType(str, Enum):
URL_CITATION = "url_citation"
URLCitationAnnotationDetailType = Literal["url_citation"]
class URLCitationTypedDict(TypedDict):