openrouter 0.0.19__py3-none-any.whl → 0.0.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openrouter/_version.py +3 -3
- openrouter/analytics.py +2 -0
- openrouter/api_keys.py +24 -4
- openrouter/basesdk.py +6 -0
- openrouter/chat.py +154 -14
- openrouter/completions.py +2 -0
- openrouter/components/__init__.py +156 -61
- openrouter/components/_schema0.py +93 -0
- openrouter/components/chatcompletionfinishreason.py +17 -0
- openrouter/components/chatgenerationparams.py +397 -13
- openrouter/components/chatmessagecontentitem.py +1 -1
- openrouter/components/chatmessagecontentitemaudio.py +6 -25
- openrouter/components/chatmessagecontentitemcachecontrol.py +32 -0
- openrouter/components/chatmessagecontentitemtext.py +9 -2
- openrouter/components/chatmessagecontentitemvideo.py +9 -5
- openrouter/components/chatresponsechoice.py +1 -67
- openrouter/components/chatstreamingchoice.py +72 -0
- openrouter/components/chatstreamingresponsechunk.py +1 -1
- openrouter/components/completionchoice.py +18 -5
- openrouter/components/completioncreateparams.py +10 -10
- openrouter/components/completionresponse.py +3 -0
- openrouter/components/message.py +10 -9
- openrouter/components/openairesponsesannotation.py +11 -4
- openrouter/components/openairesponsesreasoningeffort.py +1 -0
- openrouter/components/openresponsesnonstreamingresponse.py +13 -10
- openrouter/components/openresponsesrequest.py +155 -81
- openrouter/components/openresponsesstreamevent.py +110 -39
- openrouter/components/outputmessage.py +10 -4
- openrouter/components/providername.py +8 -1
- openrouter/components/publicendpoint.py +49 -49
- openrouter/components/publicpricing.py +49 -49
- openrouter/components/responseformattextconfig.py +9 -7
- openrouter/components/responsesoutputitem.py +12 -10
- openrouter/components/responsesoutputmessage.py +10 -5
- openrouter/credits.py +4 -0
- openrouter/embeddings.py +4 -0
- openrouter/endpoints.py +4 -0
- openrouter/generations.py +2 -0
- openrouter/models/__init__.py +3 -0
- openrouter/models/internal/__init__.py +54 -0
- openrouter/models/internal/globals.py +41 -0
- openrouter/models_.py +6 -0
- openrouter/oauth.py +4 -0
- openrouter/operations/__init__.py +10 -1
- openrouter/operations/createembeddings.py +44 -24
- openrouter/operations/getcredits.py +19 -0
- openrouter/operations/getparameters.py +8 -1
- openrouter/operations/updatekeys.py +2 -2
- openrouter/parameters.py +2 -0
- openrouter/providers.py +2 -0
- openrouter/responses.py +88 -36
- openrouter/sdk.py +13 -0
- openrouter/sdkconfiguration.py +2 -0
- openrouter/utils/forms.py +21 -10
- openrouter/utils/queryparams.py +14 -2
- openrouter/utils/retries.py +69 -5
- {openrouter-0.0.19.dist-info → openrouter-0.0.22.dist-info}/METADATA +1 -1
- {openrouter-0.0.19.dist-info → openrouter-0.0.22.dist-info}/RECORD +61 -54
- {openrouter-0.0.19.dist-info → openrouter-0.0.22.dist-info}/WHEEL +0 -0
- {openrouter-0.0.19.dist-info → openrouter-0.0.22.dist-info}/licenses/LICENSE +0 -0
- {openrouter-0.0.19.dist-info → openrouter-0.0.22.dist-info}/top_level.txt +0 -0
|
@@ -6,6 +6,7 @@ import builtins
|
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
+
from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict
|
|
9
10
|
from .activityitem import ActivityItem, ActivityItemTypedDict
|
|
10
11
|
from .assistantmessage import (
|
|
11
12
|
AssistantMessage,
|
|
@@ -21,9 +22,29 @@ if TYPE_CHECKING:
|
|
|
21
22
|
BadRequestResponseErrorData,
|
|
22
23
|
BadRequestResponseErrorDataTypedDict,
|
|
23
24
|
)
|
|
25
|
+
from .chatcompletionfinishreason import ChatCompletionFinishReason
|
|
24
26
|
from .chaterror import ChatErrorError, ChatErrorErrorTypedDict, Code, CodeTypedDict
|
|
25
27
|
from .chatgenerationparams import (
|
|
26
28
|
ChatGenerationParams,
|
|
29
|
+
ChatGenerationParamsDataCollection,
|
|
30
|
+
ChatGenerationParamsEngine,
|
|
31
|
+
ChatGenerationParamsMaxPrice,
|
|
32
|
+
ChatGenerationParamsMaxPriceTypedDict,
|
|
33
|
+
ChatGenerationParamsPdf,
|
|
34
|
+
ChatGenerationParamsPdfEngine,
|
|
35
|
+
ChatGenerationParamsPdfTypedDict,
|
|
36
|
+
ChatGenerationParamsPluginFileParser,
|
|
37
|
+
ChatGenerationParamsPluginFileParserTypedDict,
|
|
38
|
+
ChatGenerationParamsPluginModeration,
|
|
39
|
+
ChatGenerationParamsPluginModerationTypedDict,
|
|
40
|
+
ChatGenerationParamsPluginResponseHealing,
|
|
41
|
+
ChatGenerationParamsPluginResponseHealingTypedDict,
|
|
42
|
+
ChatGenerationParamsPluginUnion,
|
|
43
|
+
ChatGenerationParamsPluginUnionTypedDict,
|
|
44
|
+
ChatGenerationParamsPluginWeb,
|
|
45
|
+
ChatGenerationParamsPluginWebTypedDict,
|
|
46
|
+
ChatGenerationParamsProvider,
|
|
47
|
+
ChatGenerationParamsProviderTypedDict,
|
|
27
48
|
ChatGenerationParamsResponseFormatJSONObject,
|
|
28
49
|
ChatGenerationParamsResponseFormatJSONObjectTypedDict,
|
|
29
50
|
ChatGenerationParamsResponseFormatPython,
|
|
@@ -32,12 +53,17 @@ if TYPE_CHECKING:
|
|
|
32
53
|
ChatGenerationParamsResponseFormatTextTypedDict,
|
|
33
54
|
ChatGenerationParamsResponseFormatUnion,
|
|
34
55
|
ChatGenerationParamsResponseFormatUnionTypedDict,
|
|
56
|
+
ChatGenerationParamsRoute,
|
|
35
57
|
ChatGenerationParamsStop,
|
|
36
58
|
ChatGenerationParamsStopTypedDict,
|
|
37
59
|
ChatGenerationParamsTypedDict,
|
|
60
|
+
Debug,
|
|
61
|
+
DebugTypedDict,
|
|
38
62
|
Effort,
|
|
63
|
+
Quantizations,
|
|
39
64
|
Reasoning,
|
|
40
65
|
ReasoningTypedDict,
|
|
66
|
+
Sort,
|
|
41
67
|
)
|
|
42
68
|
from .chatgenerationtokenusage import (
|
|
43
69
|
ChatGenerationTokenUsage,
|
|
@@ -53,11 +79,15 @@ if TYPE_CHECKING:
|
|
|
53
79
|
)
|
|
54
80
|
from .chatmessagecontentitemaudio import (
|
|
55
81
|
ChatMessageContentItemAudio,
|
|
56
|
-
ChatMessageContentItemAudioFormat,
|
|
57
82
|
ChatMessageContentItemAudioInputAudio,
|
|
58
83
|
ChatMessageContentItemAudioInputAudioTypedDict,
|
|
59
84
|
ChatMessageContentItemAudioTypedDict,
|
|
60
85
|
)
|
|
86
|
+
from .chatmessagecontentitemcachecontrol import (
|
|
87
|
+
ChatMessageContentItemCacheControl,
|
|
88
|
+
ChatMessageContentItemCacheControlTypedDict,
|
|
89
|
+
TTL,
|
|
90
|
+
)
|
|
61
91
|
from .chatmessagecontentitemimage import (
|
|
62
92
|
ChatMessageContentItemImage,
|
|
63
93
|
ChatMessageContentItemImageDetail,
|
|
@@ -98,13 +128,8 @@ if TYPE_CHECKING:
|
|
|
98
128
|
ChatMessageToolCallTypedDict,
|
|
99
129
|
)
|
|
100
130
|
from .chatresponse import ChatResponse, ChatResponseTypedDict
|
|
101
|
-
from .chatresponsechoice import
|
|
102
|
-
|
|
103
|
-
ChatResponseChoice,
|
|
104
|
-
ChatResponseChoiceTypedDict,
|
|
105
|
-
ChatStreamingChoice,
|
|
106
|
-
ChatStreamingChoiceTypedDict,
|
|
107
|
-
)
|
|
131
|
+
from .chatresponsechoice import ChatResponseChoice, ChatResponseChoiceTypedDict
|
|
132
|
+
from .chatstreamingchoice import ChatStreamingChoice, ChatStreamingChoiceTypedDict
|
|
108
133
|
from .chatstreamingmessagechunk import (
|
|
109
134
|
ChatStreamingMessageChunk,
|
|
110
135
|
ChatStreamingMessageChunkRole,
|
|
@@ -419,17 +444,34 @@ if TYPE_CHECKING:
|
|
|
419
444
|
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
|
|
420
445
|
)
|
|
421
446
|
from .openresponsesrequest import (
|
|
422
|
-
Engine,
|
|
423
447
|
IDFileParser,
|
|
424
448
|
IDModeration,
|
|
449
|
+
IDResponseHealing,
|
|
425
450
|
IDWeb,
|
|
426
451
|
Ignore,
|
|
427
452
|
IgnoreTypedDict,
|
|
428
|
-
MaxPrice,
|
|
429
|
-
MaxPriceTypedDict,
|
|
430
453
|
Only,
|
|
431
454
|
OnlyTypedDict,
|
|
432
455
|
OpenResponsesRequest,
|
|
456
|
+
OpenResponsesRequestEngine,
|
|
457
|
+
OpenResponsesRequestMaxPrice,
|
|
458
|
+
OpenResponsesRequestMaxPriceTypedDict,
|
|
459
|
+
OpenResponsesRequestPdf,
|
|
460
|
+
OpenResponsesRequestPdfEngine,
|
|
461
|
+
OpenResponsesRequestPdfTypedDict,
|
|
462
|
+
OpenResponsesRequestPluginFileParser,
|
|
463
|
+
OpenResponsesRequestPluginFileParserTypedDict,
|
|
464
|
+
OpenResponsesRequestPluginModeration,
|
|
465
|
+
OpenResponsesRequestPluginModerationTypedDict,
|
|
466
|
+
OpenResponsesRequestPluginResponseHealing,
|
|
467
|
+
OpenResponsesRequestPluginResponseHealingTypedDict,
|
|
468
|
+
OpenResponsesRequestPluginUnion,
|
|
469
|
+
OpenResponsesRequestPluginUnionTypedDict,
|
|
470
|
+
OpenResponsesRequestPluginWeb,
|
|
471
|
+
OpenResponsesRequestPluginWebTypedDict,
|
|
472
|
+
OpenResponsesRequestProvider,
|
|
473
|
+
OpenResponsesRequestProviderTypedDict,
|
|
474
|
+
OpenResponsesRequestRoute,
|
|
433
475
|
OpenResponsesRequestToolFunction,
|
|
434
476
|
OpenResponsesRequestToolFunctionTypedDict,
|
|
435
477
|
OpenResponsesRequestToolUnion,
|
|
@@ -438,19 +480,6 @@ if TYPE_CHECKING:
|
|
|
438
480
|
OpenResponsesRequestTypedDict,
|
|
439
481
|
Order,
|
|
440
482
|
OrderTypedDict,
|
|
441
|
-
Pdf,
|
|
442
|
-
PdfEngine,
|
|
443
|
-
PdfTypedDict,
|
|
444
|
-
Plugin,
|
|
445
|
-
PluginFileParser,
|
|
446
|
-
PluginFileParserTypedDict,
|
|
447
|
-
PluginModeration,
|
|
448
|
-
PluginModerationTypedDict,
|
|
449
|
-
PluginTypedDict,
|
|
450
|
-
PluginWeb,
|
|
451
|
-
PluginWebTypedDict,
|
|
452
|
-
Provider,
|
|
453
|
-
ProviderTypedDict,
|
|
454
483
|
ServiceTier,
|
|
455
484
|
Truncation,
|
|
456
485
|
)
|
|
@@ -805,6 +834,25 @@ __all__ = [
|
|
|
805
834
|
"ChatErrorError",
|
|
806
835
|
"ChatErrorErrorTypedDict",
|
|
807
836
|
"ChatGenerationParams",
|
|
837
|
+
"ChatGenerationParamsDataCollection",
|
|
838
|
+
"ChatGenerationParamsEngine",
|
|
839
|
+
"ChatGenerationParamsMaxPrice",
|
|
840
|
+
"ChatGenerationParamsMaxPriceTypedDict",
|
|
841
|
+
"ChatGenerationParamsPdf",
|
|
842
|
+
"ChatGenerationParamsPdfEngine",
|
|
843
|
+
"ChatGenerationParamsPdfTypedDict",
|
|
844
|
+
"ChatGenerationParamsPluginFileParser",
|
|
845
|
+
"ChatGenerationParamsPluginFileParserTypedDict",
|
|
846
|
+
"ChatGenerationParamsPluginModeration",
|
|
847
|
+
"ChatGenerationParamsPluginModerationTypedDict",
|
|
848
|
+
"ChatGenerationParamsPluginResponseHealing",
|
|
849
|
+
"ChatGenerationParamsPluginResponseHealingTypedDict",
|
|
850
|
+
"ChatGenerationParamsPluginUnion",
|
|
851
|
+
"ChatGenerationParamsPluginUnionTypedDict",
|
|
852
|
+
"ChatGenerationParamsPluginWeb",
|
|
853
|
+
"ChatGenerationParamsPluginWebTypedDict",
|
|
854
|
+
"ChatGenerationParamsProvider",
|
|
855
|
+
"ChatGenerationParamsProviderTypedDict",
|
|
808
856
|
"ChatGenerationParamsResponseFormatJSONObject",
|
|
809
857
|
"ChatGenerationParamsResponseFormatJSONObjectTypedDict",
|
|
810
858
|
"ChatGenerationParamsResponseFormatPython",
|
|
@@ -813,6 +861,7 @@ __all__ = [
|
|
|
813
861
|
"ChatGenerationParamsResponseFormatTextTypedDict",
|
|
814
862
|
"ChatGenerationParamsResponseFormatUnion",
|
|
815
863
|
"ChatGenerationParamsResponseFormatUnionTypedDict",
|
|
864
|
+
"ChatGenerationParamsRoute",
|
|
816
865
|
"ChatGenerationParamsStop",
|
|
817
866
|
"ChatGenerationParamsStopTypedDict",
|
|
818
867
|
"ChatGenerationParamsTypedDict",
|
|
@@ -820,10 +869,11 @@ __all__ = [
|
|
|
820
869
|
"ChatGenerationTokenUsageTypedDict",
|
|
821
870
|
"ChatMessageContentItem",
|
|
822
871
|
"ChatMessageContentItemAudio",
|
|
823
|
-
"ChatMessageContentItemAudioFormat",
|
|
824
872
|
"ChatMessageContentItemAudioInputAudio",
|
|
825
873
|
"ChatMessageContentItemAudioInputAudioTypedDict",
|
|
826
874
|
"ChatMessageContentItemAudioTypedDict",
|
|
875
|
+
"ChatMessageContentItemCacheControl",
|
|
876
|
+
"ChatMessageContentItemCacheControlTypedDict",
|
|
827
877
|
"ChatMessageContentItemImage",
|
|
828
878
|
"ChatMessageContentItemImageDetail",
|
|
829
879
|
"ChatMessageContentItemImageTypedDict",
|
|
@@ -896,13 +946,14 @@ __all__ = [
|
|
|
896
946
|
"CreateChargeRequest",
|
|
897
947
|
"CreateChargeRequestTypedDict",
|
|
898
948
|
"DataCollection",
|
|
949
|
+
"Debug",
|
|
950
|
+
"DebugTypedDict",
|
|
899
951
|
"DefaultParameters",
|
|
900
952
|
"DefaultParametersTypedDict",
|
|
901
953
|
"EdgeNetworkTimeoutResponseErrorData",
|
|
902
954
|
"EdgeNetworkTimeoutResponseErrorDataTypedDict",
|
|
903
955
|
"Effort",
|
|
904
956
|
"EndpointStatus",
|
|
905
|
-
"Engine",
|
|
906
957
|
"FileCitation",
|
|
907
958
|
"FileCitationType",
|
|
908
959
|
"FileCitationTypedDict",
|
|
@@ -913,6 +964,7 @@ __all__ = [
|
|
|
913
964
|
"ForbiddenResponseErrorDataTypedDict",
|
|
914
965
|
"IDFileParser",
|
|
915
966
|
"IDModeration",
|
|
967
|
+
"IDResponseHealing",
|
|
916
968
|
"IDWeb",
|
|
917
969
|
"Ignore",
|
|
918
970
|
"IgnoreTypedDict",
|
|
@@ -929,8 +981,6 @@ __all__ = [
|
|
|
929
981
|
"JSONSchemaConfigTypedDict",
|
|
930
982
|
"ListEndpointsResponse",
|
|
931
983
|
"ListEndpointsResponseTypedDict",
|
|
932
|
-
"MaxPrice",
|
|
933
|
-
"MaxPriceTypedDict",
|
|
934
984
|
"Message",
|
|
935
985
|
"MessageContent",
|
|
936
986
|
"MessageContentTypedDict",
|
|
@@ -1103,6 +1153,25 @@ __all__ = [
|
|
|
1103
1153
|
"OpenResponsesReasoningType",
|
|
1104
1154
|
"OpenResponsesReasoningTypedDict",
|
|
1105
1155
|
"OpenResponsesRequest",
|
|
1156
|
+
"OpenResponsesRequestEngine",
|
|
1157
|
+
"OpenResponsesRequestMaxPrice",
|
|
1158
|
+
"OpenResponsesRequestMaxPriceTypedDict",
|
|
1159
|
+
"OpenResponsesRequestPdf",
|
|
1160
|
+
"OpenResponsesRequestPdfEngine",
|
|
1161
|
+
"OpenResponsesRequestPdfTypedDict",
|
|
1162
|
+
"OpenResponsesRequestPluginFileParser",
|
|
1163
|
+
"OpenResponsesRequestPluginFileParserTypedDict",
|
|
1164
|
+
"OpenResponsesRequestPluginModeration",
|
|
1165
|
+
"OpenResponsesRequestPluginModerationTypedDict",
|
|
1166
|
+
"OpenResponsesRequestPluginResponseHealing",
|
|
1167
|
+
"OpenResponsesRequestPluginResponseHealingTypedDict",
|
|
1168
|
+
"OpenResponsesRequestPluginUnion",
|
|
1169
|
+
"OpenResponsesRequestPluginUnionTypedDict",
|
|
1170
|
+
"OpenResponsesRequestPluginWeb",
|
|
1171
|
+
"OpenResponsesRequestPluginWebTypedDict",
|
|
1172
|
+
"OpenResponsesRequestProvider",
|
|
1173
|
+
"OpenResponsesRequestProviderTypedDict",
|
|
1174
|
+
"OpenResponsesRequestRoute",
|
|
1106
1175
|
"OpenResponsesRequestToolFunction",
|
|
1107
1176
|
"OpenResponsesRequestToolFunctionTypedDict",
|
|
1108
1177
|
"OpenResponsesRequestToolUnion",
|
|
@@ -1196,37 +1265,25 @@ __all__ = [
|
|
|
1196
1265
|
"PayloadTooLargeResponseErrorDataTypedDict",
|
|
1197
1266
|
"PaymentRequiredResponseErrorData",
|
|
1198
1267
|
"PaymentRequiredResponseErrorDataTypedDict",
|
|
1199
|
-
"Pdf",
|
|
1200
|
-
"PdfEngine",
|
|
1201
|
-
"PdfTypedDict",
|
|
1202
1268
|
"PerRequestLimits",
|
|
1203
1269
|
"PerRequestLimitsTypedDict",
|
|
1204
|
-
"Plugin",
|
|
1205
|
-
"PluginFileParser",
|
|
1206
|
-
"PluginFileParserTypedDict",
|
|
1207
|
-
"PluginModeration",
|
|
1208
|
-
"PluginModerationTypedDict",
|
|
1209
|
-
"PluginTypedDict",
|
|
1210
|
-
"PluginWeb",
|
|
1211
|
-
"PluginWebTypedDict",
|
|
1212
1270
|
"Pricing",
|
|
1213
1271
|
"PricingTypedDict",
|
|
1214
1272
|
"Prompt",
|
|
1215
1273
|
"PromptTokensDetails",
|
|
1216
1274
|
"PromptTokensDetailsTypedDict",
|
|
1217
1275
|
"PromptTypedDict",
|
|
1218
|
-
"Provider",
|
|
1219
1276
|
"ProviderName",
|
|
1220
1277
|
"ProviderOverloadedResponseErrorData",
|
|
1221
1278
|
"ProviderOverloadedResponseErrorDataTypedDict",
|
|
1222
1279
|
"ProviderSort",
|
|
1223
|
-
"ProviderTypedDict",
|
|
1224
1280
|
"PublicEndpoint",
|
|
1225
1281
|
"PublicEndpointQuantization",
|
|
1226
1282
|
"PublicEndpointTypedDict",
|
|
1227
1283
|
"PublicPricing",
|
|
1228
1284
|
"PublicPricingTypedDict",
|
|
1229
1285
|
"Quantization",
|
|
1286
|
+
"Quantizations",
|
|
1230
1287
|
"Reason",
|
|
1231
1288
|
"Reasoning",
|
|
1232
1289
|
"ReasoningSummaryText",
|
|
@@ -1320,17 +1377,22 @@ __all__ = [
|
|
|
1320
1377
|
"ResponsesWebSearchUserLocation",
|
|
1321
1378
|
"ResponsesWebSearchUserLocationType",
|
|
1322
1379
|
"ResponsesWebSearchUserLocationTypedDict",
|
|
1380
|
+
"Schema0",
|
|
1381
|
+
"Schema0Enum",
|
|
1382
|
+
"Schema0TypedDict",
|
|
1323
1383
|
"Security",
|
|
1324
1384
|
"SecurityTypedDict",
|
|
1325
1385
|
"ServiceTier",
|
|
1326
1386
|
"ServiceUnavailableResponseErrorData",
|
|
1327
1387
|
"ServiceUnavailableResponseErrorDataTypedDict",
|
|
1388
|
+
"Sort",
|
|
1328
1389
|
"StreamOptions",
|
|
1329
1390
|
"StreamOptionsTypedDict",
|
|
1330
1391
|
"SystemMessage",
|
|
1331
1392
|
"SystemMessageContent",
|
|
1332
1393
|
"SystemMessageContentTypedDict",
|
|
1333
1394
|
"SystemMessageTypedDict",
|
|
1395
|
+
"TTL",
|
|
1334
1396
|
"Tokenizer",
|
|
1335
1397
|
"TooManyRequestsResponseErrorData",
|
|
1336
1398
|
"TooManyRequestsResponseErrorDataTypedDict",
|
|
@@ -1391,6 +1453,9 @@ __all__ = [
|
|
|
1391
1453
|
]
|
|
1392
1454
|
|
|
1393
1455
|
_dynamic_imports: dict[str, str] = {
|
|
1456
|
+
"Schema0": "._schema0",
|
|
1457
|
+
"Schema0Enum": "._schema0",
|
|
1458
|
+
"Schema0TypedDict": "._schema0",
|
|
1394
1459
|
"ActivityItem": ".activityitem",
|
|
1395
1460
|
"ActivityItemTypedDict": ".activityitem",
|
|
1396
1461
|
"AssistantMessage": ".assistantmessage",
|
|
@@ -1401,11 +1466,31 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1401
1466
|
"BadGatewayResponseErrorDataTypedDict": ".badgatewayresponseerrordata",
|
|
1402
1467
|
"BadRequestResponseErrorData": ".badrequestresponseerrordata",
|
|
1403
1468
|
"BadRequestResponseErrorDataTypedDict": ".badrequestresponseerrordata",
|
|
1469
|
+
"ChatCompletionFinishReason": ".chatcompletionfinishreason",
|
|
1404
1470
|
"ChatErrorError": ".chaterror",
|
|
1405
1471
|
"ChatErrorErrorTypedDict": ".chaterror",
|
|
1406
1472
|
"Code": ".chaterror",
|
|
1407
1473
|
"CodeTypedDict": ".chaterror",
|
|
1408
1474
|
"ChatGenerationParams": ".chatgenerationparams",
|
|
1475
|
+
"ChatGenerationParamsDataCollection": ".chatgenerationparams",
|
|
1476
|
+
"ChatGenerationParamsEngine": ".chatgenerationparams",
|
|
1477
|
+
"ChatGenerationParamsMaxPrice": ".chatgenerationparams",
|
|
1478
|
+
"ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams",
|
|
1479
|
+
"ChatGenerationParamsPdf": ".chatgenerationparams",
|
|
1480
|
+
"ChatGenerationParamsPdfEngine": ".chatgenerationparams",
|
|
1481
|
+
"ChatGenerationParamsPdfTypedDict": ".chatgenerationparams",
|
|
1482
|
+
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
|
|
1483
|
+
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
|
|
1484
|
+
"ChatGenerationParamsPluginModeration": ".chatgenerationparams",
|
|
1485
|
+
"ChatGenerationParamsPluginModerationTypedDict": ".chatgenerationparams",
|
|
1486
|
+
"ChatGenerationParamsPluginResponseHealing": ".chatgenerationparams",
|
|
1487
|
+
"ChatGenerationParamsPluginResponseHealingTypedDict": ".chatgenerationparams",
|
|
1488
|
+
"ChatGenerationParamsPluginUnion": ".chatgenerationparams",
|
|
1489
|
+
"ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams",
|
|
1490
|
+
"ChatGenerationParamsPluginWeb": ".chatgenerationparams",
|
|
1491
|
+
"ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams",
|
|
1492
|
+
"ChatGenerationParamsProvider": ".chatgenerationparams",
|
|
1493
|
+
"ChatGenerationParamsProviderTypedDict": ".chatgenerationparams",
|
|
1409
1494
|
"ChatGenerationParamsResponseFormatJSONObject": ".chatgenerationparams",
|
|
1410
1495
|
"ChatGenerationParamsResponseFormatJSONObjectTypedDict": ".chatgenerationparams",
|
|
1411
1496
|
"ChatGenerationParamsResponseFormatPython": ".chatgenerationparams",
|
|
@@ -1414,12 +1499,17 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1414
1499
|
"ChatGenerationParamsResponseFormatTextTypedDict": ".chatgenerationparams",
|
|
1415
1500
|
"ChatGenerationParamsResponseFormatUnion": ".chatgenerationparams",
|
|
1416
1501
|
"ChatGenerationParamsResponseFormatUnionTypedDict": ".chatgenerationparams",
|
|
1502
|
+
"ChatGenerationParamsRoute": ".chatgenerationparams",
|
|
1417
1503
|
"ChatGenerationParamsStop": ".chatgenerationparams",
|
|
1418
1504
|
"ChatGenerationParamsStopTypedDict": ".chatgenerationparams",
|
|
1419
1505
|
"ChatGenerationParamsTypedDict": ".chatgenerationparams",
|
|
1506
|
+
"Debug": ".chatgenerationparams",
|
|
1507
|
+
"DebugTypedDict": ".chatgenerationparams",
|
|
1420
1508
|
"Effort": ".chatgenerationparams",
|
|
1509
|
+
"Quantizations": ".chatgenerationparams",
|
|
1421
1510
|
"Reasoning": ".chatgenerationparams",
|
|
1422
1511
|
"ReasoningTypedDict": ".chatgenerationparams",
|
|
1512
|
+
"Sort": ".chatgenerationparams",
|
|
1423
1513
|
"ChatGenerationTokenUsage": ".chatgenerationtokenusage",
|
|
1424
1514
|
"ChatGenerationTokenUsageTypedDict": ".chatgenerationtokenusage",
|
|
1425
1515
|
"CompletionTokensDetails": ".chatgenerationtokenusage",
|
|
@@ -1429,10 +1519,12 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1429
1519
|
"ChatMessageContentItem": ".chatmessagecontentitem",
|
|
1430
1520
|
"ChatMessageContentItemTypedDict": ".chatmessagecontentitem",
|
|
1431
1521
|
"ChatMessageContentItemAudio": ".chatmessagecontentitemaudio",
|
|
1432
|
-
"ChatMessageContentItemAudioFormat": ".chatmessagecontentitemaudio",
|
|
1433
1522
|
"ChatMessageContentItemAudioInputAudio": ".chatmessagecontentitemaudio",
|
|
1434
1523
|
"ChatMessageContentItemAudioInputAudioTypedDict": ".chatmessagecontentitemaudio",
|
|
1435
1524
|
"ChatMessageContentItemAudioTypedDict": ".chatmessagecontentitemaudio",
|
|
1525
|
+
"ChatMessageContentItemCacheControl": ".chatmessagecontentitemcachecontrol",
|
|
1526
|
+
"ChatMessageContentItemCacheControlTypedDict": ".chatmessagecontentitemcachecontrol",
|
|
1527
|
+
"TTL": ".chatmessagecontentitemcachecontrol",
|
|
1436
1528
|
"ChatMessageContentItemImage": ".chatmessagecontentitemimage",
|
|
1437
1529
|
"ChatMessageContentItemImageDetail": ".chatmessagecontentitemimage",
|
|
1438
1530
|
"ChatMessageContentItemImageTypedDict": ".chatmessagecontentitemimage",
|
|
@@ -1462,11 +1554,10 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1462
1554
|
"ChatMessageToolCallTypedDict": ".chatmessagetoolcall",
|
|
1463
1555
|
"ChatResponse": ".chatresponse",
|
|
1464
1556
|
"ChatResponseTypedDict": ".chatresponse",
|
|
1465
|
-
"ChatCompletionFinishReason": ".chatresponsechoice",
|
|
1466
1557
|
"ChatResponseChoice": ".chatresponsechoice",
|
|
1467
1558
|
"ChatResponseChoiceTypedDict": ".chatresponsechoice",
|
|
1468
|
-
"ChatStreamingChoice": ".
|
|
1469
|
-
"ChatStreamingChoiceTypedDict": ".
|
|
1559
|
+
"ChatStreamingChoice": ".chatstreamingchoice",
|
|
1560
|
+
"ChatStreamingChoiceTypedDict": ".chatstreamingchoice",
|
|
1470
1561
|
"ChatStreamingMessageChunk": ".chatstreamingmessagechunk",
|
|
1471
1562
|
"ChatStreamingMessageChunkRole": ".chatstreamingmessagechunk",
|
|
1472
1563
|
"ChatStreamingMessageChunkTypedDict": ".chatstreamingmessagechunk",
|
|
@@ -1710,17 +1801,34 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1710
1801
|
"OpenResponsesReasoningSummaryTextDoneEvent": ".openresponsesreasoningsummarytextdoneevent",
|
|
1711
1802
|
"OpenResponsesReasoningSummaryTextDoneEventType": ".openresponsesreasoningsummarytextdoneevent",
|
|
1712
1803
|
"OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent",
|
|
1713
|
-
"Engine": ".openresponsesrequest",
|
|
1714
1804
|
"IDFileParser": ".openresponsesrequest",
|
|
1715
1805
|
"IDModeration": ".openresponsesrequest",
|
|
1806
|
+
"IDResponseHealing": ".openresponsesrequest",
|
|
1716
1807
|
"IDWeb": ".openresponsesrequest",
|
|
1717
1808
|
"Ignore": ".openresponsesrequest",
|
|
1718
1809
|
"IgnoreTypedDict": ".openresponsesrequest",
|
|
1719
|
-
"MaxPrice": ".openresponsesrequest",
|
|
1720
|
-
"MaxPriceTypedDict": ".openresponsesrequest",
|
|
1721
1810
|
"Only": ".openresponsesrequest",
|
|
1722
1811
|
"OnlyTypedDict": ".openresponsesrequest",
|
|
1723
1812
|
"OpenResponsesRequest": ".openresponsesrequest",
|
|
1813
|
+
"OpenResponsesRequestEngine": ".openresponsesrequest",
|
|
1814
|
+
"OpenResponsesRequestMaxPrice": ".openresponsesrequest",
|
|
1815
|
+
"OpenResponsesRequestMaxPriceTypedDict": ".openresponsesrequest",
|
|
1816
|
+
"OpenResponsesRequestPdf": ".openresponsesrequest",
|
|
1817
|
+
"OpenResponsesRequestPdfEngine": ".openresponsesrequest",
|
|
1818
|
+
"OpenResponsesRequestPdfTypedDict": ".openresponsesrequest",
|
|
1819
|
+
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
|
|
1820
|
+
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
|
|
1821
|
+
"OpenResponsesRequestPluginModeration": ".openresponsesrequest",
|
|
1822
|
+
"OpenResponsesRequestPluginModerationTypedDict": ".openresponsesrequest",
|
|
1823
|
+
"OpenResponsesRequestPluginResponseHealing": ".openresponsesrequest",
|
|
1824
|
+
"OpenResponsesRequestPluginResponseHealingTypedDict": ".openresponsesrequest",
|
|
1825
|
+
"OpenResponsesRequestPluginUnion": ".openresponsesrequest",
|
|
1826
|
+
"OpenResponsesRequestPluginUnionTypedDict": ".openresponsesrequest",
|
|
1827
|
+
"OpenResponsesRequestPluginWeb": ".openresponsesrequest",
|
|
1828
|
+
"OpenResponsesRequestPluginWebTypedDict": ".openresponsesrequest",
|
|
1829
|
+
"OpenResponsesRequestProvider": ".openresponsesrequest",
|
|
1830
|
+
"OpenResponsesRequestProviderTypedDict": ".openresponsesrequest",
|
|
1831
|
+
"OpenResponsesRequestRoute": ".openresponsesrequest",
|
|
1724
1832
|
"OpenResponsesRequestToolFunction": ".openresponsesrequest",
|
|
1725
1833
|
"OpenResponsesRequestToolFunctionTypedDict": ".openresponsesrequest",
|
|
1726
1834
|
"OpenResponsesRequestToolUnion": ".openresponsesrequest",
|
|
@@ -1729,19 +1837,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1729
1837
|
"OpenResponsesRequestTypedDict": ".openresponsesrequest",
|
|
1730
1838
|
"Order": ".openresponsesrequest",
|
|
1731
1839
|
"OrderTypedDict": ".openresponsesrequest",
|
|
1732
|
-
"Pdf": ".openresponsesrequest",
|
|
1733
|
-
"PdfEngine": ".openresponsesrequest",
|
|
1734
|
-
"PdfTypedDict": ".openresponsesrequest",
|
|
1735
|
-
"Plugin": ".openresponsesrequest",
|
|
1736
|
-
"PluginFileParser": ".openresponsesrequest",
|
|
1737
|
-
"PluginFileParserTypedDict": ".openresponsesrequest",
|
|
1738
|
-
"PluginModeration": ".openresponsesrequest",
|
|
1739
|
-
"PluginModerationTypedDict": ".openresponsesrequest",
|
|
1740
|
-
"PluginTypedDict": ".openresponsesrequest",
|
|
1741
|
-
"PluginWeb": ".openresponsesrequest",
|
|
1742
|
-
"PluginWebTypedDict": ".openresponsesrequest",
|
|
1743
|
-
"Provider": ".openresponsesrequest",
|
|
1744
|
-
"ProviderTypedDict": ".openresponsesrequest",
|
|
1745
1840
|
"ServiceTier": ".openresponsesrequest",
|
|
1746
1841
|
"Truncation": ".openresponsesrequest",
|
|
1747
1842
|
"OpenResponsesResponseText": ".openresponsesresponsetext",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from openrouter.types import UnrecognizedStr
|
|
5
|
+
from openrouter.utils import validate_open_enum
|
|
6
|
+
from pydantic.functional_validators import PlainValidator
|
|
7
|
+
from typing import Literal, Union
|
|
8
|
+
from typing_extensions import Annotated, TypeAliasType
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Schema0Enum = Union[
|
|
12
|
+
Literal[
|
|
13
|
+
"AI21",
|
|
14
|
+
"AionLabs",
|
|
15
|
+
"Alibaba",
|
|
16
|
+
"Amazon Bedrock",
|
|
17
|
+
"Amazon Nova",
|
|
18
|
+
"Anthropic",
|
|
19
|
+
"Arcee AI",
|
|
20
|
+
"AtlasCloud",
|
|
21
|
+
"Avian",
|
|
22
|
+
"Azure",
|
|
23
|
+
"BaseTen",
|
|
24
|
+
"BytePlus",
|
|
25
|
+
"Black Forest Labs",
|
|
26
|
+
"Cerebras",
|
|
27
|
+
"Chutes",
|
|
28
|
+
"Cirrascale",
|
|
29
|
+
"Clarifai",
|
|
30
|
+
"Cloudflare",
|
|
31
|
+
"Cohere",
|
|
32
|
+
"Crusoe",
|
|
33
|
+
"DeepInfra",
|
|
34
|
+
"DeepSeek",
|
|
35
|
+
"Featherless",
|
|
36
|
+
"Fireworks",
|
|
37
|
+
"Friendli",
|
|
38
|
+
"GMICloud",
|
|
39
|
+
"GoPomelo",
|
|
40
|
+
"Google",
|
|
41
|
+
"Google AI Studio",
|
|
42
|
+
"Groq",
|
|
43
|
+
"Hyperbolic",
|
|
44
|
+
"Inception",
|
|
45
|
+
"InferenceNet",
|
|
46
|
+
"Infermatic",
|
|
47
|
+
"Inflection",
|
|
48
|
+
"Liquid",
|
|
49
|
+
"Mara",
|
|
50
|
+
"Mancer 2",
|
|
51
|
+
"Minimax",
|
|
52
|
+
"ModelRun",
|
|
53
|
+
"Mistral",
|
|
54
|
+
"Modular",
|
|
55
|
+
"Moonshot AI",
|
|
56
|
+
"Morph",
|
|
57
|
+
"NCompass",
|
|
58
|
+
"Nebius",
|
|
59
|
+
"NextBit",
|
|
60
|
+
"Novita",
|
|
61
|
+
"Nvidia",
|
|
62
|
+
"OpenAI",
|
|
63
|
+
"OpenInference",
|
|
64
|
+
"Parasail",
|
|
65
|
+
"Perplexity",
|
|
66
|
+
"Phala",
|
|
67
|
+
"Relace",
|
|
68
|
+
"SambaNova",
|
|
69
|
+
"SiliconFlow",
|
|
70
|
+
"Sourceful",
|
|
71
|
+
"Stealth",
|
|
72
|
+
"StreamLake",
|
|
73
|
+
"Switchpoint",
|
|
74
|
+
"Targon",
|
|
75
|
+
"Together",
|
|
76
|
+
"Venice",
|
|
77
|
+
"WandB",
|
|
78
|
+
"Xiaomi",
|
|
79
|
+
"xAI",
|
|
80
|
+
"Z.AI",
|
|
81
|
+
"FakeProvider",
|
|
82
|
+
],
|
|
83
|
+
UnrecognizedStr,
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
Schema0TypedDict = TypeAliasType("Schema0TypedDict", Union[Schema0Enum, str])
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
Schema0 = TypeAliasType(
|
|
91
|
+
"Schema0",
|
|
92
|
+
Union[Annotated[Schema0Enum, PlainValidator(validate_open_enum(False))], str],
|
|
93
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from openrouter.types import UnrecognizedStr
|
|
5
|
+
from typing import Literal, Union
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
ChatCompletionFinishReason = Union[
|
|
9
|
+
Literal[
|
|
10
|
+
"tool_calls",
|
|
11
|
+
"stop",
|
|
12
|
+
"length",
|
|
13
|
+
"content_filter",
|
|
14
|
+
"error",
|
|
15
|
+
],
|
|
16
|
+
UnrecognizedStr,
|
|
17
|
+
]
|