openrouter 0.1.2__py3-none-any.whl → 0.6.0__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/analytics.py +28 -2
- openrouter/api_keys.py +210 -14
- openrouter/chat.py +192 -200
- openrouter/components/__init__.py +229 -285
- openrouter/components/_schema10.py +39 -0
- openrouter/components/_schema14.py +11 -0
- openrouter/components/_schema17.py +154 -0
- openrouter/components/{_schema3.py → _schema19.py} +28 -22
- openrouter/components/{_schema0.py → _schema5.py} +7 -5
- openrouter/components/assistantmessage.py +32 -1
- openrouter/components/chatgenerationparams.py +57 -343
- openrouter/components/chatmessagecontentitemimage.py +4 -4
- openrouter/components/chatresponsechoice.py +1 -6
- openrouter/components/chatstreamingmessagechunk.py +3 -3
- openrouter/components/developermessage.py +41 -0
- openrouter/components/message.py +6 -39
- openrouter/components/model.py +7 -1
- openrouter/components/openresponsesrequest.py +31 -39
- openrouter/components/outputmodality.py +1 -0
- openrouter/components/providername.py +2 -0
- openrouter/components/providerpreferences.py +2 -10
- openrouter/components/publicendpoint.py +8 -24
- openrouter/components/publicpricing.py +3 -24
- openrouter/credits.py +86 -14
- openrouter/embeddings.py +92 -20
- openrouter/endpoints.py +62 -2
- openrouter/generations.py +26 -0
- openrouter/guardrails.py +3367 -0
- openrouter/models_.py +120 -12
- openrouter/oauth.py +90 -22
- openrouter/operations/__init__.py +601 -30
- openrouter/operations/bulkassignkeystoguardrail.py +116 -0
- openrouter/operations/bulkassignmemberstoguardrail.py +116 -0
- openrouter/operations/bulkunassignkeysfromguardrail.py +116 -0
- openrouter/operations/bulkunassignmembersfromguardrail.py +116 -0
- openrouter/operations/createauthkeyscode.py +81 -3
- openrouter/operations/createcoinbasecharge.py +82 -2
- openrouter/operations/createembeddings.py +82 -3
- openrouter/operations/createguardrail.py +325 -0
- openrouter/operations/createkeys.py +81 -3
- openrouter/operations/createresponses.py +84 -3
- openrouter/operations/deleteguardrail.py +104 -0
- openrouter/operations/deletekeys.py +69 -3
- openrouter/operations/exchangeauthcodeforapikey.py +81 -3
- openrouter/operations/getcredits.py +70 -1
- openrouter/operations/getcurrentkey.py +81 -3
- openrouter/operations/getgeneration.py +248 -3
- openrouter/operations/getguardrail.py +228 -0
- openrouter/operations/getkey.py +64 -1
- openrouter/operations/getmodels.py +95 -5
- openrouter/operations/getuseractivity.py +62 -1
- openrouter/operations/list.py +63 -1
- openrouter/operations/listembeddingsmodels.py +74 -0
- openrouter/operations/listendpoints.py +65 -2
- openrouter/operations/listendpointszdr.py +70 -2
- openrouter/operations/listguardrailkeyassignments.py +192 -0
- openrouter/operations/listguardrailmemberassignments.py +187 -0
- openrouter/operations/listguardrails.py +238 -0
- openrouter/operations/listkeyassignments.py +180 -0
- openrouter/operations/listmemberassignments.py +175 -0
- openrouter/operations/listmodelscount.py +74 -0
- openrouter/operations/listmodelsuser.py +70 -2
- openrouter/operations/listproviders.py +70 -2
- openrouter/operations/sendchatcompletionrequest.py +87 -3
- openrouter/operations/updateguardrail.py +334 -0
- openrouter/operations/updatekeys.py +63 -0
- openrouter/providers.py +36 -2
- openrouter/responses.py +178 -148
- openrouter/sdk.py +5 -8
- openrouter/types/models.py +378 -0
- {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/METADATA +5 -1
- {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/RECORD +76 -63
- {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/WHEEL +1 -1
- openrouter/completions.py +0 -361
- openrouter/components/completionchoice.py +0 -82
- openrouter/components/completioncreateparams.py +0 -277
- openrouter/components/completionlogprobs.py +0 -54
- openrouter/components/completionresponse.py +0 -46
- openrouter/components/completionusage.py +0 -19
- openrouter/operations/getparameters.py +0 -123
- openrouter/parameters.py +0 -237
- {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/licenses/LICENSE +0 -0
- {openrouter-0.1.2.dist-info → openrouter-0.6.0.dist-info}/top_level.txt +0 -0
openrouter/generations.py
CHANGED
|
@@ -16,6 +16,8 @@ class Generations(BaseSDK):
|
|
|
16
16
|
self,
|
|
17
17
|
*,
|
|
18
18
|
id: str,
|
|
19
|
+
http_referer: Optional[str] = None,
|
|
20
|
+
x_title: Optional[str] = None,
|
|
19
21
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
20
22
|
server_url: Optional[str] = None,
|
|
21
23
|
timeout_ms: Optional[int] = None,
|
|
@@ -24,6 +26,11 @@ class Generations(BaseSDK):
|
|
|
24
26
|
r"""Get request & usage metadata for a generation
|
|
25
27
|
|
|
26
28
|
:param id:
|
|
29
|
+
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
30
|
+
This is used to track API usage per application.
|
|
31
|
+
|
|
32
|
+
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
33
|
+
|
|
27
34
|
:param retries: Override the default retry configuration for this method
|
|
28
35
|
:param server_url: Override the default server URL for this method
|
|
29
36
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -40,6 +47,8 @@ class Generations(BaseSDK):
|
|
|
40
47
|
base_url = self._get_url(base_url, url_variables)
|
|
41
48
|
|
|
42
49
|
request = operations.GetGenerationRequest(
|
|
50
|
+
http_referer=http_referer,
|
|
51
|
+
x_title=x_title,
|
|
43
52
|
id=id,
|
|
44
53
|
)
|
|
45
54
|
|
|
@@ -55,6 +64,10 @@ class Generations(BaseSDK):
|
|
|
55
64
|
user_agent_header="user-agent",
|
|
56
65
|
accept_header_value="application/json",
|
|
57
66
|
http_headers=http_headers,
|
|
67
|
+
_globals=operations.GetGenerationGlobals(
|
|
68
|
+
http_referer=self.sdk_configuration.globals.http_referer,
|
|
69
|
+
x_title=self.sdk_configuration.globals.x_title,
|
|
70
|
+
),
|
|
58
71
|
security=self.sdk_configuration.security,
|
|
59
72
|
allow_empty_value=None,
|
|
60
73
|
timeout_ms=timeout_ms,
|
|
@@ -154,6 +167,8 @@ class Generations(BaseSDK):
|
|
|
154
167
|
self,
|
|
155
168
|
*,
|
|
156
169
|
id: str,
|
|
170
|
+
http_referer: Optional[str] = None,
|
|
171
|
+
x_title: Optional[str] = None,
|
|
157
172
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
158
173
|
server_url: Optional[str] = None,
|
|
159
174
|
timeout_ms: Optional[int] = None,
|
|
@@ -162,6 +177,11 @@ class Generations(BaseSDK):
|
|
|
162
177
|
r"""Get request & usage metadata for a generation
|
|
163
178
|
|
|
164
179
|
:param id:
|
|
180
|
+
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
181
|
+
This is used to track API usage per application.
|
|
182
|
+
|
|
183
|
+
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
184
|
+
|
|
165
185
|
:param retries: Override the default retry configuration for this method
|
|
166
186
|
:param server_url: Override the default server URL for this method
|
|
167
187
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -178,6 +198,8 @@ class Generations(BaseSDK):
|
|
|
178
198
|
base_url = self._get_url(base_url, url_variables)
|
|
179
199
|
|
|
180
200
|
request = operations.GetGenerationRequest(
|
|
201
|
+
http_referer=http_referer,
|
|
202
|
+
x_title=x_title,
|
|
181
203
|
id=id,
|
|
182
204
|
)
|
|
183
205
|
|
|
@@ -193,6 +215,10 @@ class Generations(BaseSDK):
|
|
|
193
215
|
user_agent_header="user-agent",
|
|
194
216
|
accept_header_value="application/json",
|
|
195
217
|
http_headers=http_headers,
|
|
218
|
+
_globals=operations.GetGenerationGlobals(
|
|
219
|
+
http_referer=self.sdk_configuration.globals.http_referer,
|
|
220
|
+
x_title=self.sdk_configuration.globals.x_title,
|
|
221
|
+
),
|
|
196
222
|
security=self.sdk_configuration.security,
|
|
197
223
|
allow_empty_value=None,
|
|
198
224
|
timeout_ms=timeout_ms,
|