openrouter 0.0.22__py3-none-any.whl → 0.1.2__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 +2 -2
- openrouter/chat.py +70 -12
- openrouter/components/__init__.py +328 -81
- openrouter/components/_schema0.py +3 -2
- openrouter/components/_schema3.py +229 -0
- openrouter/components/chatgenerationparams.py +211 -53
- openrouter/components/chatgenerationtokenusage.py +3 -0
- openrouter/components/chatmessagetokenlogprob.py +4 -4
- openrouter/components/chatresponsechoice.py +6 -1
- openrouter/components/chatstreamingmessagechunk.py +12 -1
- openrouter/components/openresponseseasyinputmessage.py +93 -20
- openrouter/components/openresponsesinput.py +2 -2
- openrouter/components/openresponsesinputmessageitem.py +87 -14
- openrouter/components/openresponsesnonstreamingresponse.py +20 -9
- openrouter/components/openresponsesreasoning.py +1 -0
- openrouter/components/openresponsesrequest.py +141 -88
- openrouter/components/parameter.py +1 -0
- openrouter/components/pdfparserengine.py +16 -0
- openrouter/components/pdfparseroptions.py +25 -0
- openrouter/components/percentilelatencycutoffs.py +71 -0
- openrouter/components/percentilestats.py +34 -0
- openrouter/components/percentilethroughputcutoffs.py +71 -0
- openrouter/components/preferredmaxlatency.py +21 -0
- openrouter/components/preferredminthroughput.py +22 -0
- openrouter/components/providername.py +3 -2
- openrouter/components/providerpreferences.py +355 -0
- openrouter/components/providersort.py +0 -1
- openrouter/components/providersortconfig.py +71 -0
- openrouter/components/providersortunion.py +23 -0
- openrouter/components/publicendpoint.py +11 -0
- openrouter/components/responseinputvideo.py +26 -0
- openrouter/components/responseoutputtext.py +36 -1
- openrouter/components/responsesoutputitem.py +1 -1
- openrouter/components/responsesoutputitemreasoning.py +43 -3
- openrouter/components/responsesoutputmodality.py +14 -0
- openrouter/components/websearchengine.py +15 -0
- openrouter/embeddings.py +6 -8
- openrouter/operations/__init__.py +0 -33
- openrouter/operations/createembeddings.py +7 -258
- openrouter/operations/getgeneration.py +6 -0
- openrouter/operations/getparameters.py +5 -78
- openrouter/parameters.py +2 -2
- openrouter/responses.py +114 -14
- {openrouter-0.0.22.dist-info → openrouter-0.1.2.dist-info}/METADATA +1 -1
- {openrouter-0.0.22.dist-info → openrouter-0.1.2.dist-info}/RECORD +48 -34
- {openrouter-0.0.22.dist-info → openrouter-0.1.2.dist-info}/WHEEL +1 -1
- {openrouter-0.0.22.dist-info → openrouter-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {openrouter-0.0.22.dist-info → openrouter-0.1.2.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
+
from openrouter.components import providername as components_providername
|
|
4
5
|
from openrouter.types import BaseModel, UnrecognizedStr
|
|
5
6
|
from openrouter.utils import (
|
|
6
7
|
FieldMetadata,
|
|
@@ -32,86 +33,10 @@ class GetParametersSecurity(BaseModel):
|
|
|
32
33
|
]
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
GetParametersProvider = Union[
|
|
36
|
-
Literal[
|
|
37
|
-
"AI21",
|
|
38
|
-
"AionLabs",
|
|
39
|
-
"Alibaba",
|
|
40
|
-
"Amazon Bedrock",
|
|
41
|
-
"Amazon Nova",
|
|
42
|
-
"Anthropic",
|
|
43
|
-
"Arcee AI",
|
|
44
|
-
"AtlasCloud",
|
|
45
|
-
"Avian",
|
|
46
|
-
"Azure",
|
|
47
|
-
"BaseTen",
|
|
48
|
-
"BytePlus",
|
|
49
|
-
"Black Forest Labs",
|
|
50
|
-
"Cerebras",
|
|
51
|
-
"Chutes",
|
|
52
|
-
"Cirrascale",
|
|
53
|
-
"Clarifai",
|
|
54
|
-
"Cloudflare",
|
|
55
|
-
"Cohere",
|
|
56
|
-
"Crusoe",
|
|
57
|
-
"DeepInfra",
|
|
58
|
-
"DeepSeek",
|
|
59
|
-
"Featherless",
|
|
60
|
-
"Fireworks",
|
|
61
|
-
"Friendli",
|
|
62
|
-
"GMICloud",
|
|
63
|
-
"GoPomelo",
|
|
64
|
-
"Google",
|
|
65
|
-
"Google AI Studio",
|
|
66
|
-
"Groq",
|
|
67
|
-
"Hyperbolic",
|
|
68
|
-
"Inception",
|
|
69
|
-
"InferenceNet",
|
|
70
|
-
"Infermatic",
|
|
71
|
-
"Inflection",
|
|
72
|
-
"Liquid",
|
|
73
|
-
"Mara",
|
|
74
|
-
"Mancer 2",
|
|
75
|
-
"Minimax",
|
|
76
|
-
"ModelRun",
|
|
77
|
-
"Mistral",
|
|
78
|
-
"Modular",
|
|
79
|
-
"Moonshot AI",
|
|
80
|
-
"Morph",
|
|
81
|
-
"NCompass",
|
|
82
|
-
"Nebius",
|
|
83
|
-
"NextBit",
|
|
84
|
-
"Novita",
|
|
85
|
-
"Nvidia",
|
|
86
|
-
"OpenAI",
|
|
87
|
-
"OpenInference",
|
|
88
|
-
"Parasail",
|
|
89
|
-
"Perplexity",
|
|
90
|
-
"Phala",
|
|
91
|
-
"Relace",
|
|
92
|
-
"SambaNova",
|
|
93
|
-
"SiliconFlow",
|
|
94
|
-
"Sourceful",
|
|
95
|
-
"Stealth",
|
|
96
|
-
"StreamLake",
|
|
97
|
-
"Switchpoint",
|
|
98
|
-
"Targon",
|
|
99
|
-
"Together",
|
|
100
|
-
"Venice",
|
|
101
|
-
"WandB",
|
|
102
|
-
"Xiaomi",
|
|
103
|
-
"xAI",
|
|
104
|
-
"Z.AI",
|
|
105
|
-
"FakeProvider",
|
|
106
|
-
],
|
|
107
|
-
UnrecognizedStr,
|
|
108
|
-
]
|
|
109
|
-
|
|
110
|
-
|
|
111
36
|
class GetParametersRequestTypedDict(TypedDict):
|
|
112
37
|
author: str
|
|
113
38
|
slug: str
|
|
114
|
-
provider: NotRequired[
|
|
39
|
+
provider: NotRequired[components_providername.ProviderName]
|
|
115
40
|
|
|
116
41
|
|
|
117
42
|
class GetParametersRequest(BaseModel):
|
|
@@ -125,7 +50,8 @@ class GetParametersRequest(BaseModel):
|
|
|
125
50
|
|
|
126
51
|
provider: Annotated[
|
|
127
52
|
Annotated[
|
|
128
|
-
Optional[
|
|
53
|
+
Optional[components_providername.ProviderName],
|
|
54
|
+
PlainValidator(validate_open_enum(False)),
|
|
129
55
|
],
|
|
130
56
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
131
57
|
] = None
|
|
@@ -154,6 +80,7 @@ SupportedParameter = Union[
|
|
|
154
80
|
"parallel_tool_calls",
|
|
155
81
|
"include_reasoning",
|
|
156
82
|
"reasoning",
|
|
83
|
+
"reasoning_effort",
|
|
157
84
|
"web_search_options",
|
|
158
85
|
"verbosity",
|
|
159
86
|
],
|
openrouter/parameters.py
CHANGED
|
@@ -20,7 +20,7 @@ class Parameters(BaseSDK):
|
|
|
20
20
|
],
|
|
21
21
|
author: str,
|
|
22
22
|
slug: str,
|
|
23
|
-
provider: Optional[
|
|
23
|
+
provider: Optional[components.ProviderName] = None,
|
|
24
24
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
25
25
|
server_url: Optional[str] = None,
|
|
26
26
|
timeout_ms: Optional[int] = None,
|
|
@@ -132,7 +132,7 @@ class Parameters(BaseSDK):
|
|
|
132
132
|
],
|
|
133
133
|
author: str,
|
|
134
134
|
slug: str,
|
|
135
|
-
provider: Optional[
|
|
135
|
+
provider: Optional[components.ProviderName] = None,
|
|
136
136
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
137
137
|
server_url: Optional[str] = None,
|
|
138
138
|
timeout_ms: Optional[int] = None,
|
openrouter/responses.py
CHANGED
|
@@ -57,7 +57,18 @@ class Responses(BaseSDK):
|
|
|
57
57
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
|
58
58
|
temperature: OptionalNullable[float] = UNSET,
|
|
59
59
|
top_p: OptionalNullable[float] = UNSET,
|
|
60
|
+
top_logprobs: OptionalNullable[int] = UNSET,
|
|
61
|
+
max_tool_calls: OptionalNullable[int] = UNSET,
|
|
62
|
+
presence_penalty: OptionalNullable[float] = UNSET,
|
|
63
|
+
frequency_penalty: OptionalNullable[float] = UNSET,
|
|
60
64
|
top_k: Optional[float] = None,
|
|
65
|
+
image_config: Optional[
|
|
66
|
+
Union[
|
|
67
|
+
Dict[str, components.OpenResponsesRequestImageConfig],
|
|
68
|
+
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
|
|
69
|
+
]
|
|
70
|
+
] = None,
|
|
71
|
+
modalities: Optional[List[components.ResponsesOutputModality]] = None,
|
|
61
72
|
prompt_cache_key: OptionalNullable[str] = UNSET,
|
|
62
73
|
previous_response_id: OptionalNullable[str] = UNSET,
|
|
63
74
|
prompt: OptionalNullable[
|
|
@@ -84,7 +95,6 @@ class Responses(BaseSDK):
|
|
|
84
95
|
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
|
85
96
|
]
|
|
86
97
|
] = None,
|
|
87
|
-
route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET,
|
|
88
98
|
user: Optional[str] = None,
|
|
89
99
|
session_id: Optional[str] = None,
|
|
90
100
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -109,7 +119,13 @@ class Responses(BaseSDK):
|
|
|
109
119
|
:param max_output_tokens:
|
|
110
120
|
:param temperature:
|
|
111
121
|
:param top_p:
|
|
122
|
+
:param top_logprobs:
|
|
123
|
+
:param max_tool_calls:
|
|
124
|
+
:param presence_penalty:
|
|
125
|
+
:param frequency_penalty:
|
|
112
126
|
:param top_k:
|
|
127
|
+
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
|
128
|
+
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
|
113
129
|
:param prompt_cache_key:
|
|
114
130
|
:param previous_response_id:
|
|
115
131
|
:param prompt:
|
|
@@ -121,7 +137,6 @@ class Responses(BaseSDK):
|
|
|
121
137
|
:param stream:
|
|
122
138
|
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
|
123
139
|
:param plugins: Plugins you want to enable for this request, including their settings.
|
|
124
|
-
:param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.
|
|
125
140
|
:param user: 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.
|
|
126
141
|
:param session_id: 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.
|
|
127
142
|
:param retries: Override the default retry configuration for this method
|
|
@@ -170,7 +185,18 @@ class Responses(BaseSDK):
|
|
|
170
185
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
|
171
186
|
temperature: OptionalNullable[float] = UNSET,
|
|
172
187
|
top_p: OptionalNullable[float] = UNSET,
|
|
188
|
+
top_logprobs: OptionalNullable[int] = UNSET,
|
|
189
|
+
max_tool_calls: OptionalNullable[int] = UNSET,
|
|
190
|
+
presence_penalty: OptionalNullable[float] = UNSET,
|
|
191
|
+
frequency_penalty: OptionalNullable[float] = UNSET,
|
|
173
192
|
top_k: Optional[float] = None,
|
|
193
|
+
image_config: Optional[
|
|
194
|
+
Union[
|
|
195
|
+
Dict[str, components.OpenResponsesRequestImageConfig],
|
|
196
|
+
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
|
|
197
|
+
]
|
|
198
|
+
] = None,
|
|
199
|
+
modalities: Optional[List[components.ResponsesOutputModality]] = None,
|
|
174
200
|
prompt_cache_key: OptionalNullable[str] = UNSET,
|
|
175
201
|
previous_response_id: OptionalNullable[str] = UNSET,
|
|
176
202
|
prompt: OptionalNullable[
|
|
@@ -197,7 +223,6 @@ class Responses(BaseSDK):
|
|
|
197
223
|
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
|
198
224
|
]
|
|
199
225
|
] = None,
|
|
200
|
-
route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET,
|
|
201
226
|
user: Optional[str] = None,
|
|
202
227
|
session_id: Optional[str] = None,
|
|
203
228
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -222,7 +247,13 @@ class Responses(BaseSDK):
|
|
|
222
247
|
:param max_output_tokens:
|
|
223
248
|
:param temperature:
|
|
224
249
|
:param top_p:
|
|
250
|
+
:param top_logprobs:
|
|
251
|
+
:param max_tool_calls:
|
|
252
|
+
:param presence_penalty:
|
|
253
|
+
:param frequency_penalty:
|
|
225
254
|
:param top_k:
|
|
255
|
+
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
|
256
|
+
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
|
226
257
|
:param prompt_cache_key:
|
|
227
258
|
:param previous_response_id:
|
|
228
259
|
:param prompt:
|
|
@@ -234,7 +265,6 @@ class Responses(BaseSDK):
|
|
|
234
265
|
:param stream:
|
|
235
266
|
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
|
236
267
|
:param plugins: Plugins you want to enable for this request, including their settings.
|
|
237
|
-
:param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.
|
|
238
268
|
:param user: 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.
|
|
239
269
|
:param session_id: 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.
|
|
240
270
|
:param retries: Override the default retry configuration for this method
|
|
@@ -282,7 +312,18 @@ class Responses(BaseSDK):
|
|
|
282
312
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
|
283
313
|
temperature: OptionalNullable[float] = UNSET,
|
|
284
314
|
top_p: OptionalNullable[float] = UNSET,
|
|
315
|
+
top_logprobs: OptionalNullable[int] = UNSET,
|
|
316
|
+
max_tool_calls: OptionalNullable[int] = UNSET,
|
|
317
|
+
presence_penalty: OptionalNullable[float] = UNSET,
|
|
318
|
+
frequency_penalty: OptionalNullable[float] = UNSET,
|
|
285
319
|
top_k: Optional[float] = None,
|
|
320
|
+
image_config: Optional[
|
|
321
|
+
Union[
|
|
322
|
+
Dict[str, components.OpenResponsesRequestImageConfig],
|
|
323
|
+
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
|
|
324
|
+
]
|
|
325
|
+
] = None,
|
|
326
|
+
modalities: Optional[List[components.ResponsesOutputModality]] = None,
|
|
286
327
|
prompt_cache_key: OptionalNullable[str] = UNSET,
|
|
287
328
|
previous_response_id: OptionalNullable[str] = UNSET,
|
|
288
329
|
prompt: OptionalNullable[
|
|
@@ -309,7 +350,6 @@ class Responses(BaseSDK):
|
|
|
309
350
|
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
|
310
351
|
]
|
|
311
352
|
] = None,
|
|
312
|
-
route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET,
|
|
313
353
|
user: Optional[str] = None,
|
|
314
354
|
session_id: Optional[str] = None,
|
|
315
355
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -334,7 +374,13 @@ class Responses(BaseSDK):
|
|
|
334
374
|
:param max_output_tokens:
|
|
335
375
|
:param temperature:
|
|
336
376
|
:param top_p:
|
|
377
|
+
:param top_logprobs:
|
|
378
|
+
:param max_tool_calls:
|
|
379
|
+
:param presence_penalty:
|
|
380
|
+
:param frequency_penalty:
|
|
337
381
|
:param top_k:
|
|
382
|
+
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
|
383
|
+
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
|
338
384
|
:param prompt_cache_key:
|
|
339
385
|
:param previous_response_id:
|
|
340
386
|
:param prompt:
|
|
@@ -346,7 +392,6 @@ class Responses(BaseSDK):
|
|
|
346
392
|
:param stream:
|
|
347
393
|
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
|
348
394
|
:param plugins: Plugins you want to enable for this request, including their settings.
|
|
349
|
-
:param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.
|
|
350
395
|
:param user: 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.
|
|
351
396
|
:param session_id: 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.
|
|
352
397
|
:param retries: Override the default retry configuration for this method
|
|
@@ -389,7 +434,13 @@ class Responses(BaseSDK):
|
|
|
389
434
|
max_output_tokens=max_output_tokens,
|
|
390
435
|
temperature=temperature,
|
|
391
436
|
top_p=top_p,
|
|
437
|
+
top_logprobs=top_logprobs,
|
|
438
|
+
max_tool_calls=max_tool_calls,
|
|
439
|
+
presence_penalty=presence_penalty,
|
|
440
|
+
frequency_penalty=frequency_penalty,
|
|
392
441
|
top_k=top_k,
|
|
442
|
+
image_config=image_config,
|
|
443
|
+
modalities=modalities,
|
|
393
444
|
prompt_cache_key=prompt_cache_key,
|
|
394
445
|
previous_response_id=previous_response_id,
|
|
395
446
|
prompt=utils.get_pydantic_model(
|
|
@@ -407,7 +458,6 @@ class Responses(BaseSDK):
|
|
|
407
458
|
plugins=utils.get_pydantic_model(
|
|
408
459
|
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
|
|
409
460
|
),
|
|
410
|
-
route=route,
|
|
411
461
|
user=user,
|
|
412
462
|
session_id=session_id,
|
|
413
463
|
)
|
|
@@ -640,7 +690,18 @@ class Responses(BaseSDK):
|
|
|
640
690
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
|
641
691
|
temperature: OptionalNullable[float] = UNSET,
|
|
642
692
|
top_p: OptionalNullable[float] = UNSET,
|
|
693
|
+
top_logprobs: OptionalNullable[int] = UNSET,
|
|
694
|
+
max_tool_calls: OptionalNullable[int] = UNSET,
|
|
695
|
+
presence_penalty: OptionalNullable[float] = UNSET,
|
|
696
|
+
frequency_penalty: OptionalNullable[float] = UNSET,
|
|
643
697
|
top_k: Optional[float] = None,
|
|
698
|
+
image_config: Optional[
|
|
699
|
+
Union[
|
|
700
|
+
Dict[str, components.OpenResponsesRequestImageConfig],
|
|
701
|
+
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
|
|
702
|
+
]
|
|
703
|
+
] = None,
|
|
704
|
+
modalities: Optional[List[components.ResponsesOutputModality]] = None,
|
|
644
705
|
prompt_cache_key: OptionalNullable[str] = UNSET,
|
|
645
706
|
previous_response_id: OptionalNullable[str] = UNSET,
|
|
646
707
|
prompt: OptionalNullable[
|
|
@@ -667,7 +728,6 @@ class Responses(BaseSDK):
|
|
|
667
728
|
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
|
668
729
|
]
|
|
669
730
|
] = None,
|
|
670
|
-
route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET,
|
|
671
731
|
user: Optional[str] = None,
|
|
672
732
|
session_id: Optional[str] = None,
|
|
673
733
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -692,7 +752,13 @@ class Responses(BaseSDK):
|
|
|
692
752
|
:param max_output_tokens:
|
|
693
753
|
:param temperature:
|
|
694
754
|
:param top_p:
|
|
755
|
+
:param top_logprobs:
|
|
756
|
+
:param max_tool_calls:
|
|
757
|
+
:param presence_penalty:
|
|
758
|
+
:param frequency_penalty:
|
|
695
759
|
:param top_k:
|
|
760
|
+
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
|
761
|
+
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
|
696
762
|
:param prompt_cache_key:
|
|
697
763
|
:param previous_response_id:
|
|
698
764
|
:param prompt:
|
|
@@ -704,7 +770,6 @@ class Responses(BaseSDK):
|
|
|
704
770
|
:param stream:
|
|
705
771
|
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
|
706
772
|
:param plugins: Plugins you want to enable for this request, including their settings.
|
|
707
|
-
:param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.
|
|
708
773
|
:param user: 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.
|
|
709
774
|
:param session_id: 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.
|
|
710
775
|
:param retries: Override the default retry configuration for this method
|
|
@@ -753,7 +818,18 @@ class Responses(BaseSDK):
|
|
|
753
818
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
|
754
819
|
temperature: OptionalNullable[float] = UNSET,
|
|
755
820
|
top_p: OptionalNullable[float] = UNSET,
|
|
821
|
+
top_logprobs: OptionalNullable[int] = UNSET,
|
|
822
|
+
max_tool_calls: OptionalNullable[int] = UNSET,
|
|
823
|
+
presence_penalty: OptionalNullable[float] = UNSET,
|
|
824
|
+
frequency_penalty: OptionalNullable[float] = UNSET,
|
|
756
825
|
top_k: Optional[float] = None,
|
|
826
|
+
image_config: Optional[
|
|
827
|
+
Union[
|
|
828
|
+
Dict[str, components.OpenResponsesRequestImageConfig],
|
|
829
|
+
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
|
|
830
|
+
]
|
|
831
|
+
] = None,
|
|
832
|
+
modalities: Optional[List[components.ResponsesOutputModality]] = None,
|
|
757
833
|
prompt_cache_key: OptionalNullable[str] = UNSET,
|
|
758
834
|
previous_response_id: OptionalNullable[str] = UNSET,
|
|
759
835
|
prompt: OptionalNullable[
|
|
@@ -780,7 +856,6 @@ class Responses(BaseSDK):
|
|
|
780
856
|
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
|
781
857
|
]
|
|
782
858
|
] = None,
|
|
783
|
-
route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET,
|
|
784
859
|
user: Optional[str] = None,
|
|
785
860
|
session_id: Optional[str] = None,
|
|
786
861
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -805,7 +880,13 @@ class Responses(BaseSDK):
|
|
|
805
880
|
:param max_output_tokens:
|
|
806
881
|
:param temperature:
|
|
807
882
|
:param top_p:
|
|
883
|
+
:param top_logprobs:
|
|
884
|
+
:param max_tool_calls:
|
|
885
|
+
:param presence_penalty:
|
|
886
|
+
:param frequency_penalty:
|
|
808
887
|
:param top_k:
|
|
888
|
+
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
|
889
|
+
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
|
809
890
|
:param prompt_cache_key:
|
|
810
891
|
:param previous_response_id:
|
|
811
892
|
:param prompt:
|
|
@@ -817,7 +898,6 @@ class Responses(BaseSDK):
|
|
|
817
898
|
:param stream:
|
|
818
899
|
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
|
819
900
|
:param plugins: Plugins you want to enable for this request, including their settings.
|
|
820
|
-
:param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.
|
|
821
901
|
:param user: 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.
|
|
822
902
|
:param session_id: 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.
|
|
823
903
|
:param retries: Override the default retry configuration for this method
|
|
@@ -865,7 +945,18 @@ class Responses(BaseSDK):
|
|
|
865
945
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
|
866
946
|
temperature: OptionalNullable[float] = UNSET,
|
|
867
947
|
top_p: OptionalNullable[float] = UNSET,
|
|
948
|
+
top_logprobs: OptionalNullable[int] = UNSET,
|
|
949
|
+
max_tool_calls: OptionalNullable[int] = UNSET,
|
|
950
|
+
presence_penalty: OptionalNullable[float] = UNSET,
|
|
951
|
+
frequency_penalty: OptionalNullable[float] = UNSET,
|
|
868
952
|
top_k: Optional[float] = None,
|
|
953
|
+
image_config: Optional[
|
|
954
|
+
Union[
|
|
955
|
+
Dict[str, components.OpenResponsesRequestImageConfig],
|
|
956
|
+
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
|
|
957
|
+
]
|
|
958
|
+
] = None,
|
|
959
|
+
modalities: Optional[List[components.ResponsesOutputModality]] = None,
|
|
869
960
|
prompt_cache_key: OptionalNullable[str] = UNSET,
|
|
870
961
|
previous_response_id: OptionalNullable[str] = UNSET,
|
|
871
962
|
prompt: OptionalNullable[
|
|
@@ -892,7 +983,6 @@ class Responses(BaseSDK):
|
|
|
892
983
|
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
|
893
984
|
]
|
|
894
985
|
] = None,
|
|
895
|
-
route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET,
|
|
896
986
|
user: Optional[str] = None,
|
|
897
987
|
session_id: Optional[str] = None,
|
|
898
988
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -917,7 +1007,13 @@ class Responses(BaseSDK):
|
|
|
917
1007
|
:param max_output_tokens:
|
|
918
1008
|
:param temperature:
|
|
919
1009
|
:param top_p:
|
|
1010
|
+
:param top_logprobs:
|
|
1011
|
+
:param max_tool_calls:
|
|
1012
|
+
:param presence_penalty:
|
|
1013
|
+
:param frequency_penalty:
|
|
920
1014
|
:param top_k:
|
|
1015
|
+
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
|
1016
|
+
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
|
921
1017
|
:param prompt_cache_key:
|
|
922
1018
|
:param previous_response_id:
|
|
923
1019
|
:param prompt:
|
|
@@ -929,7 +1025,6 @@ class Responses(BaseSDK):
|
|
|
929
1025
|
:param stream:
|
|
930
1026
|
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
|
931
1027
|
:param plugins: Plugins you want to enable for this request, including their settings.
|
|
932
|
-
:param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.
|
|
933
1028
|
:param user: 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.
|
|
934
1029
|
:param session_id: 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.
|
|
935
1030
|
:param retries: Override the default retry configuration for this method
|
|
@@ -972,7 +1067,13 @@ class Responses(BaseSDK):
|
|
|
972
1067
|
max_output_tokens=max_output_tokens,
|
|
973
1068
|
temperature=temperature,
|
|
974
1069
|
top_p=top_p,
|
|
1070
|
+
top_logprobs=top_logprobs,
|
|
1071
|
+
max_tool_calls=max_tool_calls,
|
|
1072
|
+
presence_penalty=presence_penalty,
|
|
1073
|
+
frequency_penalty=frequency_penalty,
|
|
975
1074
|
top_k=top_k,
|
|
1075
|
+
image_config=image_config,
|
|
1076
|
+
modalities=modalities,
|
|
976
1077
|
prompt_cache_key=prompt_cache_key,
|
|
977
1078
|
previous_response_id=previous_response_id,
|
|
978
1079
|
prompt=utils.get_pydantic_model(
|
|
@@ -990,7 +1091,6 @@ class Responses(BaseSDK):
|
|
|
990
1091
|
plugins=utils.get_pydantic_model(
|
|
991
1092
|
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
|
|
992
1093
|
),
|
|
993
|
-
route=route,
|
|
994
1094
|
user=user,
|
|
995
1095
|
session_id=session_id,
|
|
996
1096
|
)
|