feat: move to overload typing for stream:true intent for sse

This commit is contained in:
David Alberto Adler
2025-09-08 12:21:06 +01:00
parent 2988b5e385
commit 80fd801021
129 changed files with 1218 additions and 3872 deletions
+3 -3
View File
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
__version__: str = "0.5.2"
__version__: str = "0.6.2"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.694.1"
__user_agent__: str = "speakeasy-sdk/python 0.5.2 2.694.1 1.0.0 openrouter"
__gen_version__: str = "2.695.0"
__user_agent__: str = "speakeasy-sdk/python 0.6.2 2.695.0 1.0.0 openrouter"
try:
if __package__ is not None:
+296 -568
View File
File diff suppressed because it is too large Load Diff
+226 -439
View File
@@ -46,6 +46,10 @@ if TYPE_CHECKING:
ChatCompletionChunkChoiceDeltaToolCallType,
ChatCompletionChunkChoiceDeltaToolCallTypedDict,
)
from .chatcompletionchunkwrapper import (
ChatCompletionChunkWrapper,
ChatCompletionChunkWrapperTypedDict,
)
from .chatcompletioncontentpart import (
ChatCompletionContentPart,
ChatCompletionContentPartTypedDict,
@@ -72,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 (
@@ -217,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,
@@ -300,6 +229,10 @@ if TYPE_CHECKING:
PromptTokensDetails,
PromptTokensDetailsTypedDict,
)
from .createchatcompletionop import (
CreateChatCompletionResponse,
CreateChatCompletionResponseTypedDict,
)
from .fileannotationdetail import (
ContentImageURL,
ContentImageURLTypedDict,
@@ -341,10 +274,6 @@ if TYPE_CHECKING:
ResponseFormatJSONSchemaSchemaTypedDict,
)
from .security import Security, SecurityTypedDict
from .streamchatcompletionop import (
StreamChatCompletionResponseBody,
StreamChatCompletionResponseBodyTypedDict,
)
from .urlcitationannotationdetail import (
URLCitation,
URLCitationAnnotationDetail,
@@ -356,6 +285,8 @@ if TYPE_CHECKING:
__all__ = [
"AnnotationDetail",
"AnnotationDetailTypedDict",
"Audio",
"AudioTypedDict",
"ChatCompletion",
"ChatCompletionAssistantMessageParam",
"ChatCompletionAssistantMessageParamContent",
@@ -379,6 +310,8 @@ __all__ = [
"ChatCompletionChunkChoiceTypedDict",
"ChatCompletionChunkObject",
"ChatCompletionChunkTypedDict",
"ChatCompletionChunkWrapper",
"ChatCompletionChunkWrapperTypedDict",
"ChatCompletionContentPart",
"ChatCompletionContentPartAudio",
"ChatCompletionContentPartAudioFormat",
@@ -394,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",
@@ -512,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",
@@ -595,7 +387,12 @@ __all__ = [
"ContentTextTypedDict",
"ContentTypeImageURL",
"ContentTypeText",
"CreateChatCompletionResponse",
"CreateChatCompletionResponseTypedDict",
"DataCollection",
"Detail",
"Effort",
"Engine",
"Error",
"ErrorTypedDict",
"File",
@@ -606,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",
@@ -626,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",
@@ -670,6 +528,8 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionChunkChoiceDeltaToolCallFunctionTypedDict": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkChoiceDeltaToolCallType": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkChoiceDeltaToolCallTypedDict": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkWrapper": ".chatcompletionchunkwrapper",
"ChatCompletionChunkWrapperTypedDict": ".chatcompletionchunkwrapper",
"ChatCompletionContentPart": ".chatcompletioncontentpart",
"ChatCompletionContentPartTypedDict": ".chatcompletioncontentpart",
"ChatCompletionContentPartAudio": ".chatcompletioncontentpartaudio",
@@ -687,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",
@@ -810,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",
@@ -922,8 +711,6 @@ _dynamic_imports: dict[str, str] = {
"ResponseFormatJSONSchemaSchemaTypedDict": ".responseformatjsonschemaschema",
"Security": ".security",
"SecurityTypedDict": ".security",
"StreamChatCompletionResponseBody": ".streamchatcompletionop",
"StreamChatCompletionResponseBodyTypedDict": ".streamchatcompletionop",
"URLCitation": ".urlcitationannotationdetail",
"URLCitationAnnotationDetail": ".urlcitationannotationdetail",
"URLCitationAnnotationDetailType": ".urlcitationannotationdetail",
@@ -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"""
@@ -27,29 +27,29 @@ from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ChatCompletionCreateParamsEffort = Literal["high", "medium", "low", "minimal"]
Effort = Literal["high", "medium", "low", "minimal"]
r"""OpenAI-style reasoning effort setting"""
class ChatCompletionCreateParamsReasoningTypedDict(TypedDict):
class ReasoningTypedDict(TypedDict):
r"""Reasoning configuration"""
enabled: NotRequired[bool]
r"""Enables reasoning with default settings. Only work for some models."""
effort: NotRequired[Nullable[ChatCompletionCreateParamsEffort]]
effort: NotRequired[Nullable[Effort]]
r"""OpenAI-style reasoning effort setting"""
max_tokens: NotRequired[Nullable[float]]
r"""non-OpenAI-style reasoning effort setting"""
exclude: NotRequired[bool]
class ChatCompletionCreateParamsReasoning(BaseModel):
class Reasoning(BaseModel):
r"""Reasoning configuration"""
enabled: Optional[bool] = None
r"""Enables reasoning with default settings. Only work for some models."""
effort: OptionalNullable[ChatCompletionCreateParamsEffort] = UNSET
effort: OptionalNullable[Effort] = UNSET
r"""OpenAI-style reasoning effort setting"""
max_tokens: OptionalNullable[float] = UNSET
@@ -88,45 +88,45 @@ class ChatCompletionCreateParamsReasoning(BaseModel):
return m
ChatCompletionCreateParamsTypePython = Literal["python"]
TypePython = Literal["python"]
class ChatCompletionCreateParamsResponseFormatPythonTypedDict(TypedDict):
class ResponseFormatPythonTypedDict(TypedDict):
r"""Python code response format"""
type: ChatCompletionCreateParamsTypePython
type: TypePython
class ChatCompletionCreateParamsResponseFormatPython(BaseModel):
class ResponseFormatPython(BaseModel):
r"""Python code response format"""
type: ChatCompletionCreateParamsTypePython
type: TypePython
ChatCompletionCreateParamsTypeGrammar = Literal["grammar"]
TypeGrammar = Literal["grammar"]
class ChatCompletionCreateParamsResponseFormatGrammarTypedDict(TypedDict):
class ResponseFormatGrammarTypedDict(TypedDict):
r"""Custom grammar response format"""
type: ChatCompletionCreateParamsTypeGrammar
type: TypeGrammar
grammar: str
r"""Custom grammar for text generation"""
class ChatCompletionCreateParamsResponseFormatGrammar(BaseModel):
class ResponseFormatGrammar(BaseModel):
r"""Custom grammar response format"""
type: ChatCompletionCreateParamsTypeGrammar
type: TypeGrammar
grammar: str
r"""Custom grammar for text generation"""
ChatCompletionCreateParamsTypeJSONSchema = Literal["json_schema"]
TypeJSONSchema = Literal["json_schema"]
class ChatCompletionCreateParamsJSONSchemaTypedDict(TypedDict):
class JSONSchemaTypedDict(TypedDict):
name: str
r"""Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"""
description: NotRequired[str]
@@ -137,7 +137,7 @@ class ChatCompletionCreateParamsJSONSchemaTypedDict(TypedDict):
r"""Enable strict schema adherence"""
class ChatCompletionCreateParamsJSONSchema(BaseModel):
class JSONSchema(BaseModel):
name: str
r"""Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"""
@@ -183,114 +183,110 @@ class ChatCompletionCreateParamsJSONSchema(BaseModel):
return m
class ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict(TypedDict):
class ResponseFormatJSONSchemaTypedDict(TypedDict):
r"""JSON Schema response format for structured outputs"""
type: ChatCompletionCreateParamsTypeJSONSchema
json_schema: ChatCompletionCreateParamsJSONSchemaTypedDict
type: TypeJSONSchema
json_schema: JSONSchemaTypedDict
class ChatCompletionCreateParamsResponseFormatJSONSchema(BaseModel):
class ResponseFormatJSONSchema(BaseModel):
r"""JSON Schema response format for structured outputs"""
type: ChatCompletionCreateParamsTypeJSONSchema
type: TypeJSONSchema
json_schema: ChatCompletionCreateParamsJSONSchema
json_schema: JSONSchema
ChatCompletionCreateParamsTypeJSONObject = Literal["json_object"]
TypeJSONObject = Literal["json_object"]
class ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict(TypedDict):
class ResponseFormatJSONObjectTypedDict(TypedDict):
r"""JSON object response format"""
type: ChatCompletionCreateParamsTypeJSONObject
type: TypeJSONObject
class ChatCompletionCreateParamsResponseFormatJSONObject(BaseModel):
class ResponseFormatJSONObject(BaseModel):
r"""JSON object response format"""
type: ChatCompletionCreateParamsTypeJSONObject
type: TypeJSONObject
ChatCompletionCreateParamsTypeText = Literal["text"]
class ChatCompletionCreateParamsResponseFormatTextTypedDict(TypedDict):
class ResponseFormatTextTypedDict(TypedDict):
r"""Default text response format"""
type: ChatCompletionCreateParamsTypeText
class ChatCompletionCreateParamsResponseFormatText(BaseModel):
class ResponseFormatText(BaseModel):
r"""Default text response format"""
type: ChatCompletionCreateParamsTypeText
ChatCompletionCreateParamsResponseFormatUnionTypedDict = TypeAliasType(
"ChatCompletionCreateParamsResponseFormatUnionTypedDict",
ResponseFormatTypedDict = TypeAliasType(
"ResponseFormatTypedDict",
Union[
ChatCompletionCreateParamsResponseFormatTextTypedDict,
ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict,
ChatCompletionCreateParamsResponseFormatPythonTypedDict,
ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
ChatCompletionCreateParamsResponseFormatGrammarTypedDict,
ResponseFormatTextTypedDict,
ResponseFormatJSONObjectTypedDict,
ResponseFormatPythonTypedDict,
ResponseFormatJSONSchemaTypedDict,
ResponseFormatGrammarTypedDict,
],
)
r"""Response format configuration"""
ChatCompletionCreateParamsResponseFormatUnion = TypeAliasType(
"ChatCompletionCreateParamsResponseFormatUnion",
ResponseFormat = TypeAliasType(
"ResponseFormat",
Union[
ChatCompletionCreateParamsResponseFormatText,
ChatCompletionCreateParamsResponseFormatJSONObject,
ChatCompletionCreateParamsResponseFormatPython,
ChatCompletionCreateParamsResponseFormatJSONSchema,
ChatCompletionCreateParamsResponseFormatGrammar,
ResponseFormatText,
ResponseFormatJSONObject,
ResponseFormatPython,
ResponseFormatJSONSchema,
ResponseFormatGrammar,
],
)
r"""Response format configuration"""
ChatCompletionCreateParamsStopTypedDict = TypeAliasType(
"ChatCompletionCreateParamsStopTypedDict", Union[str, List[str], Any]
)
StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str], Any])
r"""Stop sequences (up to 4)"""
ChatCompletionCreateParamsStop = TypeAliasType(
"ChatCompletionCreateParamsStop", Union[str, List[str], Any]
)
Stop = TypeAliasType("Stop", Union[str, List[str], Any])
r"""Stop sequences (up to 4)"""
class ChatCompletionCreateParamsStreamOptionsTypedDict(TypedDict):
class StreamOptionsTypedDict(TypedDict):
r"""Streaming configuration options"""
include_usage: NotRequired[bool]
r"""Include usage information in streaming response"""
class ChatCompletionCreateParamsStreamOptions(BaseModel):
class StreamOptions(BaseModel):
r"""Streaming configuration options"""
include_usage: Optional[bool] = None
r"""Include usage information in streaming response"""
ChatCompletionCreateParamsReasoningEffort = Literal["high", "medium", "low", "minimal"]
ReasoningEffort = Literal["high", "medium", "low", "minimal"]
r"""Reasoning effort"""
ChatCompletionCreateParamsDataCollection = Literal["deny", "allow"]
DataCollection = Literal["deny", "allow"]
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
ChatCompletionCreateParamsOrderEnum = Literal[
OrderEnum = Literal[
"AnyScale",
"Cent-ML",
"HuggingFace",
@@ -371,19 +367,13 @@ ChatCompletionCreateParamsOrderEnum = Literal[
"Z.AI",
]
ChatCompletionCreateParamsOrderUnionTypedDict = TypeAliasType(
"ChatCompletionCreateParamsOrderUnionTypedDict",
Union[ChatCompletionCreateParamsOrderEnum, str],
)
OrderTypedDict = TypeAliasType("OrderTypedDict", Union[OrderEnum, str])
ChatCompletionCreateParamsOrderUnion = TypeAliasType(
"ChatCompletionCreateParamsOrderUnion",
Union[ChatCompletionCreateParamsOrderEnum, str],
)
Order = TypeAliasType("Order", Union[OrderEnum, str])
ChatCompletionCreateParamsOnlyEnum = Literal[
OnlyEnum = Literal[
"AnyScale",
"Cent-ML",
"HuggingFace",
@@ -464,19 +454,13 @@ ChatCompletionCreateParamsOnlyEnum = Literal[
"Z.AI",
]
ChatCompletionCreateParamsOnlyUnionTypedDict = TypeAliasType(
"ChatCompletionCreateParamsOnlyUnionTypedDict",
Union[ChatCompletionCreateParamsOnlyEnum, str],
)
OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[OnlyEnum, str])
ChatCompletionCreateParamsOnlyUnion = TypeAliasType(
"ChatCompletionCreateParamsOnlyUnion",
Union[ChatCompletionCreateParamsOnlyEnum, str],
)
Only = TypeAliasType("Only", Union[OnlyEnum, str])
ChatCompletionCreateParamsIgnoreEnum = Literal[
IgnoreEnum = Literal[
"AnyScale",
"Cent-ML",
"HuggingFace",
@@ -557,100 +541,74 @@ ChatCompletionCreateParamsIgnoreEnum = Literal[
"Z.AI",
]
ChatCompletionCreateParamsIgnoreUnionTypedDict = TypeAliasType(
"ChatCompletionCreateParamsIgnoreUnionTypedDict",
Union[ChatCompletionCreateParamsIgnoreEnum, str],
)
IgnoreTypedDict = TypeAliasType("IgnoreTypedDict", Union[IgnoreEnum, str])
ChatCompletionCreateParamsIgnoreUnion = TypeAliasType(
"ChatCompletionCreateParamsIgnoreUnion",
Union[ChatCompletionCreateParamsIgnoreEnum, str],
)
Ignore = TypeAliasType("Ignore", Union[IgnoreEnum, str])
ChatCompletionCreateParamsQuantization = Literal[
Quantization = Literal[
"int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown"
]
ChatCompletionCreateParamsSort = Literal["price", "throughput", "latency"]
Sort = Literal["price", "throughput", "latency"]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
ChatCompletionCreateParamsPromptTypedDict = TypeAliasType(
"ChatCompletionCreateParamsPromptTypedDict", Union[float, str, Any]
)
PromptTypedDict = TypeAliasType("PromptTypedDict", Union[float, str, Any])
ChatCompletionCreateParamsPrompt = TypeAliasType(
"ChatCompletionCreateParamsPrompt", Union[float, str, Any]
)
Prompt = TypeAliasType("Prompt", Union[float, str, Any])
ChatCompletionCreateParamsCompletionTypedDict = TypeAliasType(
"ChatCompletionCreateParamsCompletionTypedDict", Union[float, str, Any]
)
CompletionTypedDict = TypeAliasType("CompletionTypedDict", Union[float, str, Any])
ChatCompletionCreateParamsCompletion = TypeAliasType(
"ChatCompletionCreateParamsCompletion", Union[float, str, Any]
)
Completion = TypeAliasType("Completion", Union[float, str, Any])
ChatCompletionCreateParamsImageTypedDict = TypeAliasType(
"ChatCompletionCreateParamsImageTypedDict", Union[float, str, Any]
)
ImageTypedDict = TypeAliasType("ImageTypedDict", Union[float, str, Any])
ChatCompletionCreateParamsImage = TypeAliasType(
"ChatCompletionCreateParamsImage", Union[float, str, Any]
)
Image = TypeAliasType("Image", Union[float, str, Any])
ChatCompletionCreateParamsAudioTypedDict = TypeAliasType(
"ChatCompletionCreateParamsAudioTypedDict", Union[float, str, Any]
)
AudioTypedDict = TypeAliasType("AudioTypedDict", Union[float, str, Any])
ChatCompletionCreateParamsAudio = TypeAliasType(
"ChatCompletionCreateParamsAudio", Union[float, str, Any]
)
Audio = TypeAliasType("Audio", Union[float, str, Any])
ChatCompletionCreateParamsRequestTypedDict = TypeAliasType(
"ChatCompletionCreateParamsRequestTypedDict", Union[float, str, Any]
)
RequestTypedDict = TypeAliasType("RequestTypedDict", Union[float, str, Any])
ChatCompletionCreateParamsRequest = TypeAliasType(
"ChatCompletionCreateParamsRequest", Union[float, str, Any]
)
Request = TypeAliasType("Request", Union[float, str, Any])
class ChatCompletionCreateParamsMaxPriceTypedDict(TypedDict):
class MaxPriceTypedDict(TypedDict):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: NotRequired[ChatCompletionCreateParamsPromptTypedDict]
completion: NotRequired[ChatCompletionCreateParamsCompletionTypedDict]
image: NotRequired[ChatCompletionCreateParamsImageTypedDict]
audio: NotRequired[ChatCompletionCreateParamsAudioTypedDict]
request: NotRequired[ChatCompletionCreateParamsRequestTypedDict]
prompt: NotRequired[PromptTypedDict]
completion: NotRequired[CompletionTypedDict]
image: NotRequired[ImageTypedDict]
audio: NotRequired[AudioTypedDict]
request: NotRequired[RequestTypedDict]
class ChatCompletionCreateParamsMaxPrice(BaseModel):
class MaxPrice(BaseModel):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: Optional[ChatCompletionCreateParamsPrompt] = None
prompt: Optional[Prompt] = None
completion: Optional[ChatCompletionCreateParamsCompletion] = None
completion: Optional[Completion] = None
image: Optional[ChatCompletionCreateParamsImage] = None
image: Optional[Image] = None
audio: Optional[ChatCompletionCreateParamsAudio] = None
audio: Optional[Audio] = None
request: Optional[ChatCompletionCreateParamsRequest] = None
request: Optional[Request] = None
class ChatCompletionCreateParamsProviderTypedDict(TypedDict):
class ProviderTypedDict(TypedDict):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: NotRequired[Nullable[bool]]
@@ -661,27 +619,27 @@ class ChatCompletionCreateParamsProviderTypedDict(TypedDict):
"""
require_parameters: NotRequired[Nullable[bool]]
r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."""
data_collection: NotRequired[Nullable[ChatCompletionCreateParamsDataCollection]]
data_collection: NotRequired[Nullable[DataCollection]]
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
order: NotRequired[Nullable[List[ChatCompletionCreateParamsOrderUnionTypedDict]]]
order: NotRequired[Nullable[List[OrderTypedDict]]]
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
only: NotRequired[Nullable[List[ChatCompletionCreateParamsOnlyUnionTypedDict]]]
only: NotRequired[Nullable[List[OnlyTypedDict]]]
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
ignore: NotRequired[Nullable[List[ChatCompletionCreateParamsIgnoreUnionTypedDict]]]
ignore: NotRequired[Nullable[List[IgnoreTypedDict]]]
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
quantizations: NotRequired[Nullable[List[ChatCompletionCreateParamsQuantization]]]
quantizations: NotRequired[Nullable[List[Quantization]]]
r"""A list of quantization levels to filter the provider by."""
sort: NotRequired[Nullable[ChatCompletionCreateParamsSort]]
sort: NotRequired[Nullable[Sort]]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
max_price: NotRequired[ChatCompletionCreateParamsMaxPriceTypedDict]
max_price: NotRequired[MaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
class ChatCompletionCreateParamsProvider(BaseModel):
class Provider(BaseModel):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: OptionalNullable[bool] = UNSET
@@ -694,31 +652,29 @@ class ChatCompletionCreateParamsProvider(BaseModel):
require_parameters: OptionalNullable[bool] = UNSET
r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."""
data_collection: OptionalNullable[ChatCompletionCreateParamsDataCollection] = UNSET
data_collection: OptionalNullable[DataCollection] = UNSET
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
order: OptionalNullable[List[ChatCompletionCreateParamsOrderUnion]] = UNSET
order: OptionalNullable[List[Order]] = UNSET
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
only: OptionalNullable[List[ChatCompletionCreateParamsOnlyUnion]] = UNSET
only: OptionalNullable[List[Only]] = UNSET
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
ignore: OptionalNullable[List[ChatCompletionCreateParamsIgnoreUnion]] = UNSET
ignore: OptionalNullable[List[Ignore]] = UNSET
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
quantizations: OptionalNullable[List[ChatCompletionCreateParamsQuantization]] = (
UNSET
)
quantizations: OptionalNullable[List[Quantization]] = UNSET
r"""A list of quantization levels to filter the provider by."""
sort: OptionalNullable[ChatCompletionCreateParamsSort] = UNSET
sort: OptionalNullable[Sort] = UNSET
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
max_price: Optional[ChatCompletionCreateParamsMaxPrice] = None
max_price: Optional[MaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
@model_serializer(mode="wrap")
@@ -771,96 +727,90 @@ class ChatCompletionCreateParamsProvider(BaseModel):
return m
ChatCompletionCreateParamsIDFileParser = Literal["file-parser"]
IDFileParser = Literal["file-parser"]
ChatCompletionCreateParamsPdfEngine = Literal["mistral-ocr", "pdf-text", "native"]
PdfEngine = Literal["mistral-ocr", "pdf-text", "native"]
class ChatCompletionCreateParamsPdfTypedDict(TypedDict):
engine: NotRequired[ChatCompletionCreateParamsPdfEngine]
class PdfTypedDict(TypedDict):
engine: NotRequired[PdfEngine]
class ChatCompletionCreateParamsPdf(BaseModel):
engine: Optional[ChatCompletionCreateParamsPdfEngine] = None
class Pdf(BaseModel):
engine: Optional[PdfEngine] = None
class ChatCompletionCreateParamsPluginFileParserTypedDict(TypedDict):
id: ChatCompletionCreateParamsIDFileParser
class PluginFileParserTypedDict(TypedDict):
id: IDFileParser
max_files: NotRequired[float]
pdf: NotRequired[ChatCompletionCreateParamsPdfTypedDict]
pdf: NotRequired[PdfTypedDict]
class ChatCompletionCreateParamsPluginFileParser(BaseModel):
id: ChatCompletionCreateParamsIDFileParser
class PluginFileParser(BaseModel):
id: IDFileParser
max_files: Optional[float] = None
pdf: Optional[ChatCompletionCreateParamsPdf] = None
pdf: Optional[Pdf] = None
ChatCompletionCreateParamsIDChainOfThought = Literal["chain-of-thought"]
IDChainOfThought = Literal["chain-of-thought"]
class ChatCompletionCreateParamsPluginChainOfThoughtTypedDict(TypedDict):
id: ChatCompletionCreateParamsIDChainOfThought
class PluginChainOfThoughtTypedDict(TypedDict):
id: IDChainOfThought
class ChatCompletionCreateParamsPluginChainOfThought(BaseModel):
id: ChatCompletionCreateParamsIDChainOfThought
class PluginChainOfThought(BaseModel):
id: IDChainOfThought
ChatCompletionCreateParamsIDWeb = Literal["web"]
IDWeb = Literal["web"]
ChatCompletionCreateParamsEngine = Literal["native", "exa"]
Engine = Literal["native", "exa"]
class ChatCompletionCreateParamsPluginWebTypedDict(TypedDict):
id: ChatCompletionCreateParamsIDWeb
class PluginWebTypedDict(TypedDict):
id: IDWeb
max_results: NotRequired[float]
search_prompt: NotRequired[str]
engine: NotRequired[ChatCompletionCreateParamsEngine]
engine: NotRequired[Engine]
class ChatCompletionCreateParamsPluginWeb(BaseModel):
id: ChatCompletionCreateParamsIDWeb
class PluginWeb(BaseModel):
id: IDWeb
max_results: Optional[float] = None
search_prompt: Optional[str] = None
engine: Optional[ChatCompletionCreateParamsEngine] = None
engine: Optional[Engine] = None
ChatCompletionCreateParamsIDModeration = Literal["moderation"]
IDModeration = Literal["moderation"]
class ChatCompletionCreateParamsPluginModerationTypedDict(TypedDict):
id: ChatCompletionCreateParamsIDModeration
class PluginModerationTypedDict(TypedDict):
id: IDModeration
class ChatCompletionCreateParamsPluginModeration(BaseModel):
id: ChatCompletionCreateParamsIDModeration
class PluginModeration(BaseModel):
id: IDModeration
ChatCompletionCreateParamsPluginUnionTypedDict = TypeAliasType(
"ChatCompletionCreateParamsPluginUnionTypedDict",
PluginTypedDict = TypeAliasType(
"PluginTypedDict",
Union[
ChatCompletionCreateParamsPluginModerationTypedDict,
ChatCompletionCreateParamsPluginChainOfThoughtTypedDict,
ChatCompletionCreateParamsPluginFileParserTypedDict,
ChatCompletionCreateParamsPluginWebTypedDict,
PluginModerationTypedDict,
PluginChainOfThoughtTypedDict,
PluginFileParserTypedDict,
PluginWebTypedDict,
],
)
ChatCompletionCreateParamsPluginUnion = TypeAliasType(
"ChatCompletionCreateParamsPluginUnion",
Union[
ChatCompletionCreateParamsPluginModeration,
ChatCompletionCreateParamsPluginChainOfThought,
ChatCompletionCreateParamsPluginFileParser,
ChatCompletionCreateParamsPluginWeb,
],
Plugin = TypeAliasType(
"Plugin", Union[PluginModeration, PluginChainOfThought, PluginFileParser, PluginWeb]
)
@@ -887,19 +837,17 @@ class ChatCompletionCreateParamsTypedDict(TypedDict):
r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)"""
presence_penalty: NotRequired[Nullable[float]]
r"""Presence penalty (-2.0 to 2.0)"""
reasoning: NotRequired[Nullable[ChatCompletionCreateParamsReasoningTypedDict]]
reasoning: NotRequired[Nullable[ReasoningTypedDict]]
r"""Reasoning configuration"""
response_format: NotRequired[ChatCompletionCreateParamsResponseFormatUnionTypedDict]
response_format: NotRequired[ResponseFormatTypedDict]
r"""Response format configuration"""
seed: NotRequired[Nullable[int]]
r"""Random seed for deterministic outputs"""
stop: NotRequired[Nullable[ChatCompletionCreateParamsStopTypedDict]]
stop: NotRequired[Nullable[StopTypedDict]]
r"""Stop sequences (up to 4)"""
stream: NotRequired[Nullable[bool]]
r"""Enable streaming response"""
stream_options: NotRequired[
Nullable[ChatCompletionCreateParamsStreamOptionsTypedDict]
]
stream_options: NotRequired[Nullable[StreamOptionsTypedDict]]
temperature: NotRequired[Nullable[float]]
r"""Sampling temperature (0-2)"""
tool_choice: NotRequired[ChatCompletionToolChoiceOptionTypedDict]
@@ -912,11 +860,11 @@ class ChatCompletionCreateParamsTypedDict(TypedDict):
r"""Unique user identifier"""
fallback_models: NotRequired[Nullable[List[str]]]
r"""Order of models to fallback to for this request"""
reasoning_effort: NotRequired[Nullable[ChatCompletionCreateParamsReasoningEffort]]
reasoning_effort: NotRequired[Nullable[ReasoningEffort]]
r"""Reasoning effort"""
provider: NotRequired[Nullable[ChatCompletionCreateParamsProviderTypedDict]]
provider: NotRequired[Nullable[ProviderTypedDict]]
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: NotRequired[List[ChatCompletionCreateParamsPluginUnionTypedDict]]
plugins: NotRequired[List[PluginTypedDict]]
r"""Plugins you want to enable for this request, including their settings."""
@@ -953,22 +901,22 @@ class ChatCompletionCreateParams(BaseModel):
presence_penalty: OptionalNullable[float] = UNSET
r"""Presence penalty (-2.0 to 2.0)"""
reasoning: OptionalNullable[ChatCompletionCreateParamsReasoning] = UNSET
reasoning: OptionalNullable[Reasoning] = UNSET
r"""Reasoning configuration"""
response_format: Optional[ChatCompletionCreateParamsResponseFormatUnion] = None
response_format: Optional[ResponseFormat] = None
r"""Response format configuration"""
seed: OptionalNullable[int] = UNSET
r"""Random seed for deterministic outputs"""
stop: OptionalNullable[ChatCompletionCreateParamsStop] = UNSET
stop: OptionalNullable[Stop] = UNSET
r"""Stop sequences (up to 4)"""
stream: OptionalNullable[bool] = False
r"""Enable streaming response"""
stream_options: OptionalNullable[ChatCompletionCreateParamsStreamOptions] = UNSET
stream_options: OptionalNullable[StreamOptions] = UNSET
temperature: OptionalNullable[float] = 1
r"""Sampling temperature (0-2)"""
@@ -990,15 +938,13 @@ class ChatCompletionCreateParams(BaseModel):
] = UNSET
r"""Order of models to fallback to for this request"""
reasoning_effort: OptionalNullable[ChatCompletionCreateParamsReasoningEffort] = (
UNSET
)
reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET
r"""Reasoning effort"""
provider: OptionalNullable[ChatCompletionCreateParamsProvider] = UNSET
provider: OptionalNullable[Provider] = UNSET
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: Optional[List[ChatCompletionCreateParamsPluginUnion]] = None
plugins: Optional[List[Plugin]] = None
r"""Plugins you want to enable for this request, including their settings."""
@model_serializer(mode="wrap")
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
View File
@@ -24,7 +24,6 @@ class OpenRouter(BaseSDK):
"""
chat: "Chat"
r"""Chat completion operations"""
_sub_sdk_map = {
"chat": ("openrouter.chat", "Chat"),
}