mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-29 11:23:49 +08:00
Commits included in this export:
- 6ddaaa6989d725bbe966e45f7aed0c1bd72f9153 - 4779741b6ba710b1299612b82e8544516bd9dd6a - 22083fcc8f58884d8212d6f3314b231c4ddd21cd - a925a620f97196d509e073a163caac053bd82316 - 5c05d8829784601ffd151acef1a6978c266f913d - 6f4fff535fbf4274255c255ae23620b8e00e614f - ef358e96cb01e469b77d44683603a602b0813116 - e6299b4ebfe5c2eed6c598771f0fd99f84555401 - 24d3f0ee1c2aa19a62f7902836034080b9246813 - 68922847c2969b773887310eb7aa9a814e199c5a - 729ee2338c39df22461526153e7f4ba868fd498e - e1074ff86fccf5e48406b7595298873106d3cc5a - 123bbdaf841d299162a82ee2573adfbb70a45b8f - ac457b8a8dad98fdf5ddcae8dd4711361cea3084 - ea825199f4c59dd68fec01cf8d18a582963c9f25 - 4d48e4f6bb936e785787314a965298da6b78fea0 - 718729a573ee98893a4408d5a52ab4686661fe54 - b867adcde6b64f3f2a11c4626254b39098e4b0b4 - 21912c097b4066d109766c6b4492826595cd57c5 - bc1ed85adc976a4634ca8a41b82e4fc2c39a864f - d145c89c941937a312ed1357590d2bfda9a3603d - 12f05b5dee397ead47cfcd545a7a2e3c7ff57524 - dd28f75a19a015809797c7abf3f8758f7c37262e - c96e569781e07ab44172d9c69940ec17bafd81f4 - c9d5a90e3c2b5077a2bdd49773f1a46d1a5a79c7 - 58b08f87116ceab9076de2fdc0a4c74c919b44c4 GitOrigin-RevId: 6ddaaa6989d725bbe966e45f7aed0c1bd72f9153
This commit is contained in:
@@ -6,18 +6,45 @@ import builtins
|
||||
import sys
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict
|
||||
from ._schema2 import (
|
||||
Schema2,
|
||||
Schema2ReasoningEncrypted,
|
||||
Schema2ReasoningEncryptedTypedDict,
|
||||
Schema2ReasoningSummary,
|
||||
Schema2ReasoningSummaryTypedDict,
|
||||
Schema2ReasoningText,
|
||||
Schema2ReasoningTextTypedDict,
|
||||
Schema2TypedDict,
|
||||
Schema4,
|
||||
from ._schema10 import (
|
||||
Completion,
|
||||
CompletionTypedDict,
|
||||
Prompt,
|
||||
PromptTypedDict,
|
||||
Schema10,
|
||||
Schema10TypedDict,
|
||||
)
|
||||
from ._schema14 import Schema14, Schema14TypedDict
|
||||
from ._schema17 import (
|
||||
Engine,
|
||||
Pdf,
|
||||
PdfEngine,
|
||||
PdfTypedDict,
|
||||
Schema17,
|
||||
Schema17AutoRouter,
|
||||
Schema17AutoRouterTypedDict,
|
||||
Schema17FileParser,
|
||||
Schema17FileParserTypedDict,
|
||||
Schema17Moderation,
|
||||
Schema17ModerationTypedDict,
|
||||
Schema17ResponseHealing,
|
||||
Schema17ResponseHealingTypedDict,
|
||||
Schema17TypedDict,
|
||||
Schema17Web,
|
||||
Schema17WebTypedDict,
|
||||
)
|
||||
from ._schema19 import (
|
||||
Schema19,
|
||||
Schema19ReasoningEncrypted,
|
||||
Schema19ReasoningEncryptedTypedDict,
|
||||
Schema19ReasoningSummary,
|
||||
Schema19ReasoningSummaryTypedDict,
|
||||
Schema19ReasoningText,
|
||||
Schema19ReasoningTextTypedDict,
|
||||
Schema19TypedDict,
|
||||
Schema21,
|
||||
)
|
||||
from ._schema5 import Schema5, Schema5Enum, Schema5TypedDict
|
||||
from .activityitem import ActivityItem, ActivityItemTypedDict
|
||||
from .assistantmessage import (
|
||||
AssistantMessage,
|
||||
@@ -41,56 +68,34 @@ if TYPE_CHECKING:
|
||||
from .chaterror import ChatErrorError, ChatErrorErrorTypedDict, Code, CodeTypedDict
|
||||
from .chatgenerationparams import (
|
||||
ChatGenerationParams,
|
||||
ChatGenerationParamsDataCollection,
|
||||
ChatGenerationParamsImageConfig,
|
||||
ChatGenerationParamsImageConfigTypedDict,
|
||||
ChatGenerationParamsMaxPrice,
|
||||
ChatGenerationParamsMaxPriceTypedDict,
|
||||
ChatGenerationParamsPluginAutoRouter,
|
||||
ChatGenerationParamsPluginAutoRouterTypedDict,
|
||||
ChatGenerationParamsPluginFileParser,
|
||||
ChatGenerationParamsPluginFileParserTypedDict,
|
||||
ChatGenerationParamsPluginModeration,
|
||||
ChatGenerationParamsPluginModerationTypedDict,
|
||||
ChatGenerationParamsPluginResponseHealing,
|
||||
ChatGenerationParamsPluginResponseHealingTypedDict,
|
||||
ChatGenerationParamsPluginUnion,
|
||||
ChatGenerationParamsPluginUnionTypedDict,
|
||||
ChatGenerationParamsPluginWeb,
|
||||
ChatGenerationParamsPluginWebTypedDict,
|
||||
ChatGenerationParamsPreferredMaxLatency,
|
||||
ChatGenerationParamsPreferredMaxLatencyTypedDict,
|
||||
ChatGenerationParamsPreferredMaxLatencyUnion,
|
||||
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict,
|
||||
ChatGenerationParamsPreferredMinThroughput,
|
||||
ChatGenerationParamsPreferredMinThroughputTypedDict,
|
||||
ChatGenerationParamsPreferredMinThroughputUnion,
|
||||
ChatGenerationParamsPreferredMinThroughputUnionTypedDict,
|
||||
ChatGenerationParamsProvider,
|
||||
ChatGenerationParamsProviderTypedDict,
|
||||
ChatGenerationParamsResponseFormatJSONObject,
|
||||
ChatGenerationParamsResponseFormatJSONObjectTypedDict,
|
||||
ChatGenerationParamsResponseFormatPython,
|
||||
ChatGenerationParamsResponseFormatPythonTypedDict,
|
||||
ChatGenerationParamsResponseFormatText,
|
||||
ChatGenerationParamsResponseFormatTextTypedDict,
|
||||
ChatGenerationParamsResponseFormatUnion,
|
||||
ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
ChatGenerationParamsStop,
|
||||
ChatGenerationParamsStopTypedDict,
|
||||
ChatGenerationParamsTypedDict,
|
||||
Debug,
|
||||
DebugTypedDict,
|
||||
Effort,
|
||||
Engine,
|
||||
Modality,
|
||||
Pdf,
|
||||
PdfEngine,
|
||||
PdfTypedDict,
|
||||
Quantizations,
|
||||
Reasoning,
|
||||
ReasoningTypedDict,
|
||||
ResponseFormat,
|
||||
ResponseFormatJSONObject,
|
||||
ResponseFormatJSONObjectTypedDict,
|
||||
ResponseFormatPython,
|
||||
ResponseFormatPythonTypedDict,
|
||||
ResponseFormatText,
|
||||
ResponseFormatTextTypedDict,
|
||||
ResponseFormatTypedDict,
|
||||
Route,
|
||||
Schema0,
|
||||
Schema0TypedDict,
|
||||
Schema15,
|
||||
Schema15TypedDict,
|
||||
Schema15Union,
|
||||
Schema15UnionTypedDict,
|
||||
Schema3,
|
||||
Schema8,
|
||||
Stop,
|
||||
StopTypedDict,
|
||||
)
|
||||
from .chatgenerationtokenusage import (
|
||||
ChatGenerationTokenUsage,
|
||||
@@ -177,32 +182,6 @@ if TYPE_CHECKING:
|
||||
ChatStreamingResponseChunkTypedDict,
|
||||
)
|
||||
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
|
||||
from .completionchoice import (
|
||||
CompletionChoice,
|
||||
CompletionChoiceTypedDict,
|
||||
CompletionFinishReason,
|
||||
)
|
||||
from .completioncreateparams import (
|
||||
CompletionCreateParams,
|
||||
CompletionCreateParamsResponseFormatJSONObject,
|
||||
CompletionCreateParamsResponseFormatJSONObjectTypedDict,
|
||||
CompletionCreateParamsResponseFormatPython,
|
||||
CompletionCreateParamsResponseFormatPythonTypedDict,
|
||||
CompletionCreateParamsResponseFormatText,
|
||||
CompletionCreateParamsResponseFormatTextTypedDict,
|
||||
CompletionCreateParamsResponseFormatUnion,
|
||||
CompletionCreateParamsResponseFormatUnionTypedDict,
|
||||
CompletionCreateParamsStop,
|
||||
CompletionCreateParamsStopTypedDict,
|
||||
CompletionCreateParamsTypedDict,
|
||||
Prompt,
|
||||
PromptTypedDict,
|
||||
StreamOptions,
|
||||
StreamOptionsTypedDict,
|
||||
)
|
||||
from .completionlogprobs import CompletionLogprobs, CompletionLogprobsTypedDict
|
||||
from .completionresponse import CompletionResponse, CompletionResponseTypedDict
|
||||
from .completionusage import CompletionUsage, CompletionUsageTypedDict
|
||||
from .createchargerequest import (
|
||||
ChainID,
|
||||
CreateChargeRequest,
|
||||
@@ -210,6 +189,12 @@ if TYPE_CHECKING:
|
||||
)
|
||||
from .datacollection import DataCollection
|
||||
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
|
||||
from .developermessage import (
|
||||
DeveloperMessage,
|
||||
DeveloperMessageContent,
|
||||
DeveloperMessageContentTypedDict,
|
||||
DeveloperMessageTypedDict,
|
||||
)
|
||||
from .edgenetworktimeoutresponseerrordata import (
|
||||
EdgeNetworkTimeoutResponseErrorData,
|
||||
EdgeNetworkTimeoutResponseErrorDataTypedDict,
|
||||
@@ -236,14 +221,7 @@ if TYPE_CHECKING:
|
||||
ListEndpointsResponseTypedDict,
|
||||
Tokenizer,
|
||||
)
|
||||
from .message import (
|
||||
Message,
|
||||
MessageContent,
|
||||
MessageContentTypedDict,
|
||||
MessageDeveloper,
|
||||
MessageDeveloperTypedDict,
|
||||
MessageTypedDict,
|
||||
)
|
||||
from .message import Message, MessageTypedDict
|
||||
from .model import Model, ModelTypedDict
|
||||
from .modelarchitecture import (
|
||||
ModelArchitecture,
|
||||
@@ -495,20 +473,6 @@ if TYPE_CHECKING:
|
||||
OpenResponsesRequestOnlyTypedDict,
|
||||
OpenResponsesRequestOrder,
|
||||
OpenResponsesRequestOrderTypedDict,
|
||||
OpenResponsesRequestPluginAutoRouter,
|
||||
OpenResponsesRequestPluginAutoRouterTypedDict,
|
||||
OpenResponsesRequestPluginFileParser,
|
||||
OpenResponsesRequestPluginFileParserTypedDict,
|
||||
OpenResponsesRequestPluginModeration,
|
||||
OpenResponsesRequestPluginModerationTypedDict,
|
||||
OpenResponsesRequestPluginResponseHealing,
|
||||
OpenResponsesRequestPluginResponseHealingTypedDict,
|
||||
OpenResponsesRequestPluginUnion,
|
||||
OpenResponsesRequestPluginUnionTypedDict,
|
||||
OpenResponsesRequestPluginWeb,
|
||||
OpenResponsesRequestPluginWebTypedDict,
|
||||
OpenResponsesRequestProvider,
|
||||
OpenResponsesRequestProviderTypedDict,
|
||||
OpenResponsesRequestSort,
|
||||
OpenResponsesRequestSortTypedDict,
|
||||
OpenResponsesRequestToolFunction,
|
||||
@@ -517,6 +481,20 @@ if TYPE_CHECKING:
|
||||
OpenResponsesRequestToolUnionTypedDict,
|
||||
OpenResponsesRequestType,
|
||||
OpenResponsesRequestTypedDict,
|
||||
Plugin,
|
||||
PluginAutoRouter,
|
||||
PluginAutoRouterTypedDict,
|
||||
PluginFileParser,
|
||||
PluginFileParserTypedDict,
|
||||
PluginModeration,
|
||||
PluginModerationTypedDict,
|
||||
PluginResponseHealing,
|
||||
PluginResponseHealingTypedDict,
|
||||
PluginTypedDict,
|
||||
PluginWeb,
|
||||
PluginWebTypedDict,
|
||||
Provider,
|
||||
ProviderTypedDict,
|
||||
ServiceTier,
|
||||
Truncation,
|
||||
)
|
||||
@@ -929,43 +907,8 @@ __all__ = [
|
||||
"ChatErrorError",
|
||||
"ChatErrorErrorTypedDict",
|
||||
"ChatGenerationParams",
|
||||
"ChatGenerationParamsDataCollection",
|
||||
"ChatGenerationParamsImageConfig",
|
||||
"ChatGenerationParamsImageConfigTypedDict",
|
||||
"ChatGenerationParamsMaxPrice",
|
||||
"ChatGenerationParamsMaxPriceTypedDict",
|
||||
"ChatGenerationParamsPluginAutoRouter",
|
||||
"ChatGenerationParamsPluginAutoRouterTypedDict",
|
||||
"ChatGenerationParamsPluginFileParser",
|
||||
"ChatGenerationParamsPluginFileParserTypedDict",
|
||||
"ChatGenerationParamsPluginModeration",
|
||||
"ChatGenerationParamsPluginModerationTypedDict",
|
||||
"ChatGenerationParamsPluginResponseHealing",
|
||||
"ChatGenerationParamsPluginResponseHealingTypedDict",
|
||||
"ChatGenerationParamsPluginUnion",
|
||||
"ChatGenerationParamsPluginUnionTypedDict",
|
||||
"ChatGenerationParamsPluginWeb",
|
||||
"ChatGenerationParamsPluginWebTypedDict",
|
||||
"ChatGenerationParamsPreferredMaxLatency",
|
||||
"ChatGenerationParamsPreferredMaxLatencyTypedDict",
|
||||
"ChatGenerationParamsPreferredMaxLatencyUnion",
|
||||
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
|
||||
"ChatGenerationParamsPreferredMinThroughput",
|
||||
"ChatGenerationParamsPreferredMinThroughputTypedDict",
|
||||
"ChatGenerationParamsPreferredMinThroughputUnion",
|
||||
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
|
||||
"ChatGenerationParamsProvider",
|
||||
"ChatGenerationParamsProviderTypedDict",
|
||||
"ChatGenerationParamsResponseFormatJSONObject",
|
||||
"ChatGenerationParamsResponseFormatJSONObjectTypedDict",
|
||||
"ChatGenerationParamsResponseFormatPython",
|
||||
"ChatGenerationParamsResponseFormatPythonTypedDict",
|
||||
"ChatGenerationParamsResponseFormatText",
|
||||
"ChatGenerationParamsResponseFormatTextTypedDict",
|
||||
"ChatGenerationParamsResponseFormatUnion",
|
||||
"ChatGenerationParamsResponseFormatUnionTypedDict",
|
||||
"ChatGenerationParamsStop",
|
||||
"ChatGenerationParamsStopTypedDict",
|
||||
"ChatGenerationParamsTypedDict",
|
||||
"ChatGenerationTokenUsage",
|
||||
"ChatGenerationTokenUsageTypedDict",
|
||||
@@ -1024,29 +967,10 @@ __all__ = [
|
||||
"Code",
|
||||
"CodeEnum",
|
||||
"CodeTypedDict",
|
||||
"CompletionChoice",
|
||||
"CompletionChoiceTypedDict",
|
||||
"CompletionCreateParams",
|
||||
"CompletionCreateParamsResponseFormatJSONObject",
|
||||
"CompletionCreateParamsResponseFormatJSONObjectTypedDict",
|
||||
"CompletionCreateParamsResponseFormatPython",
|
||||
"CompletionCreateParamsResponseFormatPythonTypedDict",
|
||||
"CompletionCreateParamsResponseFormatText",
|
||||
"CompletionCreateParamsResponseFormatTextTypedDict",
|
||||
"CompletionCreateParamsResponseFormatUnion",
|
||||
"CompletionCreateParamsResponseFormatUnionTypedDict",
|
||||
"CompletionCreateParamsStop",
|
||||
"CompletionCreateParamsStopTypedDict",
|
||||
"CompletionCreateParamsTypedDict",
|
||||
"CompletionFinishReason",
|
||||
"CompletionLogprobs",
|
||||
"CompletionLogprobsTypedDict",
|
||||
"CompletionResponse",
|
||||
"CompletionResponseTypedDict",
|
||||
"Completion",
|
||||
"CompletionTokensDetails",
|
||||
"CompletionTokensDetailsTypedDict",
|
||||
"CompletionUsage",
|
||||
"CompletionUsageTypedDict",
|
||||
"CompletionTypedDict",
|
||||
"CostDetails",
|
||||
"CostDetailsTypedDict",
|
||||
"CreateChargeRequest",
|
||||
@@ -1056,6 +980,10 @@ __all__ = [
|
||||
"DebugTypedDict",
|
||||
"DefaultParameters",
|
||||
"DefaultParametersTypedDict",
|
||||
"DeveloperMessage",
|
||||
"DeveloperMessageContent",
|
||||
"DeveloperMessageContentTypedDict",
|
||||
"DeveloperMessageTypedDict",
|
||||
"EdgeNetworkTimeoutResponseErrorData",
|
||||
"EdgeNetworkTimeoutResponseErrorDataTypedDict",
|
||||
"Effort",
|
||||
@@ -1090,10 +1018,6 @@ __all__ = [
|
||||
"Logprob",
|
||||
"LogprobTypedDict",
|
||||
"Message",
|
||||
"MessageContent",
|
||||
"MessageContentTypedDict",
|
||||
"MessageDeveloper",
|
||||
"MessageDeveloperTypedDict",
|
||||
"MessageTypedDict",
|
||||
"Modality",
|
||||
"Model",
|
||||
@@ -1278,20 +1202,6 @@ __all__ = [
|
||||
"OpenResponsesRequestOnlyTypedDict",
|
||||
"OpenResponsesRequestOrder",
|
||||
"OpenResponsesRequestOrderTypedDict",
|
||||
"OpenResponsesRequestPluginAutoRouter",
|
||||
"OpenResponsesRequestPluginAutoRouterTypedDict",
|
||||
"OpenResponsesRequestPluginFileParser",
|
||||
"OpenResponsesRequestPluginFileParserTypedDict",
|
||||
"OpenResponsesRequestPluginModeration",
|
||||
"OpenResponsesRequestPluginModerationTypedDict",
|
||||
"OpenResponsesRequestPluginResponseHealing",
|
||||
"OpenResponsesRequestPluginResponseHealingTypedDict",
|
||||
"OpenResponsesRequestPluginUnion",
|
||||
"OpenResponsesRequestPluginUnionTypedDict",
|
||||
"OpenResponsesRequestPluginWeb",
|
||||
"OpenResponsesRequestPluginWebTypedDict",
|
||||
"OpenResponsesRequestProvider",
|
||||
"OpenResponsesRequestProviderTypedDict",
|
||||
"OpenResponsesRequestSort",
|
||||
"OpenResponsesRequestSortTypedDict",
|
||||
"OpenResponsesRequestToolFunction",
|
||||
@@ -1400,6 +1310,18 @@ __all__ = [
|
||||
"PercentileStatsTypedDict",
|
||||
"PercentileThroughputCutoffs",
|
||||
"PercentileThroughputCutoffsTypedDict",
|
||||
"Plugin",
|
||||
"PluginAutoRouter",
|
||||
"PluginAutoRouterTypedDict",
|
||||
"PluginFileParser",
|
||||
"PluginFileParserTypedDict",
|
||||
"PluginModeration",
|
||||
"PluginModerationTypedDict",
|
||||
"PluginResponseHealing",
|
||||
"PluginResponseHealingTypedDict",
|
||||
"PluginTypedDict",
|
||||
"PluginWeb",
|
||||
"PluginWebTypedDict",
|
||||
"PreferredMaxLatency",
|
||||
"PreferredMaxLatencyTypedDict",
|
||||
"PreferredMinThroughput",
|
||||
@@ -1410,6 +1332,7 @@ __all__ = [
|
||||
"PromptTokensDetails",
|
||||
"PromptTokensDetailsTypedDict",
|
||||
"PromptTypedDict",
|
||||
"Provider",
|
||||
"ProviderName",
|
||||
"ProviderOverloadedResponseErrorData",
|
||||
"ProviderOverloadedResponseErrorDataTypedDict",
|
||||
@@ -1437,13 +1360,13 @@ __all__ = [
|
||||
"ProviderSortConfigUnionTypedDict",
|
||||
"ProviderSortUnion",
|
||||
"ProviderSortUnionTypedDict",
|
||||
"ProviderTypedDict",
|
||||
"PublicEndpoint",
|
||||
"PublicEndpointQuantization",
|
||||
"PublicEndpointTypedDict",
|
||||
"PublicPricing",
|
||||
"PublicPricingTypedDict",
|
||||
"Quantization",
|
||||
"Quantizations",
|
||||
"Reason",
|
||||
"Reasoning",
|
||||
"ReasoningSummaryText",
|
||||
@@ -1456,12 +1379,20 @@ __all__ = [
|
||||
"ReasoningTypedDict",
|
||||
"RequestTimeoutResponseErrorData",
|
||||
"RequestTimeoutResponseErrorDataTypedDict",
|
||||
"ResponseFormat",
|
||||
"ResponseFormatJSONObject",
|
||||
"ResponseFormatJSONObjectTypedDict",
|
||||
"ResponseFormatJSONSchema",
|
||||
"ResponseFormatJSONSchemaTypedDict",
|
||||
"ResponseFormatPython",
|
||||
"ResponseFormatPythonTypedDict",
|
||||
"ResponseFormatText",
|
||||
"ResponseFormatTextConfig",
|
||||
"ResponseFormatTextConfigTypedDict",
|
||||
"ResponseFormatTextGrammar",
|
||||
"ResponseFormatTextGrammarTypedDict",
|
||||
"ResponseFormatTextTypedDict",
|
||||
"ResponseFormatTypedDict",
|
||||
"ResponseInputAudio",
|
||||
"ResponseInputAudioFormat",
|
||||
"ResponseInputAudioInputAudio",
|
||||
@@ -1546,25 +1477,49 @@ __all__ = [
|
||||
"ResponsesWebSearchUserLocationTypedDict",
|
||||
"Route",
|
||||
"Schema0",
|
||||
"Schema0Enum",
|
||||
"Schema0TypedDict",
|
||||
"Schema2",
|
||||
"Schema2ReasoningEncrypted",
|
||||
"Schema2ReasoningEncryptedTypedDict",
|
||||
"Schema2ReasoningSummary",
|
||||
"Schema2ReasoningSummaryTypedDict",
|
||||
"Schema2ReasoningText",
|
||||
"Schema2ReasoningTextTypedDict",
|
||||
"Schema2TypedDict",
|
||||
"Schema4",
|
||||
"Schema10",
|
||||
"Schema10TypedDict",
|
||||
"Schema14",
|
||||
"Schema14TypedDict",
|
||||
"Schema15",
|
||||
"Schema15TypedDict",
|
||||
"Schema15Union",
|
||||
"Schema15UnionTypedDict",
|
||||
"Schema17",
|
||||
"Schema17AutoRouter",
|
||||
"Schema17AutoRouterTypedDict",
|
||||
"Schema17FileParser",
|
||||
"Schema17FileParserTypedDict",
|
||||
"Schema17Moderation",
|
||||
"Schema17ModerationTypedDict",
|
||||
"Schema17ResponseHealing",
|
||||
"Schema17ResponseHealingTypedDict",
|
||||
"Schema17TypedDict",
|
||||
"Schema17Web",
|
||||
"Schema17WebTypedDict",
|
||||
"Schema19",
|
||||
"Schema19ReasoningEncrypted",
|
||||
"Schema19ReasoningEncryptedTypedDict",
|
||||
"Schema19ReasoningSummary",
|
||||
"Schema19ReasoningSummaryTypedDict",
|
||||
"Schema19ReasoningText",
|
||||
"Schema19ReasoningTextTypedDict",
|
||||
"Schema19TypedDict",
|
||||
"Schema21",
|
||||
"Schema3",
|
||||
"Schema5",
|
||||
"Schema5Enum",
|
||||
"Schema5TypedDict",
|
||||
"Schema8",
|
||||
"Security",
|
||||
"SecurityTypedDict",
|
||||
"ServiceTier",
|
||||
"ServiceUnavailableResponseErrorData",
|
||||
"ServiceUnavailableResponseErrorDataTypedDict",
|
||||
"SortEnum",
|
||||
"StreamOptions",
|
||||
"StreamOptionsTypedDict",
|
||||
"Stop",
|
||||
"StopTypedDict",
|
||||
"SystemMessage",
|
||||
"SystemMessageContent",
|
||||
"SystemMessageContentTypedDict",
|
||||
@@ -1629,18 +1584,42 @@ __all__ = [
|
||||
]
|
||||
|
||||
_dynamic_imports: dict[str, str] = {
|
||||
"Schema0": "._schema0",
|
||||
"Schema0Enum": "._schema0",
|
||||
"Schema0TypedDict": "._schema0",
|
||||
"Schema2": "._schema2",
|
||||
"Schema2ReasoningEncrypted": "._schema2",
|
||||
"Schema2ReasoningEncryptedTypedDict": "._schema2",
|
||||
"Schema2ReasoningSummary": "._schema2",
|
||||
"Schema2ReasoningSummaryTypedDict": "._schema2",
|
||||
"Schema2ReasoningText": "._schema2",
|
||||
"Schema2ReasoningTextTypedDict": "._schema2",
|
||||
"Schema2TypedDict": "._schema2",
|
||||
"Schema4": "._schema2",
|
||||
"Completion": "._schema10",
|
||||
"CompletionTypedDict": "._schema10",
|
||||
"Prompt": "._schema10",
|
||||
"PromptTypedDict": "._schema10",
|
||||
"Schema10": "._schema10",
|
||||
"Schema10TypedDict": "._schema10",
|
||||
"Schema14": "._schema14",
|
||||
"Schema14TypedDict": "._schema14",
|
||||
"Engine": "._schema17",
|
||||
"Pdf": "._schema17",
|
||||
"PdfEngine": "._schema17",
|
||||
"PdfTypedDict": "._schema17",
|
||||
"Schema17": "._schema17",
|
||||
"Schema17AutoRouter": "._schema17",
|
||||
"Schema17AutoRouterTypedDict": "._schema17",
|
||||
"Schema17FileParser": "._schema17",
|
||||
"Schema17FileParserTypedDict": "._schema17",
|
||||
"Schema17Moderation": "._schema17",
|
||||
"Schema17ModerationTypedDict": "._schema17",
|
||||
"Schema17ResponseHealing": "._schema17",
|
||||
"Schema17ResponseHealingTypedDict": "._schema17",
|
||||
"Schema17TypedDict": "._schema17",
|
||||
"Schema17Web": "._schema17",
|
||||
"Schema17WebTypedDict": "._schema17",
|
||||
"Schema19": "._schema19",
|
||||
"Schema19ReasoningEncrypted": "._schema19",
|
||||
"Schema19ReasoningEncryptedTypedDict": "._schema19",
|
||||
"Schema19ReasoningSummary": "._schema19",
|
||||
"Schema19ReasoningSummaryTypedDict": "._schema19",
|
||||
"Schema19ReasoningText": "._schema19",
|
||||
"Schema19ReasoningTextTypedDict": "._schema19",
|
||||
"Schema19TypedDict": "._schema19",
|
||||
"Schema21": "._schema19",
|
||||
"Schema5": "._schema5",
|
||||
"Schema5Enum": "._schema5",
|
||||
"Schema5TypedDict": "._schema5",
|
||||
"ActivityItem": ".activityitem",
|
||||
"ActivityItemTypedDict": ".activityitem",
|
||||
"AssistantMessage": ".assistantmessage",
|
||||
@@ -1661,56 +1640,34 @@ _dynamic_imports: dict[str, str] = {
|
||||
"Code": ".chaterror",
|
||||
"CodeTypedDict": ".chaterror",
|
||||
"ChatGenerationParams": ".chatgenerationparams",
|
||||
"ChatGenerationParamsDataCollection": ".chatgenerationparams",
|
||||
"ChatGenerationParamsImageConfig": ".chatgenerationparams",
|
||||
"ChatGenerationParamsImageConfigTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsMaxPrice": ".chatgenerationparams",
|
||||
"ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginModeration": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginModerationTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginResponseHealing": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginResponseHealingTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginUnion": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginWeb": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMaxLatency": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMaxLatencyTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMaxLatencyUnion": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMinThroughput": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMinThroughputTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMinThroughputUnion": ".chatgenerationparams",
|
||||
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsProvider": ".chatgenerationparams",
|
||||
"ChatGenerationParamsProviderTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatJSONObject": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatJSONObjectTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatPython": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatPythonTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatText": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatTextTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatUnion": ".chatgenerationparams",
|
||||
"ChatGenerationParamsResponseFormatUnionTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsStop": ".chatgenerationparams",
|
||||
"ChatGenerationParamsStopTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationParamsTypedDict": ".chatgenerationparams",
|
||||
"Debug": ".chatgenerationparams",
|
||||
"DebugTypedDict": ".chatgenerationparams",
|
||||
"Effort": ".chatgenerationparams",
|
||||
"Engine": ".chatgenerationparams",
|
||||
"Modality": ".chatgenerationparams",
|
||||
"Pdf": ".chatgenerationparams",
|
||||
"PdfEngine": ".chatgenerationparams",
|
||||
"PdfTypedDict": ".chatgenerationparams",
|
||||
"Quantizations": ".chatgenerationparams",
|
||||
"Reasoning": ".chatgenerationparams",
|
||||
"ReasoningTypedDict": ".chatgenerationparams",
|
||||
"ResponseFormat": ".chatgenerationparams",
|
||||
"ResponseFormatJSONObject": ".chatgenerationparams",
|
||||
"ResponseFormatJSONObjectTypedDict": ".chatgenerationparams",
|
||||
"ResponseFormatPython": ".chatgenerationparams",
|
||||
"ResponseFormatPythonTypedDict": ".chatgenerationparams",
|
||||
"ResponseFormatText": ".chatgenerationparams",
|
||||
"ResponseFormatTextTypedDict": ".chatgenerationparams",
|
||||
"ResponseFormatTypedDict": ".chatgenerationparams",
|
||||
"Route": ".chatgenerationparams",
|
||||
"Schema0": ".chatgenerationparams",
|
||||
"Schema0TypedDict": ".chatgenerationparams",
|
||||
"Schema15": ".chatgenerationparams",
|
||||
"Schema15TypedDict": ".chatgenerationparams",
|
||||
"Schema15Union": ".chatgenerationparams",
|
||||
"Schema15UnionTypedDict": ".chatgenerationparams",
|
||||
"Schema3": ".chatgenerationparams",
|
||||
"Schema8": ".chatgenerationparams",
|
||||
"Stop": ".chatgenerationparams",
|
||||
"StopTypedDict": ".chatgenerationparams",
|
||||
"ChatGenerationTokenUsage": ".chatgenerationtokenusage",
|
||||
"ChatGenerationTokenUsageTypedDict": ".chatgenerationtokenusage",
|
||||
"CompletionTokensDetails": ".chatgenerationtokenusage",
|
||||
@@ -1774,37 +1731,16 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ChatStreamingResponseChunkTypedDict": ".chatstreamingresponsechunk",
|
||||
"ChatStreamOptions": ".chatstreamoptions",
|
||||
"ChatStreamOptionsTypedDict": ".chatstreamoptions",
|
||||
"CompletionChoice": ".completionchoice",
|
||||
"CompletionChoiceTypedDict": ".completionchoice",
|
||||
"CompletionFinishReason": ".completionchoice",
|
||||
"CompletionCreateParams": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatJSONObject": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatJSONObjectTypedDict": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatPython": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatPythonTypedDict": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatText": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatTextTypedDict": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatUnion": ".completioncreateparams",
|
||||
"CompletionCreateParamsResponseFormatUnionTypedDict": ".completioncreateparams",
|
||||
"CompletionCreateParamsStop": ".completioncreateparams",
|
||||
"CompletionCreateParamsStopTypedDict": ".completioncreateparams",
|
||||
"CompletionCreateParamsTypedDict": ".completioncreateparams",
|
||||
"Prompt": ".completioncreateparams",
|
||||
"PromptTypedDict": ".completioncreateparams",
|
||||
"StreamOptions": ".completioncreateparams",
|
||||
"StreamOptionsTypedDict": ".completioncreateparams",
|
||||
"CompletionLogprobs": ".completionlogprobs",
|
||||
"CompletionLogprobsTypedDict": ".completionlogprobs",
|
||||
"CompletionResponse": ".completionresponse",
|
||||
"CompletionResponseTypedDict": ".completionresponse",
|
||||
"CompletionUsage": ".completionusage",
|
||||
"CompletionUsageTypedDict": ".completionusage",
|
||||
"ChainID": ".createchargerequest",
|
||||
"CreateChargeRequest": ".createchargerequest",
|
||||
"CreateChargeRequestTypedDict": ".createchargerequest",
|
||||
"DataCollection": ".datacollection",
|
||||
"DefaultParameters": ".defaultparameters",
|
||||
"DefaultParametersTypedDict": ".defaultparameters",
|
||||
"DeveloperMessage": ".developermessage",
|
||||
"DeveloperMessageContent": ".developermessage",
|
||||
"DeveloperMessageContentTypedDict": ".developermessage",
|
||||
"DeveloperMessageTypedDict": ".developermessage",
|
||||
"EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponseerrordata",
|
||||
"EdgeNetworkTimeoutResponseErrorDataTypedDict": ".edgenetworktimeoutresponseerrordata",
|
||||
"EndpointStatus": ".endpointstatus",
|
||||
@@ -1829,10 +1765,6 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ListEndpointsResponseTypedDict": ".listendpointsresponse",
|
||||
"Tokenizer": ".listendpointsresponse",
|
||||
"Message": ".message",
|
||||
"MessageContent": ".message",
|
||||
"MessageContentTypedDict": ".message",
|
||||
"MessageDeveloper": ".message",
|
||||
"MessageDeveloperTypedDict": ".message",
|
||||
"MessageTypedDict": ".message",
|
||||
"Model": ".model",
|
||||
"ModelTypedDict": ".model",
|
||||
@@ -2026,20 +1958,6 @@ _dynamic_imports: dict[str, str] = {
|
||||
"OpenResponsesRequestOnlyTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestOrder": ".openresponsesrequest",
|
||||
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginModeration": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginModerationTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginResponseHealing": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginResponseHealingTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginUnion": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginUnionTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginWeb": ".openresponsesrequest",
|
||||
"OpenResponsesRequestPluginWebTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestProvider": ".openresponsesrequest",
|
||||
"OpenResponsesRequestProviderTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestSort": ".openresponsesrequest",
|
||||
"OpenResponsesRequestSortTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestToolFunction": ".openresponsesrequest",
|
||||
@@ -2048,6 +1966,20 @@ _dynamic_imports: dict[str, str] = {
|
||||
"OpenResponsesRequestToolUnionTypedDict": ".openresponsesrequest",
|
||||
"OpenResponsesRequestType": ".openresponsesrequest",
|
||||
"OpenResponsesRequestTypedDict": ".openresponsesrequest",
|
||||
"Plugin": ".openresponsesrequest",
|
||||
"PluginAutoRouter": ".openresponsesrequest",
|
||||
"PluginAutoRouterTypedDict": ".openresponsesrequest",
|
||||
"PluginFileParser": ".openresponsesrequest",
|
||||
"PluginFileParserTypedDict": ".openresponsesrequest",
|
||||
"PluginModeration": ".openresponsesrequest",
|
||||
"PluginModerationTypedDict": ".openresponsesrequest",
|
||||
"PluginResponseHealing": ".openresponsesrequest",
|
||||
"PluginResponseHealingTypedDict": ".openresponsesrequest",
|
||||
"PluginTypedDict": ".openresponsesrequest",
|
||||
"PluginWeb": ".openresponsesrequest",
|
||||
"PluginWebTypedDict": ".openresponsesrequest",
|
||||
"Provider": ".openresponsesrequest",
|
||||
"ProviderTypedDict": ".openresponsesrequest",
|
||||
"ServiceTier": ".openresponsesrequest",
|
||||
"Truncation": ".openresponsesrequest",
|
||||
"OpenResponsesResponseText": ".openresponsesresponsetext",
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema14 import Schema14, Schema14TypedDict
|
||||
from openrouter.types import BaseModel
|
||||
from typing import Any, Optional, Union
|
||||
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
PromptTypedDict = TypeAliasType("PromptTypedDict", Union[float, str, Any])
|
||||
|
||||
|
||||
Prompt = TypeAliasType("Prompt", Union[float, str, Any])
|
||||
|
||||
|
||||
CompletionTypedDict = TypeAliasType("CompletionTypedDict", Union[float, str, Any])
|
||||
|
||||
|
||||
Completion = TypeAliasType("Completion", Union[float, str, Any])
|
||||
|
||||
|
||||
class Schema10TypedDict(TypedDict):
|
||||
prompt: NotRequired[PromptTypedDict]
|
||||
completion: NotRequired[CompletionTypedDict]
|
||||
image: NotRequired[Schema14TypedDict]
|
||||
audio: NotRequired[Schema14TypedDict]
|
||||
request: NotRequired[Schema14TypedDict]
|
||||
|
||||
|
||||
class Schema10(BaseModel):
|
||||
prompt: Optional[Prompt] = None
|
||||
|
||||
completion: Optional[Completion] = None
|
||||
|
||||
image: Optional[Schema14] = None
|
||||
|
||||
audio: Optional[Schema14] = None
|
||||
|
||||
request: Optional[Schema14] = None
|
||||
@@ -0,0 +1,11 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import Any, Union
|
||||
from typing_extensions import TypeAliasType
|
||||
|
||||
|
||||
Schema14TypedDict = TypeAliasType("Schema14TypedDict", Union[float, str, Any])
|
||||
|
||||
|
||||
Schema14 = TypeAliasType("Schema14", Union[float, str, Any])
|
||||
@@ -0,0 +1,154 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import get_discriminator, validate_const, validate_open_enum
|
||||
import pydantic
|
||||
from pydantic import Discriminator, Tag
|
||||
from pydantic.functional_validators import AfterValidator, PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
class Schema17ResponseHealingTypedDict(TypedDict):
|
||||
id: Literal["response-healing"]
|
||||
enabled: NotRequired[bool]
|
||||
|
||||
|
||||
class Schema17ResponseHealing(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[
|
||||
Literal["response-healing"],
|
||||
AfterValidator(validate_const("response-healing")),
|
||||
],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "response-healing"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
|
||||
PdfEngine = Union[
|
||||
Literal[
|
||||
"mistral-ocr",
|
||||
"pdf-text",
|
||||
"native",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class PdfTypedDict(TypedDict):
|
||||
engine: NotRequired[PdfEngine]
|
||||
|
||||
|
||||
class Pdf(BaseModel):
|
||||
engine: Annotated[
|
||||
Optional[PdfEngine], PlainValidator(validate_open_enum(False))
|
||||
] = None
|
||||
|
||||
|
||||
class Schema17FileParserTypedDict(TypedDict):
|
||||
id: Literal["file-parser"]
|
||||
enabled: NotRequired[bool]
|
||||
pdf: NotRequired[PdfTypedDict]
|
||||
|
||||
|
||||
class Schema17FileParser(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[
|
||||
Literal["file-parser"], AfterValidator(validate_const("file-parser"))
|
||||
],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "file-parser"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
pdf: Optional[Pdf] = None
|
||||
|
||||
|
||||
Engine = Union[
|
||||
Literal[
|
||||
"native",
|
||||
"exa",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class Schema17WebTypedDict(TypedDict):
|
||||
id: Literal["web"]
|
||||
enabled: NotRequired[bool]
|
||||
max_results: NotRequired[float]
|
||||
search_prompt: NotRequired[str]
|
||||
engine: NotRequired[Engine]
|
||||
|
||||
|
||||
class Schema17Web(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[Literal["web"], AfterValidator(validate_const("web"))],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "web"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
max_results: Optional[float] = None
|
||||
|
||||
search_prompt: Optional[str] = None
|
||||
|
||||
engine: Annotated[Optional[Engine], PlainValidator(validate_open_enum(False))] = (
|
||||
None
|
||||
)
|
||||
|
||||
|
||||
class Schema17ModerationTypedDict(TypedDict):
|
||||
id: Literal["moderation"]
|
||||
|
||||
|
||||
class Schema17Moderation(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[Literal["moderation"], AfterValidator(validate_const("moderation"))],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "moderation"
|
||||
|
||||
|
||||
class Schema17AutoRouterTypedDict(TypedDict):
|
||||
id: Literal["auto-router"]
|
||||
enabled: NotRequired[bool]
|
||||
allowed_models: NotRequired[List[str]]
|
||||
|
||||
|
||||
class Schema17AutoRouter(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[
|
||||
Literal["auto-router"], AfterValidator(validate_const("auto-router"))
|
||||
],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "auto-router"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
allowed_models: Optional[List[str]] = None
|
||||
|
||||
|
||||
Schema17TypedDict = TypeAliasType(
|
||||
"Schema17TypedDict",
|
||||
Union[
|
||||
Schema17ModerationTypedDict,
|
||||
Schema17ResponseHealingTypedDict,
|
||||
Schema17AutoRouterTypedDict,
|
||||
Schema17FileParserTypedDict,
|
||||
Schema17WebTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Schema17 = Annotated[
|
||||
Union[
|
||||
Annotated[Schema17AutoRouter, Tag("auto-router")],
|
||||
Annotated[Schema17Moderation, Tag("moderation")],
|
||||
Annotated[Schema17Web, Tag("web")],
|
||||
Annotated[Schema17FileParser, Tag("file-parser")],
|
||||
Annotated[Schema17ResponseHealing, Tag("response-healing")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
||||
]
|
||||
@@ -17,7 +17,7 @@ from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
Schema4 = Union[
|
||||
Schema21 = Union[
|
||||
Literal[
|
||||
"unknown",
|
||||
"openai-responses-v1",
|
||||
@@ -30,16 +30,16 @@ Schema4 = Union[
|
||||
]
|
||||
|
||||
|
||||
class Schema2ReasoningTextTypedDict(TypedDict):
|
||||
class Schema19ReasoningTextTypedDict(TypedDict):
|
||||
type: Literal["reasoning.text"]
|
||||
text: NotRequired[Nullable[str]]
|
||||
signature: NotRequired[Nullable[str]]
|
||||
id: NotRequired[Nullable[str]]
|
||||
format_: NotRequired[Nullable[Schema4]]
|
||||
format_: NotRequired[Nullable[Schema21]]
|
||||
index: NotRequired[float]
|
||||
|
||||
|
||||
class Schema2ReasoningText(BaseModel):
|
||||
class Schema19ReasoningText(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[
|
||||
Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text"))
|
||||
@@ -54,7 +54,9 @@ class Schema2ReasoningText(BaseModel):
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
format_: Annotated[
|
||||
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
|
||||
Annotated[
|
||||
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
|
||||
],
|
||||
pydantic.Field(alias="format"),
|
||||
] = UNSET
|
||||
|
||||
@@ -91,15 +93,15 @@ class Schema2ReasoningText(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class Schema2ReasoningEncryptedTypedDict(TypedDict):
|
||||
class Schema19ReasoningEncryptedTypedDict(TypedDict):
|
||||
data: str
|
||||
type: Literal["reasoning.encrypted"]
|
||||
id: NotRequired[Nullable[str]]
|
||||
format_: NotRequired[Nullable[Schema4]]
|
||||
format_: NotRequired[Nullable[Schema21]]
|
||||
index: NotRequired[float]
|
||||
|
||||
|
||||
class Schema2ReasoningEncrypted(BaseModel):
|
||||
class Schema19ReasoningEncrypted(BaseModel):
|
||||
data: str
|
||||
|
||||
TYPE: Annotated[
|
||||
@@ -113,7 +115,9 @@ class Schema2ReasoningEncrypted(BaseModel):
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
format_: Annotated[
|
||||
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
|
||||
Annotated[
|
||||
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
|
||||
],
|
||||
pydantic.Field(alias="format"),
|
||||
] = UNSET
|
||||
|
||||
@@ -150,15 +154,15 @@ class Schema2ReasoningEncrypted(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class Schema2ReasoningSummaryTypedDict(TypedDict):
|
||||
class Schema19ReasoningSummaryTypedDict(TypedDict):
|
||||
summary: str
|
||||
type: Literal["reasoning.summary"]
|
||||
id: NotRequired[Nullable[str]]
|
||||
format_: NotRequired[Nullable[Schema4]]
|
||||
format_: NotRequired[Nullable[Schema21]]
|
||||
index: NotRequired[float]
|
||||
|
||||
|
||||
class Schema2ReasoningSummary(BaseModel):
|
||||
class Schema19ReasoningSummary(BaseModel):
|
||||
summary: str
|
||||
|
||||
TYPE: Annotated[
|
||||
@@ -172,7 +176,9 @@ class Schema2ReasoningSummary(BaseModel):
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
format_: Annotated[
|
||||
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
|
||||
Annotated[
|
||||
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
|
||||
],
|
||||
pydantic.Field(alias="format"),
|
||||
] = UNSET
|
||||
|
||||
@@ -209,21 +215,21 @@ class Schema2ReasoningSummary(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
Schema2TypedDict = TypeAliasType(
|
||||
"Schema2TypedDict",
|
||||
Schema19TypedDict = TypeAliasType(
|
||||
"Schema19TypedDict",
|
||||
Union[
|
||||
Schema2ReasoningSummaryTypedDict,
|
||||
Schema2ReasoningEncryptedTypedDict,
|
||||
Schema2ReasoningTextTypedDict,
|
||||
Schema19ReasoningSummaryTypedDict,
|
||||
Schema19ReasoningEncryptedTypedDict,
|
||||
Schema19ReasoningTextTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Schema2 = Annotated[
|
||||
Schema19 = Annotated[
|
||||
Union[
|
||||
Annotated[Schema2ReasoningSummary, Tag("reasoning.summary")],
|
||||
Annotated[Schema2ReasoningEncrypted, Tag("reasoning.encrypted")],
|
||||
Annotated[Schema2ReasoningText, Tag("reasoning.text")],
|
||||
Annotated[Schema19ReasoningSummary, Tag("reasoning.summary")],
|
||||
Annotated[Schema19ReasoningEncrypted, Tag("reasoning.encrypted")],
|
||||
Annotated[Schema19ReasoningText, Tag("reasoning.text")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
@@ -8,11 +8,12 @@ from typing import Literal, Union
|
||||
from typing_extensions import Annotated, TypeAliasType
|
||||
|
||||
|
||||
Schema0Enum = Union[
|
||||
Schema5Enum = Union[
|
||||
Literal[
|
||||
"AI21",
|
||||
"AionLabs",
|
||||
"Alibaba",
|
||||
"Ambient",
|
||||
"Amazon Bedrock",
|
||||
"Amazon Nova",
|
||||
"Anthropic",
|
||||
@@ -69,6 +70,7 @@ Schema0Enum = Union[
|
||||
"Seed",
|
||||
"SiliconFlow",
|
||||
"Sourceful",
|
||||
"StepFun",
|
||||
"Stealth",
|
||||
"StreamLake",
|
||||
"Switchpoint",
|
||||
@@ -85,10 +87,10 @@ Schema0Enum = Union[
|
||||
]
|
||||
|
||||
|
||||
Schema0TypedDict = TypeAliasType("Schema0TypedDict", Union[Schema0Enum, str])
|
||||
Schema5TypedDict = TypeAliasType("Schema5TypedDict", Union[Schema5Enum, str])
|
||||
|
||||
|
||||
Schema0 = TypeAliasType(
|
||||
"Schema0",
|
||||
Union[Annotated[Schema0Enum, PlainValidator(validate_open_enum(False))], str],
|
||||
Schema5 = TypeAliasType(
|
||||
"Schema5",
|
||||
Union[Annotated[Schema5Enum, PlainValidator(validate_open_enum(False))], str],
|
||||
)
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema2 import Schema2, Schema2TypedDict
|
||||
from ._schema19 import Schema19, Schema19TypedDict
|
||||
from .chatmessagecontentitem import (
|
||||
ChatMessageContentItem,
|
||||
ChatMessageContentItemTypedDict,
|
||||
@@ -56,7 +56,7 @@ class AssistantMessageTypedDict(TypedDict):
|
||||
tool_calls: NotRequired[List[ChatMessageToolCallTypedDict]]
|
||||
refusal: NotRequired[Nullable[str]]
|
||||
reasoning: NotRequired[Nullable[str]]
|
||||
reasoning_details: NotRequired[List[Schema2TypedDict]]
|
||||
reasoning_details: NotRequired[List[Schema19TypedDict]]
|
||||
images: NotRequired[List[ImageTypedDict]]
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class AssistantMessage(BaseModel):
|
||||
|
||||
reasoning: OptionalNullable[str] = UNSET
|
||||
|
||||
reasoning_details: Optional[List[Schema2]] = None
|
||||
reasoning_details: Optional[List[Schema19]] = None
|
||||
|
||||
images: Optional[List[Image]] = None
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema0 import Schema0, Schema0TypedDict
|
||||
from ._schema10 import Schema10, Schema10TypedDict
|
||||
from ._schema17 import Schema17, Schema17TypedDict
|
||||
from ._schema5 import Schema5, Schema5TypedDict
|
||||
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
|
||||
from .message import Message, MessageTypedDict
|
||||
from .providersortunion import ProviderSortUnion, ProviderSortUnionTypedDict
|
||||
@@ -31,7 +33,7 @@ from typing import Any, Dict, List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
ChatGenerationParamsDataCollection = Union[
|
||||
Schema3 = Union[
|
||||
Literal[
|
||||
"deny",
|
||||
"allow",
|
||||
@@ -40,7 +42,7 @@ ChatGenerationParamsDataCollection = Union[
|
||||
]
|
||||
|
||||
|
||||
Quantizations = Union[
|
||||
Schema8 = Union[
|
||||
Literal[
|
||||
"int4",
|
||||
"int8",
|
||||
@@ -56,38 +58,14 @@ Quantizations = Union[
|
||||
]
|
||||
|
||||
|
||||
class ChatGenerationParamsMaxPriceTypedDict(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[Any]
|
||||
completion: NotRequired[Any]
|
||||
image: NotRequired[Any]
|
||||
audio: NotRequired[Any]
|
||||
request: NotRequired[Any]
|
||||
|
||||
|
||||
class ChatGenerationParamsMaxPrice(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[Any] = None
|
||||
|
||||
completion: Optional[Any] = None
|
||||
|
||||
image: Optional[Any] = None
|
||||
|
||||
audio: Optional[Any] = None
|
||||
|
||||
request: Optional[Any] = None
|
||||
|
||||
|
||||
class ChatGenerationParamsPreferredMinThroughputTypedDict(TypedDict):
|
||||
class Schema15TypedDict(TypedDict):
|
||||
p50: NotRequired[Nullable[float]]
|
||||
p75: NotRequired[Nullable[float]]
|
||||
p90: NotRequired[Nullable[float]]
|
||||
p99: NotRequired[Nullable[float]]
|
||||
|
||||
|
||||
class ChatGenerationParamsPreferredMinThroughput(BaseModel):
|
||||
class Schema15(BaseModel):
|
||||
p50: OptionalNullable[float] = UNSET
|
||||
|
||||
p75: OptionalNullable[float] = UNSET
|
||||
@@ -127,170 +105,60 @@ class ChatGenerationParamsPreferredMinThroughput(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
ChatGenerationParamsPreferredMinThroughputUnionTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
|
||||
Union[ChatGenerationParamsPreferredMinThroughputTypedDict, float],
|
||||
Schema15UnionTypedDict = TypeAliasType(
|
||||
"Schema15UnionTypedDict", Union[Schema15TypedDict, float]
|
||||
)
|
||||
|
||||
|
||||
ChatGenerationParamsPreferredMinThroughputUnion = TypeAliasType(
|
||||
"ChatGenerationParamsPreferredMinThroughputUnion",
|
||||
Union[ChatGenerationParamsPreferredMinThroughput, float],
|
||||
)
|
||||
Schema15Union = TypeAliasType("Schema15Union", Union[Schema15, float])
|
||||
|
||||
|
||||
class ChatGenerationParamsPreferredMaxLatencyTypedDict(TypedDict):
|
||||
p50: NotRequired[Nullable[float]]
|
||||
p75: NotRequired[Nullable[float]]
|
||||
p90: NotRequired[Nullable[float]]
|
||||
p99: NotRequired[Nullable[float]]
|
||||
|
||||
|
||||
class ChatGenerationParamsPreferredMaxLatency(BaseModel):
|
||||
p50: OptionalNullable[float] = UNSET
|
||||
|
||||
p75: OptionalNullable[float] = UNSET
|
||||
|
||||
p90: OptionalNullable[float] = UNSET
|
||||
|
||||
p99: OptionalNullable[float] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["p50", "p75", "p90", "p99"]
|
||||
nullable_fields = ["p50", "p75", "p90", "p99"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
|
||||
Union[ChatGenerationParamsPreferredMaxLatencyTypedDict, float],
|
||||
)
|
||||
|
||||
|
||||
ChatGenerationParamsPreferredMaxLatencyUnion = TypeAliasType(
|
||||
"ChatGenerationParamsPreferredMaxLatencyUnion",
|
||||
Union[ChatGenerationParamsPreferredMaxLatency, float],
|
||||
)
|
||||
|
||||
|
||||
class ChatGenerationParamsProviderTypedDict(TypedDict):
|
||||
class Schema0TypedDict(TypedDict):
|
||||
allow_fallbacks: NotRequired[Nullable[bool]]
|
||||
r"""Whether to allow backup providers to serve requests
|
||||
- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
|
||||
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
||||
|
||||
"""
|
||||
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[ChatGenerationParamsDataCollection]]
|
||||
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.
|
||||
"""
|
||||
data_collection: NotRequired[Nullable[Schema3]]
|
||||
zdr: NotRequired[Nullable[bool]]
|
||||
enforce_distillable_text: NotRequired[Nullable[bool]]
|
||||
order: NotRequired[Nullable[List[Schema0TypedDict]]]
|
||||
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[Schema0TypedDict]]]
|
||||
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[Schema0TypedDict]]]
|
||||
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[Quantizations]]]
|
||||
r"""A list of quantization levels to filter the provider by."""
|
||||
order: NotRequired[Nullable[List[Schema5TypedDict]]]
|
||||
only: NotRequired[Nullable[List[Schema5TypedDict]]]
|
||||
ignore: NotRequired[Nullable[List[Schema5TypedDict]]]
|
||||
quantizations: NotRequired[Nullable[List[Schema8]]]
|
||||
sort: NotRequired[Nullable[ProviderSortUnionTypedDict]]
|
||||
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
|
||||
max_price: NotRequired[ChatGenerationParamsMaxPriceTypedDict]
|
||||
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
||||
preferred_min_throughput: NotRequired[
|
||||
Nullable[ChatGenerationParamsPreferredMinThroughputUnionTypedDict]
|
||||
]
|
||||
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
|
||||
preferred_max_latency: NotRequired[
|
||||
Nullable[ChatGenerationParamsPreferredMaxLatencyUnionTypedDict]
|
||||
]
|
||||
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
|
||||
max_price: NotRequired[Schema10TypedDict]
|
||||
preferred_min_throughput: NotRequired[Nullable[Schema15UnionTypedDict]]
|
||||
preferred_max_latency: NotRequired[Nullable[Schema15UnionTypedDict]]
|
||||
|
||||
|
||||
class ChatGenerationParamsProvider(BaseModel):
|
||||
class Schema0(BaseModel):
|
||||
allow_fallbacks: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to allow backup providers to serve requests
|
||||
- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
|
||||
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
||||
|
||||
"""
|
||||
|
||||
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: Annotated[
|
||||
OptionalNullable[ChatGenerationParamsDataCollection],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
OptionalNullable[Schema3], PlainValidator(validate_open_enum(False))
|
||||
] = 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.
|
||||
"""
|
||||
|
||||
zdr: OptionalNullable[bool] = UNSET
|
||||
|
||||
enforce_distillable_text: OptionalNullable[bool] = UNSET
|
||||
|
||||
order: OptionalNullable[List[Schema0]] = 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."""
|
||||
order: OptionalNullable[List[Schema5]] = UNSET
|
||||
|
||||
only: OptionalNullable[List[Schema0]] = UNSET
|
||||
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
|
||||
only: OptionalNullable[List[Schema5]] = UNSET
|
||||
|
||||
ignore: OptionalNullable[List[Schema0]] = UNSET
|
||||
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
|
||||
ignore: OptionalNullable[List[Schema5]] = UNSET
|
||||
|
||||
quantizations: OptionalNullable[
|
||||
List[Annotated[Quantizations, PlainValidator(validate_open_enum(False))]]
|
||||
List[Annotated[Schema8, PlainValidator(validate_open_enum(False))]]
|
||||
] = UNSET
|
||||
r"""A list of quantization levels to filter the provider by."""
|
||||
|
||||
sort: OptionalNullable[ProviderSortUnion] = 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[ChatGenerationParamsMaxPrice] = None
|
||||
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
||||
max_price: Optional[Schema10] = None
|
||||
|
||||
preferred_min_throughput: OptionalNullable[
|
||||
ChatGenerationParamsPreferredMinThroughputUnion
|
||||
] = UNSET
|
||||
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
|
||||
preferred_min_throughput: OptionalNullable[Schema15Union] = UNSET
|
||||
|
||||
preferred_max_latency: OptionalNullable[
|
||||
ChatGenerationParamsPreferredMaxLatencyUnion
|
||||
] = UNSET
|
||||
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
|
||||
preferred_max_latency: OptionalNullable[Schema15Union] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
@@ -350,150 +218,6 @@ class ChatGenerationParamsProvider(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginResponseHealingTypedDict(TypedDict):
|
||||
id: Literal["response-healing"]
|
||||
enabled: NotRequired[bool]
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginResponseHealing(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[
|
||||
Literal["response-healing"],
|
||||
AfterValidator(validate_const("response-healing")),
|
||||
],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "response-healing"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
|
||||
PdfEngine = Union[
|
||||
Literal[
|
||||
"mistral-ocr",
|
||||
"pdf-text",
|
||||
"native",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class PdfTypedDict(TypedDict):
|
||||
engine: NotRequired[PdfEngine]
|
||||
|
||||
|
||||
class Pdf(BaseModel):
|
||||
engine: Annotated[
|
||||
Optional[PdfEngine], PlainValidator(validate_open_enum(False))
|
||||
] = None
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginFileParserTypedDict(TypedDict):
|
||||
id: Literal["file-parser"]
|
||||
enabled: NotRequired[bool]
|
||||
pdf: NotRequired[PdfTypedDict]
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginFileParser(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[
|
||||
Literal["file-parser"], AfterValidator(validate_const("file-parser"))
|
||||
],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "file-parser"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
pdf: Optional[Pdf] = None
|
||||
|
||||
|
||||
Engine = Union[
|
||||
Literal[
|
||||
"native",
|
||||
"exa",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginWebTypedDict(TypedDict):
|
||||
id: Literal["web"]
|
||||
enabled: NotRequired[bool]
|
||||
max_results: NotRequired[float]
|
||||
search_prompt: NotRequired[str]
|
||||
engine: NotRequired[Engine]
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginWeb(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[Literal["web"], AfterValidator(validate_const("web"))],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "web"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
max_results: Optional[float] = None
|
||||
|
||||
search_prompt: Optional[str] = None
|
||||
|
||||
engine: Annotated[Optional[Engine], PlainValidator(validate_open_enum(False))] = (
|
||||
None
|
||||
)
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginModerationTypedDict(TypedDict):
|
||||
id: Literal["moderation"]
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginModeration(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[Literal["moderation"], AfterValidator(validate_const("moderation"))],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "moderation"
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginAutoRouterTypedDict(TypedDict):
|
||||
id: Literal["auto-router"]
|
||||
enabled: NotRequired[bool]
|
||||
allowed_models: NotRequired[List[str]]
|
||||
|
||||
|
||||
class ChatGenerationParamsPluginAutoRouter(BaseModel):
|
||||
ID: Annotated[
|
||||
Annotated[
|
||||
Literal["auto-router"], AfterValidator(validate_const("auto-router"))
|
||||
],
|
||||
pydantic.Field(alias="id"),
|
||||
] = "auto-router"
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
|
||||
allowed_models: Optional[List[str]] = None
|
||||
|
||||
|
||||
ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsPluginUnionTypedDict",
|
||||
Union[
|
||||
ChatGenerationParamsPluginModerationTypedDict,
|
||||
ChatGenerationParamsPluginResponseHealingTypedDict,
|
||||
ChatGenerationParamsPluginAutoRouterTypedDict,
|
||||
ChatGenerationParamsPluginFileParserTypedDict,
|
||||
ChatGenerationParamsPluginWebTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
ChatGenerationParamsPluginUnion = Annotated[
|
||||
Union[
|
||||
Annotated[ChatGenerationParamsPluginAutoRouter, Tag("auto-router")],
|
||||
Annotated[ChatGenerationParamsPluginModeration, Tag("moderation")],
|
||||
Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
|
||||
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
|
||||
Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
||||
]
|
||||
|
||||
|
||||
Route = Union[
|
||||
Literal[
|
||||
"fallback",
|
||||
@@ -562,22 +286,22 @@ class Reasoning(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatPythonTypedDict(TypedDict):
|
||||
class ResponseFormatPythonTypedDict(TypedDict):
|
||||
type: Literal["python"]
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatPython(BaseModel):
|
||||
class ResponseFormatPython(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["python"], AfterValidator(validate_const("python"))],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "python"
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatJSONObjectTypedDict(TypedDict):
|
||||
class ResponseFormatJSONObjectTypedDict(TypedDict):
|
||||
type: Literal["json_object"]
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatJSONObject(BaseModel):
|
||||
class ResponseFormatJSONObject(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[
|
||||
Literal["json_object"], AfterValidator(validate_const("json_object"))
|
||||
@@ -586,49 +310,45 @@ class ChatGenerationParamsResponseFormatJSONObject(BaseModel):
|
||||
] = "json_object"
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatTextTypedDict(TypedDict):
|
||||
class ResponseFormatTextTypedDict(TypedDict):
|
||||
type: Literal["text"]
|
||||
|
||||
|
||||
class ChatGenerationParamsResponseFormatText(BaseModel):
|
||||
class ResponseFormatText(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["text"], AfterValidator(validate_const("text"))],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "text"
|
||||
|
||||
|
||||
ChatGenerationParamsResponseFormatUnionTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsResponseFormatUnionTypedDict",
|
||||
ResponseFormatTypedDict = TypeAliasType(
|
||||
"ResponseFormatTypedDict",
|
||||
Union[
|
||||
ChatGenerationParamsResponseFormatTextTypedDict,
|
||||
ChatGenerationParamsResponseFormatJSONObjectTypedDict,
|
||||
ChatGenerationParamsResponseFormatPythonTypedDict,
|
||||
ResponseFormatTextTypedDict,
|
||||
ResponseFormatJSONObjectTypedDict,
|
||||
ResponseFormatPythonTypedDict,
|
||||
ResponseFormatJSONSchemaTypedDict,
|
||||
ResponseFormatTextGrammarTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
ChatGenerationParamsResponseFormatUnion = Annotated[
|
||||
ResponseFormat = Annotated[
|
||||
Union[
|
||||
Annotated[ChatGenerationParamsResponseFormatText, Tag("text")],
|
||||
Annotated[ChatGenerationParamsResponseFormatJSONObject, Tag("json_object")],
|
||||
Annotated[ResponseFormatText, Tag("text")],
|
||||
Annotated[ResponseFormatJSONObject, Tag("json_object")],
|
||||
Annotated[ResponseFormatJSONSchema, Tag("json_schema")],
|
||||
Annotated[ResponseFormatTextGrammar, Tag("grammar")],
|
||||
Annotated[ChatGenerationParamsResponseFormatPython, Tag("python")],
|
||||
Annotated[ResponseFormatPython, Tag("python")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
|
||||
|
||||
ChatGenerationParamsStopTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsStopTypedDict", Union[str, List[str]]
|
||||
)
|
||||
StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]])
|
||||
|
||||
|
||||
ChatGenerationParamsStop = TypeAliasType(
|
||||
"ChatGenerationParamsStop", Union[str, List[str]]
|
||||
)
|
||||
Stop = TypeAliasType("Stop", Union[str, List[str]])
|
||||
|
||||
|
||||
class DebugTypedDict(TypedDict):
|
||||
@@ -640,12 +360,12 @@ class Debug(BaseModel):
|
||||
|
||||
|
||||
ChatGenerationParamsImageConfigTypedDict = TypeAliasType(
|
||||
"ChatGenerationParamsImageConfigTypedDict", Union[str, float]
|
||||
"ChatGenerationParamsImageConfigTypedDict", Union[str, float, List[Any]]
|
||||
)
|
||||
|
||||
|
||||
ChatGenerationParamsImageConfig = TypeAliasType(
|
||||
"ChatGenerationParamsImageConfig", Union[str, float]
|
||||
"ChatGenerationParamsImageConfig", Union[str, float, List[Any]]
|
||||
)
|
||||
|
||||
|
||||
@@ -660,14 +380,11 @@ Modality = Union[
|
||||
|
||||
class ChatGenerationParamsTypedDict(TypedDict):
|
||||
messages: List[MessageTypedDict]
|
||||
provider: NotRequired[Nullable[ChatGenerationParamsProviderTypedDict]]
|
||||
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
||||
plugins: NotRequired[List[ChatGenerationParamsPluginUnionTypedDict]]
|
||||
r"""Plugins you want to enable for this request, including their settings."""
|
||||
provider: NotRequired[Nullable[Schema0TypedDict]]
|
||||
plugins: NotRequired[List[Schema17TypedDict]]
|
||||
route: NotRequired[Nullable[Route]]
|
||||
user: NotRequired[str]
|
||||
session_id: NotRequired[str]
|
||||
r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."""
|
||||
model: NotRequired[str]
|
||||
models: NotRequired[List[str]]
|
||||
frequency_penalty: NotRequired[Nullable[float]]
|
||||
@@ -679,9 +396,9 @@ class ChatGenerationParamsTypedDict(TypedDict):
|
||||
metadata: NotRequired[Dict[str, str]]
|
||||
presence_penalty: NotRequired[Nullable[float]]
|
||||
reasoning: NotRequired[ReasoningTypedDict]
|
||||
response_format: NotRequired[ChatGenerationParamsResponseFormatUnionTypedDict]
|
||||
response_format: NotRequired[ResponseFormatTypedDict]
|
||||
seed: NotRequired[Nullable[int]]
|
||||
stop: NotRequired[Nullable[ChatGenerationParamsStopTypedDict]]
|
||||
stop: NotRequired[Nullable[StopTypedDict]]
|
||||
stream: NotRequired[bool]
|
||||
stream_options: NotRequired[Nullable[ChatStreamOptionsTypedDict]]
|
||||
temperature: NotRequired[Nullable[float]]
|
||||
@@ -696,11 +413,9 @@ class ChatGenerationParamsTypedDict(TypedDict):
|
||||
class ChatGenerationParams(BaseModel):
|
||||
messages: List[Message]
|
||||
|
||||
provider: OptionalNullable[ChatGenerationParamsProvider] = UNSET
|
||||
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
||||
provider: OptionalNullable[Schema0] = UNSET
|
||||
|
||||
plugins: Optional[List[ChatGenerationParamsPluginUnion]] = None
|
||||
r"""Plugins you want to enable for this request, including their settings."""
|
||||
plugins: Optional[List[Schema17]] = None
|
||||
|
||||
route: Annotated[
|
||||
OptionalNullable[Route], PlainValidator(validate_open_enum(False))
|
||||
@@ -709,7 +424,6 @@ class ChatGenerationParams(BaseModel):
|
||||
user: Optional[str] = None
|
||||
|
||||
session_id: Optional[str] = None
|
||||
r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."""
|
||||
|
||||
model: Optional[str] = None
|
||||
|
||||
@@ -733,11 +447,11 @@ class ChatGenerationParams(BaseModel):
|
||||
|
||||
reasoning: Optional[Reasoning] = None
|
||||
|
||||
response_format: Optional[ChatGenerationParamsResponseFormatUnion] = None
|
||||
response_format: Optional[ResponseFormat] = None
|
||||
|
||||
seed: OptionalNullable[int] = UNSET
|
||||
|
||||
stop: OptionalNullable[ChatGenerationParamsStop] = UNSET
|
||||
stop: OptionalNullable[Stop] = UNSET
|
||||
|
||||
stream: Optional[bool] = False
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema2 import Schema2, Schema2TypedDict
|
||||
from ._schema19 import Schema19, Schema19TypedDict
|
||||
from .chatstreamingmessagetoolcall import (
|
||||
ChatStreamingMessageToolCall,
|
||||
ChatStreamingMessageToolCallTypedDict,
|
||||
@@ -27,7 +27,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict):
|
||||
reasoning: NotRequired[Nullable[str]]
|
||||
refusal: NotRequired[Nullable[str]]
|
||||
tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]]
|
||||
reasoning_details: NotRequired[List[Schema2TypedDict]]
|
||||
reasoning_details: NotRequired[List[Schema19TypedDict]]
|
||||
|
||||
|
||||
class ChatStreamingMessageChunk(BaseModel):
|
||||
@@ -41,7 +41,7 @@ class ChatStreamingMessageChunk(BaseModel):
|
||||
|
||||
tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None
|
||||
|
||||
reasoning_details: Optional[List[Schema2]] = None
|
||||
reasoning_details: Optional[List[Schema19]] = None
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .completionlogprobs import CompletionLogprobs, CompletionLogprobsTypedDict
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import validate_open_enum
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
CompletionFinishReason = Union[
|
||||
Literal[
|
||||
"stop",
|
||||
"length",
|
||||
"content_filter",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class CompletionChoiceTypedDict(TypedDict):
|
||||
text: str
|
||||
index: float
|
||||
logprobs: Nullable[CompletionLogprobsTypedDict]
|
||||
finish_reason: Nullable[CompletionFinishReason]
|
||||
native_finish_reason: NotRequired[str]
|
||||
reasoning: NotRequired[Nullable[str]]
|
||||
|
||||
|
||||
class CompletionChoice(BaseModel):
|
||||
text: str
|
||||
|
||||
index: float
|
||||
|
||||
logprobs: Nullable[CompletionLogprobs]
|
||||
|
||||
finish_reason: Annotated[
|
||||
Nullable[CompletionFinishReason], PlainValidator(validate_open_enum(False))
|
||||
]
|
||||
|
||||
native_finish_reason: Optional[str] = None
|
||||
|
||||
reasoning: OptionalNullable[str] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["native_finish_reason", "reasoning"]
|
||||
nullable_fields = ["logprobs", "finish_reason", "reasoning"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
@@ -1,277 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .responseformatjsonschema import (
|
||||
ResponseFormatJSONSchema,
|
||||
ResponseFormatJSONSchemaTypedDict,
|
||||
)
|
||||
from .responseformattextgrammar import (
|
||||
ResponseFormatTextGrammar,
|
||||
ResponseFormatTextGrammarTypedDict,
|
||||
)
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
)
|
||||
from openrouter.utils import get_discriminator, validate_const
|
||||
import pydantic
|
||||
from pydantic import Discriminator, Tag, model_serializer
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import Dict, List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
PromptTypedDict = TypeAliasType(
|
||||
"PromptTypedDict", Union[str, List[str], List[float], List[List[float]]]
|
||||
)
|
||||
|
||||
|
||||
Prompt = TypeAliasType("Prompt", Union[str, List[str], List[float], List[List[float]]])
|
||||
|
||||
|
||||
CompletionCreateParamsStopTypedDict = TypeAliasType(
|
||||
"CompletionCreateParamsStopTypedDict", Union[str, List[str]]
|
||||
)
|
||||
|
||||
|
||||
CompletionCreateParamsStop = TypeAliasType(
|
||||
"CompletionCreateParamsStop", Union[str, List[str]]
|
||||
)
|
||||
|
||||
|
||||
class StreamOptionsTypedDict(TypedDict):
|
||||
include_usage: NotRequired[Nullable[bool]]
|
||||
|
||||
|
||||
class StreamOptions(BaseModel):
|
||||
include_usage: OptionalNullable[bool] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["include_usage"]
|
||||
nullable_fields = ["include_usage"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class CompletionCreateParamsResponseFormatPythonTypedDict(TypedDict):
|
||||
type: Literal["python"]
|
||||
|
||||
|
||||
class CompletionCreateParamsResponseFormatPython(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["python"], AfterValidator(validate_const("python"))],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "python"
|
||||
|
||||
|
||||
class CompletionCreateParamsResponseFormatJSONObjectTypedDict(TypedDict):
|
||||
type: Literal["json_object"]
|
||||
|
||||
|
||||
class CompletionCreateParamsResponseFormatJSONObject(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[
|
||||
Literal["json_object"], AfterValidator(validate_const("json_object"))
|
||||
],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "json_object"
|
||||
|
||||
|
||||
class CompletionCreateParamsResponseFormatTextTypedDict(TypedDict):
|
||||
type: Literal["text"]
|
||||
|
||||
|
||||
class CompletionCreateParamsResponseFormatText(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["text"], AfterValidator(validate_const("text"))],
|
||||
pydantic.Field(alias="type"),
|
||||
] = "text"
|
||||
|
||||
|
||||
CompletionCreateParamsResponseFormatUnionTypedDict = TypeAliasType(
|
||||
"CompletionCreateParamsResponseFormatUnionTypedDict",
|
||||
Union[
|
||||
CompletionCreateParamsResponseFormatTextTypedDict,
|
||||
CompletionCreateParamsResponseFormatJSONObjectTypedDict,
|
||||
CompletionCreateParamsResponseFormatPythonTypedDict,
|
||||
ResponseFormatJSONSchemaTypedDict,
|
||||
ResponseFormatTextGrammarTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
CompletionCreateParamsResponseFormatUnion = Annotated[
|
||||
Union[
|
||||
Annotated[CompletionCreateParamsResponseFormatText, Tag("text")],
|
||||
Annotated[CompletionCreateParamsResponseFormatJSONObject, Tag("json_object")],
|
||||
Annotated[ResponseFormatJSONSchema, Tag("json_schema")],
|
||||
Annotated[ResponseFormatTextGrammar, Tag("grammar")],
|
||||
Annotated[CompletionCreateParamsResponseFormatPython, Tag("python")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
|
||||
|
||||
class CompletionCreateParamsTypedDict(TypedDict):
|
||||
prompt: PromptTypedDict
|
||||
model: NotRequired[str]
|
||||
models: NotRequired[List[str]]
|
||||
best_of: NotRequired[Nullable[int]]
|
||||
echo: NotRequired[Nullable[bool]]
|
||||
frequency_penalty: NotRequired[Nullable[float]]
|
||||
logit_bias: NotRequired[Nullable[Dict[str, float]]]
|
||||
logprobs: NotRequired[Nullable[int]]
|
||||
max_tokens: NotRequired[Nullable[int]]
|
||||
n: NotRequired[Nullable[int]]
|
||||
presence_penalty: NotRequired[Nullable[float]]
|
||||
seed: NotRequired[Nullable[int]]
|
||||
stop: NotRequired[Nullable[CompletionCreateParamsStopTypedDict]]
|
||||
stream: NotRequired[bool]
|
||||
stream_options: NotRequired[Nullable[StreamOptionsTypedDict]]
|
||||
suffix: NotRequired[Nullable[str]]
|
||||
temperature: NotRequired[Nullable[float]]
|
||||
top_p: NotRequired[Nullable[float]]
|
||||
user: NotRequired[str]
|
||||
metadata: NotRequired[Nullable[Dict[str, str]]]
|
||||
response_format: NotRequired[
|
||||
Nullable[CompletionCreateParamsResponseFormatUnionTypedDict]
|
||||
]
|
||||
|
||||
|
||||
class CompletionCreateParams(BaseModel):
|
||||
prompt: Prompt
|
||||
|
||||
model: Optional[str] = None
|
||||
|
||||
models: Optional[List[str]] = None
|
||||
|
||||
best_of: OptionalNullable[int] = UNSET
|
||||
|
||||
echo: OptionalNullable[bool] = UNSET
|
||||
|
||||
frequency_penalty: OptionalNullable[float] = UNSET
|
||||
|
||||
logit_bias: OptionalNullable[Dict[str, float]] = UNSET
|
||||
|
||||
logprobs: OptionalNullable[int] = UNSET
|
||||
|
||||
max_tokens: OptionalNullable[int] = UNSET
|
||||
|
||||
n: OptionalNullable[int] = UNSET
|
||||
|
||||
presence_penalty: OptionalNullable[float] = UNSET
|
||||
|
||||
seed: OptionalNullable[int] = UNSET
|
||||
|
||||
stop: OptionalNullable[CompletionCreateParamsStop] = UNSET
|
||||
|
||||
stream: Optional[bool] = False
|
||||
|
||||
stream_options: OptionalNullable[StreamOptions] = UNSET
|
||||
|
||||
suffix: OptionalNullable[str] = UNSET
|
||||
|
||||
temperature: OptionalNullable[float] = UNSET
|
||||
|
||||
top_p: OptionalNullable[float] = UNSET
|
||||
|
||||
user: Optional[str] = None
|
||||
|
||||
metadata: OptionalNullable[Dict[str, str]] = UNSET
|
||||
|
||||
response_format: OptionalNullable[CompletionCreateParamsResponseFormatUnion] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"model",
|
||||
"models",
|
||||
"best_of",
|
||||
"echo",
|
||||
"frequency_penalty",
|
||||
"logit_bias",
|
||||
"logprobs",
|
||||
"max_tokens",
|
||||
"n",
|
||||
"presence_penalty",
|
||||
"seed",
|
||||
"stop",
|
||||
"stream",
|
||||
"stream_options",
|
||||
"suffix",
|
||||
"temperature",
|
||||
"top_p",
|
||||
"user",
|
||||
"metadata",
|
||||
"response_format",
|
||||
]
|
||||
nullable_fields = [
|
||||
"best_of",
|
||||
"echo",
|
||||
"frequency_penalty",
|
||||
"logit_bias",
|
||||
"logprobs",
|
||||
"max_tokens",
|
||||
"n",
|
||||
"presence_penalty",
|
||||
"seed",
|
||||
"stop",
|
||||
"stream_options",
|
||||
"suffix",
|
||||
"temperature",
|
||||
"top_p",
|
||||
"metadata",
|
||||
"response_format",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
@@ -1,54 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from pydantic import model_serializer
|
||||
from typing import Dict, List
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
|
||||
class CompletionLogprobsTypedDict(TypedDict):
|
||||
tokens: List[str]
|
||||
token_logprobs: List[float]
|
||||
top_logprobs: Nullable[List[Dict[str, float]]]
|
||||
text_offset: List[float]
|
||||
|
||||
|
||||
class CompletionLogprobs(BaseModel):
|
||||
tokens: List[str]
|
||||
|
||||
token_logprobs: List[float]
|
||||
|
||||
top_logprobs: Nullable[List[Dict[str, float]]]
|
||||
|
||||
text_offset: List[float]
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
nullable_fields = ["top_logprobs"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
@@ -1,46 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .completionchoice import CompletionChoice, CompletionChoiceTypedDict
|
||||
from .completionusage import CompletionUsage, CompletionUsageTypedDict
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import validate_const
|
||||
import pydantic
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import List, Literal, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class CompletionResponseTypedDict(TypedDict):
|
||||
id: str
|
||||
created: float
|
||||
model: str
|
||||
choices: List[CompletionChoiceTypedDict]
|
||||
object: Literal["text_completion"]
|
||||
provider: NotRequired[str]
|
||||
system_fingerprint: NotRequired[str]
|
||||
usage: NotRequired[CompletionUsageTypedDict]
|
||||
|
||||
|
||||
class CompletionResponse(BaseModel):
|
||||
id: str
|
||||
|
||||
created: float
|
||||
|
||||
model: str
|
||||
|
||||
choices: List[CompletionChoice]
|
||||
|
||||
OBJECT: Annotated[
|
||||
Annotated[
|
||||
Literal["text_completion"],
|
||||
AfterValidator(validate_const("text_completion")),
|
||||
],
|
||||
pydantic.Field(alias="object"),
|
||||
] = "text_completion"
|
||||
|
||||
provider: Optional[str] = None
|
||||
|
||||
system_fingerprint: Optional[str] = None
|
||||
|
||||
usage: Optional[CompletionUsage] = None
|
||||
@@ -1,19 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
|
||||
class CompletionUsageTypedDict(TypedDict):
|
||||
prompt_tokens: float
|
||||
completion_tokens: float
|
||||
total_tokens: float
|
||||
|
||||
|
||||
class CompletionUsage(BaseModel):
|
||||
prompt_tokens: float
|
||||
|
||||
completion_tokens: float
|
||||
|
||||
total_tokens: float
|
||||
@@ -0,0 +1,41 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .chatmessagecontentitemtext import (
|
||||
ChatMessageContentItemText,
|
||||
ChatMessageContentItemTextTypedDict,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import validate_const
|
||||
import pydantic
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
DeveloperMessageContentTypedDict = TypeAliasType(
|
||||
"DeveloperMessageContentTypedDict",
|
||||
Union[str, List[ChatMessageContentItemTextTypedDict]],
|
||||
)
|
||||
|
||||
|
||||
DeveloperMessageContent = TypeAliasType(
|
||||
"DeveloperMessageContent", Union[str, List[ChatMessageContentItemText]]
|
||||
)
|
||||
|
||||
|
||||
class DeveloperMessageTypedDict(TypedDict):
|
||||
content: DeveloperMessageContentTypedDict
|
||||
role: Literal["developer"]
|
||||
name: NotRequired[str]
|
||||
|
||||
|
||||
class DeveloperMessage(BaseModel):
|
||||
content: DeveloperMessageContent
|
||||
|
||||
ROLE: Annotated[
|
||||
Annotated[Literal["developer"], AfterValidator(validate_const("developer"))],
|
||||
pydantic.Field(alias="role"),
|
||||
] = "developer"
|
||||
|
||||
name: Optional[str] = None
|
||||
@@ -2,47 +2,14 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
|
||||
from .chatmessagecontentitemtext import (
|
||||
ChatMessageContentItemText,
|
||||
ChatMessageContentItemTextTypedDict,
|
||||
)
|
||||
from .developermessage import DeveloperMessage, DeveloperMessageTypedDict
|
||||
from .systemmessage import SystemMessage, SystemMessageTypedDict
|
||||
from .toolresponsemessage import ToolResponseMessage, ToolResponseMessageTypedDict
|
||||
from .usermessage import UserMessage, UserMessageTypedDict
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import get_discriminator, validate_const
|
||||
import pydantic
|
||||
from openrouter.utils import get_discriminator
|
||||
from pydantic import Discriminator, Tag
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
MessageContentTypedDict = TypeAliasType(
|
||||
"MessageContentTypedDict", Union[str, List[ChatMessageContentItemTextTypedDict]]
|
||||
)
|
||||
|
||||
|
||||
MessageContent = TypeAliasType(
|
||||
"MessageContent", Union[str, List[ChatMessageContentItemText]]
|
||||
)
|
||||
|
||||
|
||||
class MessageDeveloperTypedDict(TypedDict):
|
||||
content: MessageContentTypedDict
|
||||
role: Literal["developer"]
|
||||
name: NotRequired[str]
|
||||
|
||||
|
||||
class MessageDeveloper(BaseModel):
|
||||
content: MessageContent
|
||||
|
||||
ROLE: Annotated[
|
||||
Annotated[Literal["developer"], AfterValidator(validate_const("developer"))],
|
||||
pydantic.Field(alias="role"),
|
||||
] = "developer"
|
||||
|
||||
name: Optional[str] = None
|
||||
from typing import Union
|
||||
from typing_extensions import Annotated, TypeAliasType
|
||||
|
||||
|
||||
MessageTypedDict = TypeAliasType(
|
||||
@@ -50,7 +17,7 @@ MessageTypedDict = TypeAliasType(
|
||||
Union[
|
||||
SystemMessageTypedDict,
|
||||
UserMessageTypedDict,
|
||||
MessageDeveloperTypedDict,
|
||||
DeveloperMessageTypedDict,
|
||||
ToolResponseMessageTypedDict,
|
||||
AssistantMessageTypedDict,
|
||||
],
|
||||
@@ -61,7 +28,7 @@ Message = Annotated[
|
||||
Union[
|
||||
Annotated[SystemMessage, Tag("system")],
|
||||
Annotated[UserMessage, Tag("user")],
|
||||
Annotated[MessageDeveloper, Tag("developer")],
|
||||
Annotated[DeveloperMessage, Tag("developer")],
|
||||
Annotated[AssistantMessage, Tag("assistant")],
|
||||
Annotated[ToolResponseMessage, Tag("tool")],
|
||||
],
|
||||
|
||||
@@ -222,37 +222,29 @@ class OpenResponsesRequestMaxPriceTypedDict(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[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
r"""Price per million prompt tokens"""
|
||||
completion: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
request: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
|
||||
class OpenResponsesRequestMaxPrice(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[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
r"""Price per million prompt tokens"""
|
||||
|
||||
completion: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
request: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
|
||||
class OpenResponsesRequestProviderTypedDict(TypedDict):
|
||||
class ProviderTypedDict(TypedDict):
|
||||
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
||||
|
||||
allow_fallbacks: NotRequired[Nullable[bool]]
|
||||
@@ -291,7 +283,7 @@ class OpenResponsesRequestProviderTypedDict(TypedDict):
|
||||
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
|
||||
|
||||
|
||||
class OpenResponsesRequestProvider(BaseModel):
|
||||
class Provider(BaseModel):
|
||||
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
||||
|
||||
allow_fallbacks: OptionalNullable[bool] = UNSET
|
||||
@@ -406,13 +398,13 @@ class OpenResponsesRequestProvider(BaseModel):
|
||||
IDResponseHealing = Literal["response-healing",]
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginResponseHealingTypedDict(TypedDict):
|
||||
class PluginResponseHealingTypedDict(TypedDict):
|
||||
id: IDResponseHealing
|
||||
enabled: NotRequired[bool]
|
||||
r"""Set to false to disable the response-healing plugin for this request. Defaults to true."""
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginResponseHealing(BaseModel):
|
||||
class PluginResponseHealing(BaseModel):
|
||||
id: IDResponseHealing
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
@@ -422,7 +414,7 @@ class OpenResponsesRequestPluginResponseHealing(BaseModel):
|
||||
IDFileParser = Literal["file-parser",]
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
|
||||
class PluginFileParserTypedDict(TypedDict):
|
||||
id: IDFileParser
|
||||
enabled: NotRequired[bool]
|
||||
r"""Set to false to disable the file-parser plugin for this request. Defaults to true."""
|
||||
@@ -430,7 +422,7 @@ class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
|
||||
r"""Options for PDF parsing."""
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginFileParser(BaseModel):
|
||||
class PluginFileParser(BaseModel):
|
||||
id: IDFileParser
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
@@ -443,7 +435,7 @@ class OpenResponsesRequestPluginFileParser(BaseModel):
|
||||
IDWeb = Literal["web",]
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginWebTypedDict(TypedDict):
|
||||
class PluginWebTypedDict(TypedDict):
|
||||
id: IDWeb
|
||||
enabled: NotRequired[bool]
|
||||
r"""Set to false to disable the web-search plugin for this request. Defaults to true."""
|
||||
@@ -453,7 +445,7 @@ class OpenResponsesRequestPluginWebTypedDict(TypedDict):
|
||||
r"""The search engine to use for web search."""
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginWeb(BaseModel):
|
||||
class PluginWeb(BaseModel):
|
||||
id: IDWeb
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
@@ -472,18 +464,18 @@ class OpenResponsesRequestPluginWeb(BaseModel):
|
||||
IDModeration = Literal["moderation",]
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginModerationTypedDict(TypedDict):
|
||||
class PluginModerationTypedDict(TypedDict):
|
||||
id: IDModeration
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginModeration(BaseModel):
|
||||
class PluginModeration(BaseModel):
|
||||
id: IDModeration
|
||||
|
||||
|
||||
IDAutoRouter = Literal["auto-router",]
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
|
||||
class PluginAutoRouterTypedDict(TypedDict):
|
||||
id: IDAutoRouter
|
||||
enabled: NotRequired[bool]
|
||||
r"""Set to false to disable the auto-router plugin for this request. Defaults to true."""
|
||||
@@ -491,7 +483,7 @@ class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
|
||||
r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
|
||||
|
||||
|
||||
class OpenResponsesRequestPluginAutoRouter(BaseModel):
|
||||
class PluginAutoRouter(BaseModel):
|
||||
id: IDAutoRouter
|
||||
|
||||
enabled: Optional[bool] = None
|
||||
@@ -501,25 +493,25 @@ class OpenResponsesRequestPluginAutoRouter(BaseModel):
|
||||
r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
|
||||
|
||||
|
||||
OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
|
||||
"OpenResponsesRequestPluginUnionTypedDict",
|
||||
PluginTypedDict = TypeAliasType(
|
||||
"PluginTypedDict",
|
||||
Union[
|
||||
OpenResponsesRequestPluginModerationTypedDict,
|
||||
OpenResponsesRequestPluginResponseHealingTypedDict,
|
||||
OpenResponsesRequestPluginAutoRouterTypedDict,
|
||||
OpenResponsesRequestPluginFileParserTypedDict,
|
||||
OpenResponsesRequestPluginWebTypedDict,
|
||||
PluginModerationTypedDict,
|
||||
PluginResponseHealingTypedDict,
|
||||
PluginAutoRouterTypedDict,
|
||||
PluginFileParserTypedDict,
|
||||
PluginWebTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
OpenResponsesRequestPluginUnion = Annotated[
|
||||
Plugin = Annotated[
|
||||
Union[
|
||||
Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")],
|
||||
Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
|
||||
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
|
||||
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
|
||||
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
|
||||
Annotated[PluginAutoRouter, Tag("auto-router")],
|
||||
Annotated[PluginModeration, Tag("moderation")],
|
||||
Annotated[PluginWeb, Tag("web")],
|
||||
Annotated[PluginFileParser, Tag("file-parser")],
|
||||
Annotated[PluginResponseHealing, Tag("response-healing")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
||||
]
|
||||
@@ -564,9 +556,9 @@ class OpenResponsesRequestTypedDict(TypedDict):
|
||||
service_tier: NotRequired[ServiceTier]
|
||||
truncation: NotRequired[Nullable[Truncation]]
|
||||
stream: NotRequired[bool]
|
||||
provider: NotRequired[Nullable[OpenResponsesRequestProviderTypedDict]]
|
||||
provider: NotRequired[Nullable[ProviderTypedDict]]
|
||||
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
||||
plugins: NotRequired[List[OpenResponsesRequestPluginUnionTypedDict]]
|
||||
plugins: NotRequired[List[PluginTypedDict]]
|
||||
r"""Plugins you want to enable for this request, including their settings."""
|
||||
user: NotRequired[str]
|
||||
r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters."""
|
||||
@@ -660,10 +652,10 @@ class OpenResponsesRequest(BaseModel):
|
||||
|
||||
stream: Optional[bool] = False
|
||||
|
||||
provider: OptionalNullable[OpenResponsesRequestProvider] = UNSET
|
||||
provider: OptionalNullable[Provider] = UNSET
|
||||
r"""When multiple model providers are available, optionally indicate your routing preference."""
|
||||
|
||||
plugins: Optional[List[OpenResponsesRequestPluginUnion]] = None
|
||||
plugins: Optional[List[Plugin]] = None
|
||||
r"""Plugins you want to enable for this request, including their settings."""
|
||||
|
||||
user: Optional[str] = None
|
||||
|
||||
@@ -10,6 +10,7 @@ ProviderName = Union[
|
||||
"AI21",
|
||||
"AionLabs",
|
||||
"Alibaba",
|
||||
"Ambient",
|
||||
"Amazon Bedrock",
|
||||
"Amazon Nova",
|
||||
"Anthropic",
|
||||
@@ -66,6 +67,7 @@ ProviderName = Union[
|
||||
"Seed",
|
||||
"SiliconFlow",
|
||||
"Sourceful",
|
||||
"StepFun",
|
||||
"Stealth",
|
||||
"StreamLake",
|
||||
"Switchpoint",
|
||||
|
||||
@@ -176,34 +176,26 @@ class ProviderPreferencesMaxPriceTypedDict(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[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
r"""Price per million prompt tokens"""
|
||||
completion: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
request: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
|
||||
class ProviderPreferencesMaxPrice(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[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
r"""Price per million prompt tokens"""
|
||||
|
||||
completion: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
request: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
|
||||
class ProviderPreferencesTypedDict(TypedDict):
|
||||
|
||||
@@ -15,73 +15,47 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
class PricingTypedDict(TypedDict):
|
||||
prompt: str
|
||||
r"""A value in string format that is a large number"""
|
||||
completion: str
|
||||
r"""A value in string format that is a large number"""
|
||||
request: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image_token: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image_output: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio_output: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_audio_cache: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
web_search: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
internal_reasoning: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_cache_read: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_cache_write: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
discount: NotRequired[float]
|
||||
|
||||
|
||||
class Pricing(BaseModel):
|
||||
prompt: str
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
completion: str
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
request: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image_token: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image_output: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio_output: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_audio_cache: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
web_search: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
internal_reasoning: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_cache_read: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_cache_write: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
discount: Optional[float] = None
|
||||
|
||||
|
||||
@@ -10,31 +10,18 @@ class PublicPricingTypedDict(TypedDict):
|
||||
r"""Pricing information for the model"""
|
||||
|
||||
prompt: str
|
||||
r"""A value in string format that is a large number"""
|
||||
completion: str
|
||||
r"""A value in string format that is a large number"""
|
||||
request: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image_token: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
image_output: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio_output: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_audio_cache: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
web_search: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
internal_reasoning: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_cache_read: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_cache_write: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
discount: NotRequired[float]
|
||||
|
||||
|
||||
@@ -42,42 +29,29 @@ class PublicPricing(BaseModel):
|
||||
r"""Pricing information for the model"""
|
||||
|
||||
prompt: str
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
completion: str
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
request: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image_token: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
image_output: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio_output: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_audio_cache: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
web_search: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
internal_reasoning: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_cache_read: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_cache_write: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
discount: Optional[float] = None
|
||||
|
||||
Reference in New Issue
Block a user