mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +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:
@@ -3,10 +3,10 @@
|
||||
import importlib.metadata
|
||||
|
||||
__title__: str = "openrouter"
|
||||
__version__: str = "0.1.3"
|
||||
__version__: str = "0.6.0"
|
||||
__openapi_doc_version__: str = "1.0.0"
|
||||
__gen_version__: str = "2.768.0"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.1.3 2.768.0 1.0.0 openrouter"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.6.0 2.768.0 1.0.0 openrouter"
|
||||
|
||||
try:
|
||||
if __package__ is not None:
|
||||
|
||||
@@ -15,6 +15,8 @@ class Analytics(BaseSDK):
|
||||
def get_user_activity(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
date_: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
@@ -23,7 +25,12 @@ class Analytics(BaseSDK):
|
||||
) -> operations.GetUserActivityResponse:
|
||||
r"""Get user activity grouped by endpoint
|
||||
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -42,6 +49,8 @@ class Analytics(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetUserActivityRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
date_=date_,
|
||||
)
|
||||
|
||||
@@ -57,6 +66,10 @@ class Analytics(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetUserActivityGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -124,6 +137,8 @@ class Analytics(BaseSDK):
|
||||
async def get_user_activity_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
date_: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
@@ -132,7 +147,12 @@ class Analytics(BaseSDK):
|
||||
) -> operations.GetUserActivityResponse:
|
||||
r"""Get user activity grouped by endpoint
|
||||
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -151,6 +171,8 @@ class Analytics(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetUserActivityRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
date_=date_,
|
||||
)
|
||||
|
||||
@@ -166,6 +188,10 @@ class Analytics(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetUserActivityGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
+200
-24
@@ -16,6 +16,8 @@ class APIKeys(BaseSDK):
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
include_disabled: Optional[str] = None,
|
||||
offset: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
@@ -25,7 +27,12 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.ListResponse:
|
||||
r"""List API keys
|
||||
|
||||
List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param include_disabled: Whether to include disabled API keys in the response
|
||||
:param offset: Number of API keys to skip for pagination
|
||||
@@ -45,6 +52,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
include_disabled=include_disabled,
|
||||
offset=offset,
|
||||
)
|
||||
@@ -61,6 +70,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -123,6 +136,8 @@ class APIKeys(BaseSDK):
|
||||
async def list_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
include_disabled: Optional[str] = None,
|
||||
offset: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
@@ -132,7 +147,12 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.ListResponse:
|
||||
r"""List API keys
|
||||
|
||||
List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param include_disabled: Whether to include disabled API keys in the response
|
||||
:param offset: Number of API keys to skip for pagination
|
||||
@@ -152,6 +172,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
include_disabled=include_disabled,
|
||||
offset=offset,
|
||||
)
|
||||
@@ -168,6 +190,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -231,6 +257,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET,
|
||||
include_byok_in_limit: Optional[bool] = None,
|
||||
@@ -242,9 +270,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.CreateKeysResponse:
|
||||
r"""Create a new API key
|
||||
|
||||
Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param name: Name for the new API key
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param limit: Optional spending limit for the API key in USD
|
||||
:param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
||||
:param include_byok_in_limit: Whether to include BYOK usage in the limit
|
||||
@@ -265,11 +298,15 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateKeysRequest(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateKeysRequestBody(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -284,9 +321,17 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateKeysRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateKeysRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -355,6 +400,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET,
|
||||
include_byok_in_limit: Optional[bool] = None,
|
||||
@@ -366,9 +413,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.CreateKeysResponse:
|
||||
r"""Create a new API key
|
||||
|
||||
Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param name: Name for the new API key
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param limit: Optional spending limit for the API key in USD
|
||||
:param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
||||
:param include_byok_in_limit: Whether to include BYOK usage in the limit
|
||||
@@ -389,11 +441,15 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateKeysRequest(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateKeysRequestBody(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -408,9 +464,17 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateKeysRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateKeysRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -479,6 +543,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
name: Optional[str] = None,
|
||||
disabled: Optional[bool] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
@@ -491,9 +557,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.UpdateKeysResponse:
|
||||
r"""Update an API key
|
||||
|
||||
Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to update
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param name: New name for the API key
|
||||
:param disabled: Whether to disable the API key
|
||||
:param limit: New spending limit for the API key in USD
|
||||
@@ -515,6 +586,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.UpdateKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
request_body=operations.UpdateKeysRequestBody(
|
||||
name=name,
|
||||
@@ -537,6 +610,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.UpdateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
@@ -617,6 +694,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
name: Optional[str] = None,
|
||||
disabled: Optional[bool] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
@@ -629,9 +708,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.UpdateKeysResponse:
|
||||
r"""Update an API key
|
||||
|
||||
Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to update
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param name: New name for the API key
|
||||
:param disabled: Whether to disable the API key
|
||||
:param limit: New spending limit for the API key in USD
|
||||
@@ -653,6 +737,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.UpdateKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
request_body=operations.UpdateKeysRequestBody(
|
||||
name=name,
|
||||
@@ -675,6 +761,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.UpdateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
@@ -755,6 +845,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -762,9 +854,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.DeleteKeysResponse:
|
||||
r"""Delete an API key
|
||||
|
||||
Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to delete
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -781,6 +878,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.DeleteKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -796,6 +895,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.DeleteKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -864,6 +967,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -871,9 +976,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.DeleteKeysResponse:
|
||||
r"""Delete an API key
|
||||
|
||||
Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to delete
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -890,6 +1000,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.DeleteKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -905,6 +1017,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.DeleteKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -973,6 +1089,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -980,9 +1098,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.GetKeyResponse:
|
||||
r"""Get a single API key
|
||||
|
||||
Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to retrieve
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -999,6 +1122,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -1014,6 +1139,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -1082,6 +1211,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -1089,9 +1220,14 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.GetKeyResponse:
|
||||
r"""Get a single API key
|
||||
|
||||
Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to retrieve
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -1108,6 +1244,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -1123,6 +1261,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -1190,6 +1332,8 @@ class APIKeys(BaseSDK):
|
||||
def get_current_key_metadata(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -1199,6 +1343,11 @@ class APIKeys(BaseSDK):
|
||||
|
||||
Get information on the API key associated with the current authentication session
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -1213,18 +1362,28 @@ class APIKeys(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetCurrentKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/key",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetCurrentKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -1282,6 +1441,8 @@ class APIKeys(BaseSDK):
|
||||
async def get_current_key_metadata_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -1291,6 +1452,11 @@ class APIKeys(BaseSDK):
|
||||
|
||||
Get information on the API key associated with the current authentication session
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -1305,18 +1471,28 @@ class APIKeys(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetCurrentKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/key",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetCurrentKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
+192
-200
@@ -21,17 +21,13 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsProvider,
|
||||
components.ChatGenerationParamsProviderTypedDict,
|
||||
]
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.ChatGenerationParamsPluginUnion],
|
||||
List[components.ChatGenerationParamsPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Schema17], List[components.Schema17TypedDict]]
|
||||
] = None,
|
||||
route: OptionalNullable[components.Route] = UNSET,
|
||||
user: Optional[str] = None,
|
||||
@@ -50,17 +46,11 @@ class Chat(BaseSDK):
|
||||
Union[components.Reasoning, components.ReasoningTypedDict]
|
||||
] = None,
|
||||
response_format: Optional[
|
||||
Union[
|
||||
components.ChatGenerationParamsResponseFormatUnion,
|
||||
components.ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
|
||||
] = None,
|
||||
seed: OptionalNullable[int] = UNSET,
|
||||
stop: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsStop,
|
||||
components.ChatGenerationParamsStopTypedDict,
|
||||
]
|
||||
Union[components.Stop, components.StopTypedDict]
|
||||
] = UNSET,
|
||||
stream: Union[Literal[False], None] = None,
|
||||
stream_options: OptionalNullable[
|
||||
@@ -93,11 +83,16 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
||||
:param plugins: Plugins you want to enable for this request, including their settings.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
:param user:
|
||||
: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.
|
||||
:param session_id:
|
||||
:param model:
|
||||
:param models:
|
||||
:param frequency_penalty:
|
||||
@@ -133,17 +128,13 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsProvider,
|
||||
components.ChatGenerationParamsProviderTypedDict,
|
||||
]
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.ChatGenerationParamsPluginUnion],
|
||||
List[components.ChatGenerationParamsPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Schema17], List[components.Schema17TypedDict]]
|
||||
] = None,
|
||||
route: OptionalNullable[components.Route] = UNSET,
|
||||
user: Optional[str] = None,
|
||||
@@ -162,17 +153,11 @@ class Chat(BaseSDK):
|
||||
Union[components.Reasoning, components.ReasoningTypedDict]
|
||||
] = None,
|
||||
response_format: Optional[
|
||||
Union[
|
||||
components.ChatGenerationParamsResponseFormatUnion,
|
||||
components.ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
|
||||
] = None,
|
||||
seed: OptionalNullable[int] = UNSET,
|
||||
stop: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsStop,
|
||||
components.ChatGenerationParamsStopTypedDict,
|
||||
]
|
||||
Union[components.Stop, components.StopTypedDict]
|
||||
] = UNSET,
|
||||
stream: Literal[True],
|
||||
stream_options: OptionalNullable[
|
||||
@@ -205,11 +190,16 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
||||
:param plugins: Plugins you want to enable for this request, including their settings.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
:param user:
|
||||
: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.
|
||||
:param session_id:
|
||||
:param model:
|
||||
:param models:
|
||||
:param frequency_penalty:
|
||||
@@ -244,17 +234,13 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsProvider,
|
||||
components.ChatGenerationParamsProviderTypedDict,
|
||||
]
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.ChatGenerationParamsPluginUnion],
|
||||
List[components.ChatGenerationParamsPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Schema17], List[components.Schema17TypedDict]]
|
||||
] = None,
|
||||
route: OptionalNullable[components.Route] = UNSET,
|
||||
user: Optional[str] = None,
|
||||
@@ -273,17 +259,11 @@ class Chat(BaseSDK):
|
||||
Union[components.Reasoning, components.ReasoningTypedDict]
|
||||
] = None,
|
||||
response_format: Optional[
|
||||
Union[
|
||||
components.ChatGenerationParamsResponseFormatUnion,
|
||||
components.ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
|
||||
] = None,
|
||||
seed: OptionalNullable[int] = UNSET,
|
||||
stop: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsStop,
|
||||
components.ChatGenerationParamsStopTypedDict,
|
||||
]
|
||||
Union[components.Stop, components.StopTypedDict]
|
||||
] = UNSET,
|
||||
stream: Optional[bool] = False,
|
||||
stream_options: OptionalNullable[
|
||||
@@ -316,11 +296,16 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
||||
:param plugins: Plugins you want to enable for this request, including their settings.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
:param user:
|
||||
: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.
|
||||
:param session_id:
|
||||
:param model:
|
||||
:param models:
|
||||
:param frequency_penalty:
|
||||
@@ -360,49 +345,52 @@ class Chat(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.ChatGenerationParamsProvider]
|
||||
request = operations.SendChatCompletionRequestRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
chat_generation_params=components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Schema0]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Schema17]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format, Optional[components.ResponseFormat]
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.ChatGenerationParamsPluginUnion]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format,
|
||||
Optional[components.ChatGenerationParamsResponseFormatUnion],
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -417,9 +405,17 @@ class Chat(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="text/event-stream" if stream else "application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.SendChatCompletionRequestGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.ChatGenerationParams
|
||||
request.chat_generation_params,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.ChatGenerationParams,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -497,17 +493,13 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsProvider,
|
||||
components.ChatGenerationParamsProviderTypedDict,
|
||||
]
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.ChatGenerationParamsPluginUnion],
|
||||
List[components.ChatGenerationParamsPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Schema17], List[components.Schema17TypedDict]]
|
||||
] = None,
|
||||
route: OptionalNullable[components.Route] = UNSET,
|
||||
user: Optional[str] = None,
|
||||
@@ -526,17 +518,11 @@ class Chat(BaseSDK):
|
||||
Union[components.Reasoning, components.ReasoningTypedDict]
|
||||
] = None,
|
||||
response_format: Optional[
|
||||
Union[
|
||||
components.ChatGenerationParamsResponseFormatUnion,
|
||||
components.ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
|
||||
] = None,
|
||||
seed: OptionalNullable[int] = UNSET,
|
||||
stop: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsStop,
|
||||
components.ChatGenerationParamsStopTypedDict,
|
||||
]
|
||||
Union[components.Stop, components.StopTypedDict]
|
||||
] = UNSET,
|
||||
stream: Union[Literal[False], None] = None,
|
||||
stream_options: OptionalNullable[
|
||||
@@ -569,11 +555,16 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
||||
:param plugins: Plugins you want to enable for this request, including their settings.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
:param user:
|
||||
: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.
|
||||
:param session_id:
|
||||
:param model:
|
||||
:param models:
|
||||
:param frequency_penalty:
|
||||
@@ -609,17 +600,13 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsProvider,
|
||||
components.ChatGenerationParamsProviderTypedDict,
|
||||
]
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.ChatGenerationParamsPluginUnion],
|
||||
List[components.ChatGenerationParamsPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Schema17], List[components.Schema17TypedDict]]
|
||||
] = None,
|
||||
route: OptionalNullable[components.Route] = UNSET,
|
||||
user: Optional[str] = None,
|
||||
@@ -638,17 +625,11 @@ class Chat(BaseSDK):
|
||||
Union[components.Reasoning, components.ReasoningTypedDict]
|
||||
] = None,
|
||||
response_format: Optional[
|
||||
Union[
|
||||
components.ChatGenerationParamsResponseFormatUnion,
|
||||
components.ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
|
||||
] = None,
|
||||
seed: OptionalNullable[int] = UNSET,
|
||||
stop: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsStop,
|
||||
components.ChatGenerationParamsStopTypedDict,
|
||||
]
|
||||
Union[components.Stop, components.StopTypedDict]
|
||||
] = UNSET,
|
||||
stream: Literal[True],
|
||||
stream_options: OptionalNullable[
|
||||
@@ -681,11 +662,16 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
||||
:param plugins: Plugins you want to enable for this request, including their settings.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
:param user:
|
||||
: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.
|
||||
:param session_id:
|
||||
:param model:
|
||||
:param models:
|
||||
:param frequency_penalty:
|
||||
@@ -720,17 +706,13 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsProvider,
|
||||
components.ChatGenerationParamsProviderTypedDict,
|
||||
]
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.ChatGenerationParamsPluginUnion],
|
||||
List[components.ChatGenerationParamsPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Schema17], List[components.Schema17TypedDict]]
|
||||
] = None,
|
||||
route: OptionalNullable[components.Route] = UNSET,
|
||||
user: Optional[str] = None,
|
||||
@@ -749,17 +731,11 @@ class Chat(BaseSDK):
|
||||
Union[components.Reasoning, components.ReasoningTypedDict]
|
||||
] = None,
|
||||
response_format: Optional[
|
||||
Union[
|
||||
components.ChatGenerationParamsResponseFormatUnion,
|
||||
components.ChatGenerationParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
Union[components.ResponseFormat, components.ResponseFormatTypedDict]
|
||||
] = None,
|
||||
seed: OptionalNullable[int] = UNSET,
|
||||
stop: OptionalNullable[
|
||||
Union[
|
||||
components.ChatGenerationParamsStop,
|
||||
components.ChatGenerationParamsStopTypedDict,
|
||||
]
|
||||
Union[components.Stop, components.StopTypedDict]
|
||||
] = UNSET,
|
||||
stream: Optional[bool] = False,
|
||||
stream_options: OptionalNullable[
|
||||
@@ -792,11 +768,16 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param provider: When multiple model providers are available, optionally indicate your routing preference.
|
||||
:param plugins: Plugins you want to enable for this request, including their settings.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
:param user:
|
||||
: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.
|
||||
:param session_id:
|
||||
:param model:
|
||||
:param models:
|
||||
:param frequency_penalty:
|
||||
@@ -836,49 +817,52 @@ class Chat(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.ChatGenerationParamsProvider]
|
||||
request = operations.SendChatCompletionRequestRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
chat_generation_params=components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Schema0]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Schema17]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format, Optional[components.ResponseFormat]
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.ChatGenerationParamsPluginUnion]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format,
|
||||
Optional[components.ChatGenerationParamsResponseFormatUnion],
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -893,9 +877,17 @@ class Chat(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="text/event-stream" if stream else "application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.SendChatCompletionRequestGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.ChatGenerationParams
|
||||
request.chat_generation_params,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.ChatGenerationParams,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
@@ -1,361 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from .basesdk import BaseSDK
|
||||
from openrouter import components, errors, utils
|
||||
from openrouter._hooks import HookContext
|
||||
from openrouter.types import OptionalNullable, UNSET
|
||||
from openrouter.utils import get_security_from_env
|
||||
from openrouter.utils.unmarshal_json_response import unmarshal_json_response
|
||||
from typing import Any, Dict, List, Mapping, Optional, Union
|
||||
|
||||
|
||||
class Completions(BaseSDK):
|
||||
def generate(
|
||||
self,
|
||||
*,
|
||||
prompt: Union[components.Prompt, components.PromptTypedDict],
|
||||
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[
|
||||
Union[
|
||||
components.CompletionCreateParamsStop,
|
||||
components.CompletionCreateParamsStopTypedDict,
|
||||
]
|
||||
] = UNSET,
|
||||
stream: Optional[bool] = False,
|
||||
stream_options: OptionalNullable[
|
||||
Union[components.StreamOptions, components.StreamOptionsTypedDict]
|
||||
] = 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[
|
||||
Union[
|
||||
components.CompletionCreateParamsResponseFormatUnion,
|
||||
components.CompletionCreateParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
] = UNSET,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> components.CompletionResponse:
|
||||
r"""Create a completion
|
||||
|
||||
Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param prompt:
|
||||
:param model:
|
||||
:param models:
|
||||
:param best_of:
|
||||
:param echo:
|
||||
:param frequency_penalty:
|
||||
:param logit_bias:
|
||||
:param logprobs:
|
||||
:param max_tokens:
|
||||
:param n:
|
||||
:param presence_penalty:
|
||||
:param seed:
|
||||
:param stop:
|
||||
:param stream:
|
||||
:param stream_options:
|
||||
:param suffix:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param user:
|
||||
:param metadata:
|
||||
:param response_format:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.CompletionCreateParams(
|
||||
model=model,
|
||||
models=models,
|
||||
prompt=prompt,
|
||||
best_of=best_of,
|
||||
echo=echo,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
max_tokens=max_tokens,
|
||||
n=n,
|
||||
presence_penalty=presence_penalty,
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.StreamOptions]
|
||||
),
|
||||
suffix=suffix,
|
||||
temperature=temperature,
|
||||
top_p=top_p,
|
||||
user=user,
|
||||
metadata=metadata,
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format,
|
||||
OptionalNullable[components.CompletionCreateParamsResponseFormatUnion],
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="POST",
|
||||
path="/completions",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=True,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.CompletionCreateParams
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = self.do_request(
|
||||
hook_ctx=HookContext(
|
||||
config=self.sdk_configuration,
|
||||
base_url=base_url or "",
|
||||
operation_id="createCompletions",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(components.CompletionResponse, http_res)
|
||||
if utils.match_response(http_res, ["400", "401", "429"], "application/json"):
|
||||
response_data = unmarshal_json_response(errors.ChatErrorData, http_res)
|
||||
raise errors.ChatError(response_data, http_res)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(errors.ChatErrorData, http_res)
|
||||
raise errors.ChatError(response_data, http_res)
|
||||
if utils.match_response(http_res, "4XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
|
||||
raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
|
||||
|
||||
async def generate_async(
|
||||
self,
|
||||
*,
|
||||
prompt: Union[components.Prompt, components.PromptTypedDict],
|
||||
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[
|
||||
Union[
|
||||
components.CompletionCreateParamsStop,
|
||||
components.CompletionCreateParamsStopTypedDict,
|
||||
]
|
||||
] = UNSET,
|
||||
stream: Optional[bool] = False,
|
||||
stream_options: OptionalNullable[
|
||||
Union[components.StreamOptions, components.StreamOptionsTypedDict]
|
||||
] = 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[
|
||||
Union[
|
||||
components.CompletionCreateParamsResponseFormatUnion,
|
||||
components.CompletionCreateParamsResponseFormatUnionTypedDict,
|
||||
]
|
||||
] = UNSET,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> components.CompletionResponse:
|
||||
r"""Create a completion
|
||||
|
||||
Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param prompt:
|
||||
:param model:
|
||||
:param models:
|
||||
:param best_of:
|
||||
:param echo:
|
||||
:param frequency_penalty:
|
||||
:param logit_bias:
|
||||
:param logprobs:
|
||||
:param max_tokens:
|
||||
:param n:
|
||||
:param presence_penalty:
|
||||
:param seed:
|
||||
:param stop:
|
||||
:param stream:
|
||||
:param stream_options:
|
||||
:param suffix:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param user:
|
||||
:param metadata:
|
||||
:param response_format:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.CompletionCreateParams(
|
||||
model=model,
|
||||
models=models,
|
||||
prompt=prompt,
|
||||
best_of=best_of,
|
||||
echo=echo,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
max_tokens=max_tokens,
|
||||
n=n,
|
||||
presence_penalty=presence_penalty,
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.StreamOptions]
|
||||
),
|
||||
suffix=suffix,
|
||||
temperature=temperature,
|
||||
top_p=top_p,
|
||||
user=user,
|
||||
metadata=metadata,
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format,
|
||||
OptionalNullable[components.CompletionCreateParamsResponseFormatUnion],
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="POST",
|
||||
path="/completions",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=True,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.CompletionCreateParams
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = await self.do_request_async(
|
||||
hook_ctx=HookContext(
|
||||
config=self.sdk_configuration,
|
||||
base_url=base_url or "",
|
||||
operation_id="createCompletions",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(components.CompletionResponse, http_res)
|
||||
if utils.match_response(http_res, ["400", "401", "429"], "application/json"):
|
||||
response_data = unmarshal_json_response(errors.ChatErrorData, http_res)
|
||||
raise errors.ChatError(response_data, http_res)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(errors.ChatErrorData, http_res)
|
||||
raise errors.ChatError(response_data, http_res)
|
||||
if utils.match_response(http_res, "4XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
|
||||
raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
|
||||
@@ -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
|
||||
|
||||
+86
-14
@@ -15,6 +15,8 @@ class Credits(BaseSDK):
|
||||
def get_credits(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -22,7 +24,12 @@ class Credits(BaseSDK):
|
||||
) -> operations.GetCreditsResponse:
|
||||
r"""Get remaining credits
|
||||
|
||||
Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -38,18 +45,28 @@ class Credits(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetCreditsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/credits",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetCreditsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -112,6 +129,8 @@ class Credits(BaseSDK):
|
||||
async def get_credits_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -119,7 +138,12 @@ class Credits(BaseSDK):
|
||||
) -> operations.GetCreditsResponse:
|
||||
r"""Get remaining credits
|
||||
|
||||
Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -135,18 +159,28 @@ class Credits(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetCreditsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/credits",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetCreditsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -216,6 +250,8 @@ class Credits(BaseSDK):
|
||||
amount: float,
|
||||
sender: str,
|
||||
chain_id: components.ChainID,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -229,6 +265,11 @@ class Credits(BaseSDK):
|
||||
:param amount:
|
||||
:param sender:
|
||||
:param chain_id:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -244,10 +285,14 @@ class Credits(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.CreateChargeRequest(
|
||||
amount=amount,
|
||||
sender=sender,
|
||||
chain_id=chain_id,
|
||||
request = operations.CreateCoinbaseChargeRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
create_charge_request=components.CreateChargeRequest(
|
||||
amount=amount,
|
||||
sender=sender,
|
||||
chain_id=chain_id,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -262,11 +307,19 @@ class Credits(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateCoinbaseChargeGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=utils.get_pydantic_model(
|
||||
security, operations.CreateCoinbaseChargeSecurity
|
||||
),
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.CreateChargeRequest
|
||||
request.create_charge_request,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.CreateChargeRequest,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -341,6 +394,8 @@ class Credits(BaseSDK):
|
||||
amount: float,
|
||||
sender: str,
|
||||
chain_id: components.ChainID,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -354,6 +409,11 @@ class Credits(BaseSDK):
|
||||
:param amount:
|
||||
:param sender:
|
||||
:param chain_id:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -369,10 +429,14 @@ class Credits(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.CreateChargeRequest(
|
||||
amount=amount,
|
||||
sender=sender,
|
||||
chain_id=chain_id,
|
||||
request = operations.CreateCoinbaseChargeRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
create_charge_request=components.CreateChargeRequest(
|
||||
amount=amount,
|
||||
sender=sender,
|
||||
chain_id=chain_id,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -387,11 +451,19 @@ class Credits(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateCoinbaseChargeGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=utils.get_pydantic_model(
|
||||
security, operations.CreateCoinbaseChargeSecurity
|
||||
),
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.CreateChargeRequest
|
||||
request.create_charge_request,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.CreateChargeRequest,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
@@ -23,6 +23,8 @@ class Embeddings(BaseSDK):
|
||||
*,
|
||||
input: Union[operations.InputUnion, operations.InputUnionTypedDict],
|
||||
model: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
encoding_format: Optional[operations.EncodingFormat] = None,
|
||||
dimensions: Optional[int] = None,
|
||||
user: Optional[str] = None,
|
||||
@@ -44,6 +46,11 @@ class Embeddings(BaseSDK):
|
||||
|
||||
:param input:
|
||||
:param model:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param encoding_format:
|
||||
:param dimensions:
|
||||
:param user:
|
||||
@@ -66,15 +73,19 @@ class Embeddings(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateEmbeddingsRequest(
|
||||
input=utils.get_pydantic_model(input, operations.InputUnion),
|
||||
model=model,
|
||||
encoding_format=encoding_format,
|
||||
dimensions=dimensions,
|
||||
user=user,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, Optional[components.ProviderPreferences]
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateEmbeddingsRequestBody(
|
||||
input=utils.get_pydantic_model(input, operations.InputUnion),
|
||||
model=model,
|
||||
encoding_format=encoding_format,
|
||||
dimensions=dimensions,
|
||||
user=user,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, Optional[components.ProviderPreferences]
|
||||
),
|
||||
input_type=input_type,
|
||||
),
|
||||
input_type=input_type,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -91,9 +102,17 @@ class Embeddings(BaseSDK):
|
||||
if accept_header_override is not None
|
||||
else "application/json;q=1, text/event-stream;q=0",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateEmbeddingsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateEmbeddingsRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateEmbeddingsRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -210,6 +229,8 @@ class Embeddings(BaseSDK):
|
||||
*,
|
||||
input: Union[operations.InputUnion, operations.InputUnionTypedDict],
|
||||
model: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
encoding_format: Optional[operations.EncodingFormat] = None,
|
||||
dimensions: Optional[int] = None,
|
||||
user: Optional[str] = None,
|
||||
@@ -231,6 +252,11 @@ class Embeddings(BaseSDK):
|
||||
|
||||
:param input:
|
||||
:param model:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param encoding_format:
|
||||
:param dimensions:
|
||||
:param user:
|
||||
@@ -253,15 +279,19 @@ class Embeddings(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateEmbeddingsRequest(
|
||||
input=utils.get_pydantic_model(input, operations.InputUnion),
|
||||
model=model,
|
||||
encoding_format=encoding_format,
|
||||
dimensions=dimensions,
|
||||
user=user,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, Optional[components.ProviderPreferences]
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateEmbeddingsRequestBody(
|
||||
input=utils.get_pydantic_model(input, operations.InputUnion),
|
||||
model=model,
|
||||
encoding_format=encoding_format,
|
||||
dimensions=dimensions,
|
||||
user=user,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, Optional[components.ProviderPreferences]
|
||||
),
|
||||
input_type=input_type,
|
||||
),
|
||||
input_type=input_type,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -278,9 +308,17 @@ class Embeddings(BaseSDK):
|
||||
if accept_header_override is not None
|
||||
else "application/json;q=1, text/event-stream;q=0",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateEmbeddingsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateEmbeddingsRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateEmbeddingsRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -395,6 +433,8 @@ class Embeddings(BaseSDK):
|
||||
def list_models(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -404,6 +444,11 @@ class Embeddings(BaseSDK):
|
||||
|
||||
Returns a list of all available embeddings models and their properties
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -418,18 +463,28 @@ class Embeddings(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListEmbeddingsModelsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/embeddings/models",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListEmbeddingsModelsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -487,6 +542,8 @@ class Embeddings(BaseSDK):
|
||||
async def list_models_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -496,6 +553,11 @@ class Embeddings(BaseSDK):
|
||||
|
||||
Returns a list of all available embeddings models and their properties
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -510,18 +572,28 @@ class Embeddings(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListEmbeddingsModelsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/embeddings/models",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListEmbeddingsModelsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
@@ -17,6 +17,8 @@ class Endpoints(BaseSDK):
|
||||
*,
|
||||
author: str,
|
||||
slug: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -26,6 +28,11 @@ class Endpoints(BaseSDK):
|
||||
|
||||
:param author:
|
||||
:param slug:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -42,6 +49,8 @@ class Endpoints(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListEndpointsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
author=author,
|
||||
slug=slug,
|
||||
)
|
||||
@@ -58,6 +67,10 @@ class Endpoints(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListEndpointsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -117,6 +130,8 @@ class Endpoints(BaseSDK):
|
||||
*,
|
||||
author: str,
|
||||
slug: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -126,6 +141,11 @@ class Endpoints(BaseSDK):
|
||||
|
||||
:param author:
|
||||
:param slug:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -142,6 +162,8 @@ class Endpoints(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListEndpointsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
author=author,
|
||||
slug=slug,
|
||||
)
|
||||
@@ -158,6 +180,10 @@ class Endpoints(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListEndpointsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -215,6 +241,8 @@ class Endpoints(BaseSDK):
|
||||
def list_zdr_endpoints(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -222,6 +250,11 @@ class Endpoints(BaseSDK):
|
||||
) -> operations.ListEndpointsZdrResponse:
|
||||
r"""Preview the impact of ZDR on the available endpoints
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -236,18 +269,28 @@ class Endpoints(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListEndpointsZdrRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/endpoints/zdr",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListEndpointsZdrGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -302,6 +345,8 @@ class Endpoints(BaseSDK):
|
||||
async def list_zdr_endpoints_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -309,6 +354,11 @@ class Endpoints(BaseSDK):
|
||||
) -> operations.ListEndpointsZdrResponse:
|
||||
r"""Preview the impact of ZDR on the available endpoints
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -323,18 +373,28 @@ class Endpoints(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListEndpointsZdrRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/endpoints/zdr",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListEndpointsZdrGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
@@ -16,6 +16,8 @@ class Generations(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
id: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -24,6 +26,11 @@ class Generations(BaseSDK):
|
||||
r"""Get request & usage metadata for a generation
|
||||
|
||||
:param id:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -40,6 +47,8 @@ class Generations(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetGenerationRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
id=id,
|
||||
)
|
||||
|
||||
@@ -55,6 +64,10 @@ class Generations(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetGenerationGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -154,6 +167,8 @@ class Generations(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
id: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -162,6 +177,11 @@ class Generations(BaseSDK):
|
||||
r"""Get request & usage metadata for a generation
|
||||
|
||||
:param id:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -178,6 +198,8 @@ class Generations(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetGenerationRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
id=id,
|
||||
)
|
||||
|
||||
@@ -193,6 +215,10 @@ class Generations(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetGenerationGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
+392
-42
File diff suppressed because it is too large
Load Diff
+116
-8
@@ -15,6 +15,8 @@ class Models(BaseSDK):
|
||||
def count(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -22,6 +24,11 @@ class Models(BaseSDK):
|
||||
) -> components.ModelsCountResponse:
|
||||
r"""Get total count of available models
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -36,18 +43,28 @@ class Models(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListModelsCountRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/models/count",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListModelsCountGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -100,6 +117,8 @@ class Models(BaseSDK):
|
||||
async def count_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -107,6 +126,11 @@ class Models(BaseSDK):
|
||||
) -> components.ModelsCountResponse:
|
||||
r"""Get total count of available models
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -121,18 +145,28 @@ class Models(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListModelsCountRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/models/count",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListModelsCountGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -185,6 +219,8 @@ class Models(BaseSDK):
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
category: Optional[operations.Category] = None,
|
||||
supported_parameters: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
@@ -194,6 +230,11 @@ class Models(BaseSDK):
|
||||
) -> components.ModelsListResponse:
|
||||
r"""List all models and their properties
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param category: Filter models by use case category
|
||||
:param supported_parameters:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -212,6 +253,8 @@ class Models(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetModelsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
category=category,
|
||||
supported_parameters=supported_parameters,
|
||||
)
|
||||
@@ -228,6 +271,10 @@ class Models(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetModelsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -285,6 +332,8 @@ class Models(BaseSDK):
|
||||
async def list_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
category: Optional[operations.Category] = None,
|
||||
supported_parameters: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
@@ -294,6 +343,11 @@ class Models(BaseSDK):
|
||||
) -> components.ModelsListResponse:
|
||||
r"""List all models and their properties
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param category: Filter models by use case category
|
||||
:param supported_parameters:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -312,6 +366,8 @@ class Models(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetModelsRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
category=category,
|
||||
supported_parameters=supported_parameters,
|
||||
)
|
||||
@@ -328,6 +384,10 @@ class Models(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetModelsGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -389,14 +449,23 @@ class Models(BaseSDK):
|
||||
operations.ListModelsUserSecurity,
|
||||
operations.ListModelsUserSecurityTypedDict,
|
||||
],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> components.ModelsListResponse:
|
||||
r"""List models filtered by user provider preferences
|
||||
r"""List models filtered by user provider preferences, privacy settings, and guardrails
|
||||
|
||||
List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/logging#enterprise-eu-in-region-routing).
|
||||
|
||||
:param security:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -411,18 +480,28 @@ class Models(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListModelsUserRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/models/user",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListModelsUserGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=utils.get_pydantic_model(
|
||||
security, operations.ListModelsUserSecurity
|
||||
),
|
||||
@@ -447,7 +526,7 @@ class Models(BaseSDK):
|
||||
security_source=get_security_from_env(security, components.Security),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["401", "4XX", "500", "5XX"],
|
||||
error_status_codes=["401", "404", "4XX", "500", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
@@ -459,6 +538,11 @@ class Models(BaseSDK):
|
||||
errors.UnauthorizedResponseErrorData, http_res
|
||||
)
|
||||
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "404", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.NotFoundResponseErrorData, http_res
|
||||
)
|
||||
raise errors.NotFoundResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.InternalServerResponseErrorData, http_res
|
||||
@@ -484,14 +568,23 @@ class Models(BaseSDK):
|
||||
operations.ListModelsUserSecurity,
|
||||
operations.ListModelsUserSecurityTypedDict,
|
||||
],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> components.ModelsListResponse:
|
||||
r"""List models filtered by user provider preferences
|
||||
r"""List models filtered by user provider preferences, privacy settings, and guardrails
|
||||
|
||||
List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/logging#enterprise-eu-in-region-routing).
|
||||
|
||||
:param security:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -506,18 +599,28 @@ class Models(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListModelsUserRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/models/user",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListModelsUserGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=utils.get_pydantic_model(
|
||||
security, operations.ListModelsUserSecurity
|
||||
),
|
||||
@@ -542,7 +645,7 @@ class Models(BaseSDK):
|
||||
security_source=get_security_from_env(security, components.Security),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["401", "4XX", "500", "5XX"],
|
||||
error_status_codes=["401", "404", "4XX", "500", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
@@ -554,6 +657,11 @@ class Models(BaseSDK):
|
||||
errors.UnauthorizedResponseErrorData, http_res
|
||||
)
|
||||
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "404", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.NotFoundResponseErrorData, http_res
|
||||
)
|
||||
raise errors.NotFoundResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.InternalServerResponseErrorData, http_res
|
||||
|
||||
+90
-22
@@ -17,6 +17,8 @@ class OAuth(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
code: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
code_verifier: Optional[str] = None,
|
||||
code_challenge_method: OptionalNullable[
|
||||
operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod
|
||||
@@ -31,6 +33,11 @@ class OAuth(BaseSDK):
|
||||
Exchange an authorization code from the PKCE flow for a user-controlled API key
|
||||
|
||||
:param code: The authorization code received from the OAuth redirect
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param code_verifier: The code verifier if code_challenge was used in the authorization request
|
||||
:param code_challenge_method: The method used to generate the code challenge
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -49,9 +56,13 @@ class OAuth(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ExchangeAuthCodeForAPIKeyRequest(
|
||||
code=code,
|
||||
code_verifier=code_verifier,
|
||||
code_challenge_method=code_challenge_method,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.ExchangeAuthCodeForAPIKeyRequestBody(
|
||||
code=code,
|
||||
code_verifier=code_verifier,
|
||||
code_challenge_method=code_challenge_method,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -66,13 +77,17 @@ class OAuth(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ExchangeAuthCodeForAPIKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request,
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.ExchangeAuthCodeForAPIKeyRequest,
|
||||
operations.ExchangeAuthCodeForAPIKeyRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -138,6 +153,8 @@ class OAuth(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
code: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
code_verifier: Optional[str] = None,
|
||||
code_challenge_method: OptionalNullable[
|
||||
operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod
|
||||
@@ -152,6 +169,11 @@ class OAuth(BaseSDK):
|
||||
Exchange an authorization code from the PKCE flow for a user-controlled API key
|
||||
|
||||
:param code: The authorization code received from the OAuth redirect
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param code_verifier: The code verifier if code_challenge was used in the authorization request
|
||||
:param code_challenge_method: The method used to generate the code challenge
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -170,9 +192,13 @@ class OAuth(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ExchangeAuthCodeForAPIKeyRequest(
|
||||
code=code,
|
||||
code_verifier=code_verifier,
|
||||
code_challenge_method=code_challenge_method,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.ExchangeAuthCodeForAPIKeyRequestBody(
|
||||
code=code,
|
||||
code_verifier=code_verifier,
|
||||
code_challenge_method=code_challenge_method,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -187,13 +213,17 @@ class OAuth(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ExchangeAuthCodeForAPIKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request,
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.ExchangeAuthCodeForAPIKeyRequest,
|
||||
operations.ExchangeAuthCodeForAPIKeyRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -259,6 +289,8 @@ class OAuth(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
callback_url: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
code_challenge: Optional[str] = None,
|
||||
code_challenge_method: Optional[
|
||||
operations.CreateAuthKeysCodeCodeChallengeMethod
|
||||
@@ -275,6 +307,11 @@ class OAuth(BaseSDK):
|
||||
Create an authorization code for the PKCE flow to generate a user-controlled API key
|
||||
|
||||
:param callback_url: The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param code_challenge: PKCE code challenge for enhanced security
|
||||
:param code_challenge_method: The method used to generate the code challenge
|
||||
:param limit: Credit limit for the API key to be created
|
||||
@@ -295,11 +332,15 @@ class OAuth(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateAuthKeysCodeRequest(
|
||||
callback_url=callback_url,
|
||||
code_challenge=code_challenge,
|
||||
code_challenge_method=code_challenge_method,
|
||||
limit=limit,
|
||||
expires_at=expires_at,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateAuthKeysCodeRequestBody(
|
||||
callback_url=callback_url,
|
||||
code_challenge=code_challenge,
|
||||
code_challenge_method=code_challenge_method,
|
||||
limit=limit,
|
||||
expires_at=expires_at,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -314,9 +355,17 @@ class OAuth(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateAuthKeysCodeGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateAuthKeysCodeRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateAuthKeysCodeRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -382,6 +431,8 @@ class OAuth(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
callback_url: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
code_challenge: Optional[str] = None,
|
||||
code_challenge_method: Optional[
|
||||
operations.CreateAuthKeysCodeCodeChallengeMethod
|
||||
@@ -398,6 +449,11 @@ class OAuth(BaseSDK):
|
||||
Create an authorization code for the PKCE flow to generate a user-controlled API key
|
||||
|
||||
:param callback_url: The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed.
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param code_challenge: PKCE code challenge for enhanced security
|
||||
:param code_challenge_method: The method used to generate the code challenge
|
||||
:param limit: Credit limit for the API key to be created
|
||||
@@ -418,11 +474,15 @@ class OAuth(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateAuthKeysCodeRequest(
|
||||
callback_url=callback_url,
|
||||
code_challenge=code_challenge,
|
||||
code_challenge_method=code_challenge_method,
|
||||
limit=limit,
|
||||
expires_at=expires_at,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateAuthKeysCodeRequestBody(
|
||||
callback_url=callback_url,
|
||||
code_challenge=code_challenge,
|
||||
code_challenge_method=code_challenge_method,
|
||||
limit=limit,
|
||||
expires_at=expires_at,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -437,9 +497,17 @@ class OAuth(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateAuthKeysCodeGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateAuthKeysCodeRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateAuthKeysCodeRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
@@ -7,6 +7,8 @@ import sys
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .bulkassignkeystoguardrail import (
|
||||
BulkAssignKeysToGuardrailGlobals,
|
||||
BulkAssignKeysToGuardrailGlobalsTypedDict,
|
||||
BulkAssignKeysToGuardrailRequest,
|
||||
BulkAssignKeysToGuardrailRequestBody,
|
||||
BulkAssignKeysToGuardrailRequestBodyTypedDict,
|
||||
@@ -15,6 +17,8 @@ if TYPE_CHECKING:
|
||||
BulkAssignKeysToGuardrailResponseTypedDict,
|
||||
)
|
||||
from .bulkassignmemberstoguardrail import (
|
||||
BulkAssignMembersToGuardrailGlobals,
|
||||
BulkAssignMembersToGuardrailGlobalsTypedDict,
|
||||
BulkAssignMembersToGuardrailRequest,
|
||||
BulkAssignMembersToGuardrailRequestBody,
|
||||
BulkAssignMembersToGuardrailRequestBodyTypedDict,
|
||||
@@ -23,6 +27,8 @@ if TYPE_CHECKING:
|
||||
BulkAssignMembersToGuardrailResponseTypedDict,
|
||||
)
|
||||
from .bulkunassignkeysfromguardrail import (
|
||||
BulkUnassignKeysFromGuardrailGlobals,
|
||||
BulkUnassignKeysFromGuardrailGlobalsTypedDict,
|
||||
BulkUnassignKeysFromGuardrailRequest,
|
||||
BulkUnassignKeysFromGuardrailRequestBody,
|
||||
BulkUnassignKeysFromGuardrailRequestBodyTypedDict,
|
||||
@@ -31,6 +37,8 @@ if TYPE_CHECKING:
|
||||
BulkUnassignKeysFromGuardrailResponseTypedDict,
|
||||
)
|
||||
from .bulkunassignmembersfromguardrail import (
|
||||
BulkUnassignMembersFromGuardrailGlobals,
|
||||
BulkUnassignMembersFromGuardrailGlobalsTypedDict,
|
||||
BulkUnassignMembersFromGuardrailRequest,
|
||||
BulkUnassignMembersFromGuardrailRequestBody,
|
||||
BulkUnassignMembersFromGuardrailRequestBodyTypedDict,
|
||||
@@ -42,7 +50,11 @@ if TYPE_CHECKING:
|
||||
CreateAuthKeysCodeCodeChallengeMethod,
|
||||
CreateAuthKeysCodeData,
|
||||
CreateAuthKeysCodeDataTypedDict,
|
||||
CreateAuthKeysCodeGlobals,
|
||||
CreateAuthKeysCodeGlobalsTypedDict,
|
||||
CreateAuthKeysCodeRequest,
|
||||
CreateAuthKeysCodeRequestBody,
|
||||
CreateAuthKeysCodeRequestBodyTypedDict,
|
||||
CreateAuthKeysCodeRequestTypedDict,
|
||||
CreateAuthKeysCodeResponse,
|
||||
CreateAuthKeysCodeResponseTypedDict,
|
||||
@@ -52,6 +64,10 @@ if TYPE_CHECKING:
|
||||
CallDataTypedDict,
|
||||
CreateCoinbaseChargeData,
|
||||
CreateCoinbaseChargeDataTypedDict,
|
||||
CreateCoinbaseChargeGlobals,
|
||||
CreateCoinbaseChargeGlobalsTypedDict,
|
||||
CreateCoinbaseChargeRequest,
|
||||
CreateCoinbaseChargeRequestTypedDict,
|
||||
CreateCoinbaseChargeResponse,
|
||||
CreateCoinbaseChargeResponseTypedDict,
|
||||
CreateCoinbaseChargeSecurity,
|
||||
@@ -72,7 +88,11 @@ if TYPE_CHECKING:
|
||||
ContentTypedDict,
|
||||
CreateEmbeddingsData,
|
||||
CreateEmbeddingsDataTypedDict,
|
||||
CreateEmbeddingsGlobals,
|
||||
CreateEmbeddingsGlobalsTypedDict,
|
||||
CreateEmbeddingsRequest,
|
||||
CreateEmbeddingsRequestBody,
|
||||
CreateEmbeddingsRequestBodyTypedDict,
|
||||
CreateEmbeddingsRequestTypedDict,
|
||||
CreateEmbeddingsResponse,
|
||||
CreateEmbeddingsResponseBody,
|
||||
@@ -97,7 +117,11 @@ if TYPE_CHECKING:
|
||||
from .createguardrail import (
|
||||
CreateGuardrailData,
|
||||
CreateGuardrailDataTypedDict,
|
||||
CreateGuardrailGlobals,
|
||||
CreateGuardrailGlobalsTypedDict,
|
||||
CreateGuardrailRequest,
|
||||
CreateGuardrailRequestBody,
|
||||
CreateGuardrailRequestBodyTypedDict,
|
||||
CreateGuardrailRequestTypedDict,
|
||||
CreateGuardrailResetIntervalRequest,
|
||||
CreateGuardrailResetIntervalResponse,
|
||||
@@ -107,25 +131,37 @@ if TYPE_CHECKING:
|
||||
from .createkeys import (
|
||||
CreateKeysData,
|
||||
CreateKeysDataTypedDict,
|
||||
CreateKeysGlobals,
|
||||
CreateKeysGlobalsTypedDict,
|
||||
CreateKeysLimitReset,
|
||||
CreateKeysRequest,
|
||||
CreateKeysRequestBody,
|
||||
CreateKeysRequestBodyTypedDict,
|
||||
CreateKeysRequestTypedDict,
|
||||
CreateKeysResponse,
|
||||
CreateKeysResponseTypedDict,
|
||||
)
|
||||
from .createresponses import (
|
||||
CreateResponsesGlobals,
|
||||
CreateResponsesGlobalsTypedDict,
|
||||
CreateResponsesRequest,
|
||||
CreateResponsesRequestTypedDict,
|
||||
CreateResponsesResponse,
|
||||
CreateResponsesResponseBody,
|
||||
CreateResponsesResponseBodyTypedDict,
|
||||
CreateResponsesResponseTypedDict,
|
||||
)
|
||||
from .deleteguardrail import (
|
||||
DeleteGuardrailGlobals,
|
||||
DeleteGuardrailGlobalsTypedDict,
|
||||
DeleteGuardrailRequest,
|
||||
DeleteGuardrailRequestTypedDict,
|
||||
DeleteGuardrailResponse,
|
||||
DeleteGuardrailResponseTypedDict,
|
||||
)
|
||||
from .deletekeys import (
|
||||
DeleteKeysGlobals,
|
||||
DeleteKeysGlobalsTypedDict,
|
||||
DeleteKeysRequest,
|
||||
DeleteKeysRequestTypedDict,
|
||||
DeleteKeysResponse,
|
||||
@@ -133,7 +169,11 @@ if TYPE_CHECKING:
|
||||
)
|
||||
from .exchangeauthcodeforapikey import (
|
||||
ExchangeAuthCodeForAPIKeyCodeChallengeMethod,
|
||||
ExchangeAuthCodeForAPIKeyGlobals,
|
||||
ExchangeAuthCodeForAPIKeyGlobalsTypedDict,
|
||||
ExchangeAuthCodeForAPIKeyRequest,
|
||||
ExchangeAuthCodeForAPIKeyRequestBody,
|
||||
ExchangeAuthCodeForAPIKeyRequestBodyTypedDict,
|
||||
ExchangeAuthCodeForAPIKeyRequestTypedDict,
|
||||
ExchangeAuthCodeForAPIKeyResponse,
|
||||
ExchangeAuthCodeForAPIKeyResponseTypedDict,
|
||||
@@ -141,12 +181,20 @@ if TYPE_CHECKING:
|
||||
from .getcredits import (
|
||||
GetCreditsData,
|
||||
GetCreditsDataTypedDict,
|
||||
GetCreditsGlobals,
|
||||
GetCreditsGlobalsTypedDict,
|
||||
GetCreditsRequest,
|
||||
GetCreditsRequestTypedDict,
|
||||
GetCreditsResponse,
|
||||
GetCreditsResponseTypedDict,
|
||||
)
|
||||
from .getcurrentkey import (
|
||||
GetCurrentKeyData,
|
||||
GetCurrentKeyDataTypedDict,
|
||||
GetCurrentKeyGlobals,
|
||||
GetCurrentKeyGlobalsTypedDict,
|
||||
GetCurrentKeyRequest,
|
||||
GetCurrentKeyRequestTypedDict,
|
||||
GetCurrentKeyResponse,
|
||||
GetCurrentKeyResponseTypedDict,
|
||||
RateLimit,
|
||||
@@ -156,14 +204,21 @@ if TYPE_CHECKING:
|
||||
APIType,
|
||||
GetGenerationData,
|
||||
GetGenerationDataTypedDict,
|
||||
GetGenerationGlobals,
|
||||
GetGenerationGlobalsTypedDict,
|
||||
GetGenerationRequest,
|
||||
GetGenerationRequestTypedDict,
|
||||
GetGenerationResponse,
|
||||
GetGenerationResponseTypedDict,
|
||||
ProviderName,
|
||||
ProviderResponse,
|
||||
ProviderResponseTypedDict,
|
||||
)
|
||||
from .getguardrail import (
|
||||
GetGuardrailData,
|
||||
GetGuardrailDataTypedDict,
|
||||
GetGuardrailGlobals,
|
||||
GetGuardrailGlobalsTypedDict,
|
||||
GetGuardrailRequest,
|
||||
GetGuardrailRequestTypedDict,
|
||||
GetGuardrailResetInterval,
|
||||
@@ -173,13 +228,23 @@ if TYPE_CHECKING:
|
||||
from .getkey import (
|
||||
GetKeyData,
|
||||
GetKeyDataTypedDict,
|
||||
GetKeyGlobals,
|
||||
GetKeyGlobalsTypedDict,
|
||||
GetKeyRequest,
|
||||
GetKeyRequestTypedDict,
|
||||
GetKeyResponse,
|
||||
GetKeyResponseTypedDict,
|
||||
)
|
||||
from .getmodels import Category, GetModelsRequest, GetModelsRequestTypedDict
|
||||
from .getmodels import (
|
||||
Category,
|
||||
GetModelsGlobals,
|
||||
GetModelsGlobalsTypedDict,
|
||||
GetModelsRequest,
|
||||
GetModelsRequestTypedDict,
|
||||
)
|
||||
from .getuseractivity import (
|
||||
GetUserActivityGlobals,
|
||||
GetUserActivityGlobalsTypedDict,
|
||||
GetUserActivityRequest,
|
||||
GetUserActivityRequestTypedDict,
|
||||
GetUserActivityResponse,
|
||||
@@ -188,24 +253,40 @@ if TYPE_CHECKING:
|
||||
from .list import (
|
||||
ListData,
|
||||
ListDataTypedDict,
|
||||
ListGlobals,
|
||||
ListGlobalsTypedDict,
|
||||
ListRequest,
|
||||
ListRequestTypedDict,
|
||||
ListResponse,
|
||||
ListResponseTypedDict,
|
||||
)
|
||||
from .listembeddingsmodels import (
|
||||
ListEmbeddingsModelsGlobals,
|
||||
ListEmbeddingsModelsGlobalsTypedDict,
|
||||
ListEmbeddingsModelsRequest,
|
||||
ListEmbeddingsModelsRequestTypedDict,
|
||||
)
|
||||
from .listendpoints import (
|
||||
ListEndpointsGlobals,
|
||||
ListEndpointsGlobalsTypedDict,
|
||||
ListEndpointsRequest,
|
||||
ListEndpointsRequestTypedDict,
|
||||
ListEndpointsResponse,
|
||||
ListEndpointsResponseTypedDict,
|
||||
)
|
||||
from .listendpointszdr import (
|
||||
ListEndpointsZdrGlobals,
|
||||
ListEndpointsZdrGlobalsTypedDict,
|
||||
ListEndpointsZdrRequest,
|
||||
ListEndpointsZdrRequestTypedDict,
|
||||
ListEndpointsZdrResponse,
|
||||
ListEndpointsZdrResponseTypedDict,
|
||||
)
|
||||
from .listguardrailkeyassignments import (
|
||||
ListGuardrailKeyAssignmentsData,
|
||||
ListGuardrailKeyAssignmentsDataTypedDict,
|
||||
ListGuardrailKeyAssignmentsGlobals,
|
||||
ListGuardrailKeyAssignmentsGlobalsTypedDict,
|
||||
ListGuardrailKeyAssignmentsRequest,
|
||||
ListGuardrailKeyAssignmentsRequestTypedDict,
|
||||
ListGuardrailKeyAssignmentsResponse,
|
||||
@@ -214,6 +295,8 @@ if TYPE_CHECKING:
|
||||
from .listguardrailmemberassignments import (
|
||||
ListGuardrailMemberAssignmentsData,
|
||||
ListGuardrailMemberAssignmentsDataTypedDict,
|
||||
ListGuardrailMemberAssignmentsGlobals,
|
||||
ListGuardrailMemberAssignmentsGlobalsTypedDict,
|
||||
ListGuardrailMemberAssignmentsRequest,
|
||||
ListGuardrailMemberAssignmentsRequestTypedDict,
|
||||
ListGuardrailMemberAssignmentsResponse,
|
||||
@@ -222,6 +305,8 @@ if TYPE_CHECKING:
|
||||
from .listguardrails import (
|
||||
ListGuardrailsData,
|
||||
ListGuardrailsDataTypedDict,
|
||||
ListGuardrailsGlobals,
|
||||
ListGuardrailsGlobalsTypedDict,
|
||||
ListGuardrailsRequest,
|
||||
ListGuardrailsRequestTypedDict,
|
||||
ListGuardrailsResetInterval,
|
||||
@@ -231,6 +316,8 @@ if TYPE_CHECKING:
|
||||
from .listkeyassignments import (
|
||||
ListKeyAssignmentsData,
|
||||
ListKeyAssignmentsDataTypedDict,
|
||||
ListKeyAssignmentsGlobals,
|
||||
ListKeyAssignmentsGlobalsTypedDict,
|
||||
ListKeyAssignmentsRequest,
|
||||
ListKeyAssignmentsRequestTypedDict,
|
||||
ListKeyAssignmentsResponse,
|
||||
@@ -239,25 +326,50 @@ if TYPE_CHECKING:
|
||||
from .listmemberassignments import (
|
||||
ListMemberAssignmentsData,
|
||||
ListMemberAssignmentsDataTypedDict,
|
||||
ListMemberAssignmentsGlobals,
|
||||
ListMemberAssignmentsGlobalsTypedDict,
|
||||
ListMemberAssignmentsRequest,
|
||||
ListMemberAssignmentsRequestTypedDict,
|
||||
ListMemberAssignmentsResponse,
|
||||
ListMemberAssignmentsResponseTypedDict,
|
||||
)
|
||||
from .listmodelsuser import ListModelsUserSecurity, ListModelsUserSecurityTypedDict
|
||||
from .listmodelscount import (
|
||||
ListModelsCountGlobals,
|
||||
ListModelsCountGlobalsTypedDict,
|
||||
ListModelsCountRequest,
|
||||
ListModelsCountRequestTypedDict,
|
||||
)
|
||||
from .listmodelsuser import (
|
||||
ListModelsUserGlobals,
|
||||
ListModelsUserGlobalsTypedDict,
|
||||
ListModelsUserRequest,
|
||||
ListModelsUserRequestTypedDict,
|
||||
ListModelsUserSecurity,
|
||||
ListModelsUserSecurityTypedDict,
|
||||
)
|
||||
from .listproviders import (
|
||||
ListProvidersData,
|
||||
ListProvidersDataTypedDict,
|
||||
ListProvidersGlobals,
|
||||
ListProvidersGlobalsTypedDict,
|
||||
ListProvidersRequest,
|
||||
ListProvidersRequestTypedDict,
|
||||
ListProvidersResponse,
|
||||
ListProvidersResponseTypedDict,
|
||||
)
|
||||
from .sendchatcompletionrequest import (
|
||||
SendChatCompletionRequestGlobals,
|
||||
SendChatCompletionRequestGlobalsTypedDict,
|
||||
SendChatCompletionRequestRequest,
|
||||
SendChatCompletionRequestRequestTypedDict,
|
||||
SendChatCompletionRequestResponse,
|
||||
SendChatCompletionRequestResponseTypedDict,
|
||||
)
|
||||
from .updateguardrail import (
|
||||
UpdateGuardrailData,
|
||||
UpdateGuardrailDataTypedDict,
|
||||
UpdateGuardrailGlobals,
|
||||
UpdateGuardrailGlobalsTypedDict,
|
||||
UpdateGuardrailRequest,
|
||||
UpdateGuardrailRequestBody,
|
||||
UpdateGuardrailRequestBodyTypedDict,
|
||||
@@ -270,6 +382,8 @@ if TYPE_CHECKING:
|
||||
from .updatekeys import (
|
||||
UpdateKeysData,
|
||||
UpdateKeysDataTypedDict,
|
||||
UpdateKeysGlobals,
|
||||
UpdateKeysGlobalsTypedDict,
|
||||
UpdateKeysLimitReset,
|
||||
UpdateKeysRequest,
|
||||
UpdateKeysRequestBody,
|
||||
@@ -281,24 +395,32 @@ if TYPE_CHECKING:
|
||||
|
||||
__all__ = [
|
||||
"APIType",
|
||||
"BulkAssignKeysToGuardrailGlobals",
|
||||
"BulkAssignKeysToGuardrailGlobalsTypedDict",
|
||||
"BulkAssignKeysToGuardrailRequest",
|
||||
"BulkAssignKeysToGuardrailRequestBody",
|
||||
"BulkAssignKeysToGuardrailRequestBodyTypedDict",
|
||||
"BulkAssignKeysToGuardrailRequestTypedDict",
|
||||
"BulkAssignKeysToGuardrailResponse",
|
||||
"BulkAssignKeysToGuardrailResponseTypedDict",
|
||||
"BulkAssignMembersToGuardrailGlobals",
|
||||
"BulkAssignMembersToGuardrailGlobalsTypedDict",
|
||||
"BulkAssignMembersToGuardrailRequest",
|
||||
"BulkAssignMembersToGuardrailRequestBody",
|
||||
"BulkAssignMembersToGuardrailRequestBodyTypedDict",
|
||||
"BulkAssignMembersToGuardrailRequestTypedDict",
|
||||
"BulkAssignMembersToGuardrailResponse",
|
||||
"BulkAssignMembersToGuardrailResponseTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailGlobals",
|
||||
"BulkUnassignKeysFromGuardrailGlobalsTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailRequest",
|
||||
"BulkUnassignKeysFromGuardrailRequestBody",
|
||||
"BulkUnassignKeysFromGuardrailRequestBodyTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailRequestTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailResponse",
|
||||
"BulkUnassignKeysFromGuardrailResponseTypedDict",
|
||||
"BulkUnassignMembersFromGuardrailGlobals",
|
||||
"BulkUnassignMembersFromGuardrailGlobalsTypedDict",
|
||||
"BulkUnassignMembersFromGuardrailRequest",
|
||||
"BulkUnassignMembersFromGuardrailRequestBody",
|
||||
"BulkUnassignMembersFromGuardrailRequestBodyTypedDict",
|
||||
@@ -317,19 +439,31 @@ __all__ = [
|
||||
"CreateAuthKeysCodeCodeChallengeMethod",
|
||||
"CreateAuthKeysCodeData",
|
||||
"CreateAuthKeysCodeDataTypedDict",
|
||||
"CreateAuthKeysCodeGlobals",
|
||||
"CreateAuthKeysCodeGlobalsTypedDict",
|
||||
"CreateAuthKeysCodeRequest",
|
||||
"CreateAuthKeysCodeRequestBody",
|
||||
"CreateAuthKeysCodeRequestBodyTypedDict",
|
||||
"CreateAuthKeysCodeRequestTypedDict",
|
||||
"CreateAuthKeysCodeResponse",
|
||||
"CreateAuthKeysCodeResponseTypedDict",
|
||||
"CreateCoinbaseChargeData",
|
||||
"CreateCoinbaseChargeDataTypedDict",
|
||||
"CreateCoinbaseChargeGlobals",
|
||||
"CreateCoinbaseChargeGlobalsTypedDict",
|
||||
"CreateCoinbaseChargeRequest",
|
||||
"CreateCoinbaseChargeRequestTypedDict",
|
||||
"CreateCoinbaseChargeResponse",
|
||||
"CreateCoinbaseChargeResponseTypedDict",
|
||||
"CreateCoinbaseChargeSecurity",
|
||||
"CreateCoinbaseChargeSecurityTypedDict",
|
||||
"CreateEmbeddingsData",
|
||||
"CreateEmbeddingsDataTypedDict",
|
||||
"CreateEmbeddingsGlobals",
|
||||
"CreateEmbeddingsGlobalsTypedDict",
|
||||
"CreateEmbeddingsRequest",
|
||||
"CreateEmbeddingsRequestBody",
|
||||
"CreateEmbeddingsRequestBodyTypedDict",
|
||||
"CreateEmbeddingsRequestTypedDict",
|
||||
"CreateEmbeddingsResponse",
|
||||
"CreateEmbeddingsResponseBody",
|
||||
@@ -337,7 +471,11 @@ __all__ = [
|
||||
"CreateEmbeddingsResponseTypedDict",
|
||||
"CreateGuardrailData",
|
||||
"CreateGuardrailDataTypedDict",
|
||||
"CreateGuardrailGlobals",
|
||||
"CreateGuardrailGlobalsTypedDict",
|
||||
"CreateGuardrailRequest",
|
||||
"CreateGuardrailRequestBody",
|
||||
"CreateGuardrailRequestBodyTypedDict",
|
||||
"CreateGuardrailRequestTypedDict",
|
||||
"CreateGuardrailResetIntervalRequest",
|
||||
"CreateGuardrailResetIntervalResponse",
|
||||
@@ -345,19 +483,31 @@ __all__ = [
|
||||
"CreateGuardrailResponseTypedDict",
|
||||
"CreateKeysData",
|
||||
"CreateKeysDataTypedDict",
|
||||
"CreateKeysGlobals",
|
||||
"CreateKeysGlobalsTypedDict",
|
||||
"CreateKeysLimitReset",
|
||||
"CreateKeysRequest",
|
||||
"CreateKeysRequestBody",
|
||||
"CreateKeysRequestBodyTypedDict",
|
||||
"CreateKeysRequestTypedDict",
|
||||
"CreateKeysResponse",
|
||||
"CreateKeysResponseTypedDict",
|
||||
"CreateResponsesGlobals",
|
||||
"CreateResponsesGlobalsTypedDict",
|
||||
"CreateResponsesRequest",
|
||||
"CreateResponsesRequestTypedDict",
|
||||
"CreateResponsesResponse",
|
||||
"CreateResponsesResponseBody",
|
||||
"CreateResponsesResponseBodyTypedDict",
|
||||
"CreateResponsesResponseTypedDict",
|
||||
"DeleteGuardrailGlobals",
|
||||
"DeleteGuardrailGlobalsTypedDict",
|
||||
"DeleteGuardrailRequest",
|
||||
"DeleteGuardrailRequestTypedDict",
|
||||
"DeleteGuardrailResponse",
|
||||
"DeleteGuardrailResponseTypedDict",
|
||||
"DeleteKeysGlobals",
|
||||
"DeleteKeysGlobalsTypedDict",
|
||||
"DeleteKeysRequest",
|
||||
"DeleteKeysRequestTypedDict",
|
||||
"DeleteKeysResponse",
|
||||
@@ -366,26 +516,42 @@ __all__ = [
|
||||
"EmbeddingTypedDict",
|
||||
"EncodingFormat",
|
||||
"ExchangeAuthCodeForAPIKeyCodeChallengeMethod",
|
||||
"ExchangeAuthCodeForAPIKeyGlobals",
|
||||
"ExchangeAuthCodeForAPIKeyGlobalsTypedDict",
|
||||
"ExchangeAuthCodeForAPIKeyRequest",
|
||||
"ExchangeAuthCodeForAPIKeyRequestBody",
|
||||
"ExchangeAuthCodeForAPIKeyRequestBodyTypedDict",
|
||||
"ExchangeAuthCodeForAPIKeyRequestTypedDict",
|
||||
"ExchangeAuthCodeForAPIKeyResponse",
|
||||
"ExchangeAuthCodeForAPIKeyResponseTypedDict",
|
||||
"GetCreditsData",
|
||||
"GetCreditsDataTypedDict",
|
||||
"GetCreditsGlobals",
|
||||
"GetCreditsGlobalsTypedDict",
|
||||
"GetCreditsRequest",
|
||||
"GetCreditsRequestTypedDict",
|
||||
"GetCreditsResponse",
|
||||
"GetCreditsResponseTypedDict",
|
||||
"GetCurrentKeyData",
|
||||
"GetCurrentKeyDataTypedDict",
|
||||
"GetCurrentKeyGlobals",
|
||||
"GetCurrentKeyGlobalsTypedDict",
|
||||
"GetCurrentKeyRequest",
|
||||
"GetCurrentKeyRequestTypedDict",
|
||||
"GetCurrentKeyResponse",
|
||||
"GetCurrentKeyResponseTypedDict",
|
||||
"GetGenerationData",
|
||||
"GetGenerationDataTypedDict",
|
||||
"GetGenerationGlobals",
|
||||
"GetGenerationGlobalsTypedDict",
|
||||
"GetGenerationRequest",
|
||||
"GetGenerationRequestTypedDict",
|
||||
"GetGenerationResponse",
|
||||
"GetGenerationResponseTypedDict",
|
||||
"GetGuardrailData",
|
||||
"GetGuardrailDataTypedDict",
|
||||
"GetGuardrailGlobals",
|
||||
"GetGuardrailGlobalsTypedDict",
|
||||
"GetGuardrailRequest",
|
||||
"GetGuardrailRequestTypedDict",
|
||||
"GetGuardrailResetInterval",
|
||||
@@ -393,12 +559,18 @@ __all__ = [
|
||||
"GetGuardrailResponseTypedDict",
|
||||
"GetKeyData",
|
||||
"GetKeyDataTypedDict",
|
||||
"GetKeyGlobals",
|
||||
"GetKeyGlobalsTypedDict",
|
||||
"GetKeyRequest",
|
||||
"GetKeyRequestTypedDict",
|
||||
"GetKeyResponse",
|
||||
"GetKeyResponseTypedDict",
|
||||
"GetModelsGlobals",
|
||||
"GetModelsGlobalsTypedDict",
|
||||
"GetModelsRequest",
|
||||
"GetModelsRequestTypedDict",
|
||||
"GetUserActivityGlobals",
|
||||
"GetUserActivityGlobalsTypedDict",
|
||||
"GetUserActivityRequest",
|
||||
"GetUserActivityRequestTypedDict",
|
||||
"GetUserActivityResponse",
|
||||
@@ -411,26 +583,44 @@ __all__ = [
|
||||
"InputUnionTypedDict",
|
||||
"ListData",
|
||||
"ListDataTypedDict",
|
||||
"ListEmbeddingsModelsGlobals",
|
||||
"ListEmbeddingsModelsGlobalsTypedDict",
|
||||
"ListEmbeddingsModelsRequest",
|
||||
"ListEmbeddingsModelsRequestTypedDict",
|
||||
"ListEndpointsGlobals",
|
||||
"ListEndpointsGlobalsTypedDict",
|
||||
"ListEndpointsRequest",
|
||||
"ListEndpointsRequestTypedDict",
|
||||
"ListEndpointsResponse",
|
||||
"ListEndpointsResponseTypedDict",
|
||||
"ListEndpointsZdrGlobals",
|
||||
"ListEndpointsZdrGlobalsTypedDict",
|
||||
"ListEndpointsZdrRequest",
|
||||
"ListEndpointsZdrRequestTypedDict",
|
||||
"ListEndpointsZdrResponse",
|
||||
"ListEndpointsZdrResponseTypedDict",
|
||||
"ListGlobals",
|
||||
"ListGlobalsTypedDict",
|
||||
"ListGuardrailKeyAssignmentsData",
|
||||
"ListGuardrailKeyAssignmentsDataTypedDict",
|
||||
"ListGuardrailKeyAssignmentsGlobals",
|
||||
"ListGuardrailKeyAssignmentsGlobalsTypedDict",
|
||||
"ListGuardrailKeyAssignmentsRequest",
|
||||
"ListGuardrailKeyAssignmentsRequestTypedDict",
|
||||
"ListGuardrailKeyAssignmentsResponse",
|
||||
"ListGuardrailKeyAssignmentsResponseTypedDict",
|
||||
"ListGuardrailMemberAssignmentsData",
|
||||
"ListGuardrailMemberAssignmentsDataTypedDict",
|
||||
"ListGuardrailMemberAssignmentsGlobals",
|
||||
"ListGuardrailMemberAssignmentsGlobalsTypedDict",
|
||||
"ListGuardrailMemberAssignmentsRequest",
|
||||
"ListGuardrailMemberAssignmentsRequestTypedDict",
|
||||
"ListGuardrailMemberAssignmentsResponse",
|
||||
"ListGuardrailMemberAssignmentsResponseTypedDict",
|
||||
"ListGuardrailsData",
|
||||
"ListGuardrailsDataTypedDict",
|
||||
"ListGuardrailsGlobals",
|
||||
"ListGuardrailsGlobalsTypedDict",
|
||||
"ListGuardrailsRequest",
|
||||
"ListGuardrailsRequestTypedDict",
|
||||
"ListGuardrailsResetInterval",
|
||||
@@ -438,20 +628,36 @@ __all__ = [
|
||||
"ListGuardrailsResponseTypedDict",
|
||||
"ListKeyAssignmentsData",
|
||||
"ListKeyAssignmentsDataTypedDict",
|
||||
"ListKeyAssignmentsGlobals",
|
||||
"ListKeyAssignmentsGlobalsTypedDict",
|
||||
"ListKeyAssignmentsRequest",
|
||||
"ListKeyAssignmentsRequestTypedDict",
|
||||
"ListKeyAssignmentsResponse",
|
||||
"ListKeyAssignmentsResponseTypedDict",
|
||||
"ListMemberAssignmentsData",
|
||||
"ListMemberAssignmentsDataTypedDict",
|
||||
"ListMemberAssignmentsGlobals",
|
||||
"ListMemberAssignmentsGlobalsTypedDict",
|
||||
"ListMemberAssignmentsRequest",
|
||||
"ListMemberAssignmentsRequestTypedDict",
|
||||
"ListMemberAssignmentsResponse",
|
||||
"ListMemberAssignmentsResponseTypedDict",
|
||||
"ListModelsCountGlobals",
|
||||
"ListModelsCountGlobalsTypedDict",
|
||||
"ListModelsCountRequest",
|
||||
"ListModelsCountRequestTypedDict",
|
||||
"ListModelsUserGlobals",
|
||||
"ListModelsUserGlobalsTypedDict",
|
||||
"ListModelsUserRequest",
|
||||
"ListModelsUserRequestTypedDict",
|
||||
"ListModelsUserSecurity",
|
||||
"ListModelsUserSecurityTypedDict",
|
||||
"ListProvidersData",
|
||||
"ListProvidersDataTypedDict",
|
||||
"ListProvidersGlobals",
|
||||
"ListProvidersGlobalsTypedDict",
|
||||
"ListProvidersRequest",
|
||||
"ListProvidersRequestTypedDict",
|
||||
"ListProvidersResponse",
|
||||
"ListProvidersResponseTypedDict",
|
||||
"ListRequest",
|
||||
@@ -462,8 +668,15 @@ __all__ = [
|
||||
"MetadataTypedDict",
|
||||
"Object",
|
||||
"ObjectEmbedding",
|
||||
"ProviderName",
|
||||
"ProviderResponse",
|
||||
"ProviderResponseTypedDict",
|
||||
"RateLimit",
|
||||
"RateLimitTypedDict",
|
||||
"SendChatCompletionRequestGlobals",
|
||||
"SendChatCompletionRequestGlobalsTypedDict",
|
||||
"SendChatCompletionRequestRequest",
|
||||
"SendChatCompletionRequestRequestTypedDict",
|
||||
"SendChatCompletionRequestResponse",
|
||||
"SendChatCompletionRequestResponseTypedDict",
|
||||
"TransferIntent",
|
||||
@@ -472,6 +685,8 @@ __all__ = [
|
||||
"TypeText",
|
||||
"UpdateGuardrailData",
|
||||
"UpdateGuardrailDataTypedDict",
|
||||
"UpdateGuardrailGlobals",
|
||||
"UpdateGuardrailGlobalsTypedDict",
|
||||
"UpdateGuardrailRequest",
|
||||
"UpdateGuardrailRequestBody",
|
||||
"UpdateGuardrailRequestBodyTypedDict",
|
||||
@@ -482,6 +697,8 @@ __all__ = [
|
||||
"UpdateGuardrailResponseTypedDict",
|
||||
"UpdateKeysData",
|
||||
"UpdateKeysDataTypedDict",
|
||||
"UpdateKeysGlobals",
|
||||
"UpdateKeysGlobalsTypedDict",
|
||||
"UpdateKeysLimitReset",
|
||||
"UpdateKeysRequest",
|
||||
"UpdateKeysRequestBody",
|
||||
@@ -496,24 +713,32 @@ __all__ = [
|
||||
]
|
||||
|
||||
_dynamic_imports: dict[str, str] = {
|
||||
"BulkAssignKeysToGuardrailGlobals": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailGlobalsTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequest": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequestBody": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequestBodyTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequestTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailResponse": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailResponseTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignMembersToGuardrailGlobals": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailGlobalsTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequest": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequestBody": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequestBodyTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequestTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailResponse": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailResponseTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkUnassignKeysFromGuardrailGlobals": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailGlobalsTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequest": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequestBody": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequestBodyTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequestTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailResponse": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailResponseTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailGlobals": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailGlobalsTypedDict": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequest": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequestBody": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequestBodyTypedDict": ".bulkunassignmembersfromguardrail",
|
||||
@@ -523,7 +748,11 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateAuthKeysCodeCodeChallengeMethod": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeData": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeDataTypedDict": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeGlobals": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeGlobalsTypedDict": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeRequest": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeRequestBody": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeRequestBodyTypedDict": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeRequestTypedDict": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeResponse": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeResponseTypedDict": ".createauthkeyscode",
|
||||
@@ -531,6 +760,10 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CallDataTypedDict": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeData": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeDataTypedDict": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeGlobals": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeGlobalsTypedDict": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeRequest": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeRequestTypedDict": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeResponse": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeResponseTypedDict": ".createcoinbasecharge",
|
||||
"CreateCoinbaseChargeSecurity": ".createcoinbasecharge",
|
||||
@@ -549,7 +782,11 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ContentTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsData": ".createembeddings",
|
||||
"CreateEmbeddingsDataTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsGlobals": ".createembeddings",
|
||||
"CreateEmbeddingsGlobalsTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsRequest": ".createembeddings",
|
||||
"CreateEmbeddingsRequestBody": ".createembeddings",
|
||||
"CreateEmbeddingsRequestBodyTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsRequestTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsResponse": ".createembeddings",
|
||||
"CreateEmbeddingsResponseBody": ".createembeddings",
|
||||
@@ -572,7 +809,11 @@ _dynamic_imports: dict[str, str] = {
|
||||
"UsageTypedDict": ".createembeddings",
|
||||
"CreateGuardrailData": ".createguardrail",
|
||||
"CreateGuardrailDataTypedDict": ".createguardrail",
|
||||
"CreateGuardrailGlobals": ".createguardrail",
|
||||
"CreateGuardrailGlobalsTypedDict": ".createguardrail",
|
||||
"CreateGuardrailRequest": ".createguardrail",
|
||||
"CreateGuardrailRequestBody": ".createguardrail",
|
||||
"CreateGuardrailRequestBodyTypedDict": ".createguardrail",
|
||||
"CreateGuardrailRequestTypedDict": ".createguardrail",
|
||||
"CreateGuardrailResetIntervalRequest": ".createguardrail",
|
||||
"CreateGuardrailResetIntervalResponse": ".createguardrail",
|
||||
@@ -580,34 +821,58 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateGuardrailResponseTypedDict": ".createguardrail",
|
||||
"CreateKeysData": ".createkeys",
|
||||
"CreateKeysDataTypedDict": ".createkeys",
|
||||
"CreateKeysGlobals": ".createkeys",
|
||||
"CreateKeysGlobalsTypedDict": ".createkeys",
|
||||
"CreateKeysLimitReset": ".createkeys",
|
||||
"CreateKeysRequest": ".createkeys",
|
||||
"CreateKeysRequestBody": ".createkeys",
|
||||
"CreateKeysRequestBodyTypedDict": ".createkeys",
|
||||
"CreateKeysRequestTypedDict": ".createkeys",
|
||||
"CreateKeysResponse": ".createkeys",
|
||||
"CreateKeysResponseTypedDict": ".createkeys",
|
||||
"CreateResponsesGlobals": ".createresponses",
|
||||
"CreateResponsesGlobalsTypedDict": ".createresponses",
|
||||
"CreateResponsesRequest": ".createresponses",
|
||||
"CreateResponsesRequestTypedDict": ".createresponses",
|
||||
"CreateResponsesResponse": ".createresponses",
|
||||
"CreateResponsesResponseBody": ".createresponses",
|
||||
"CreateResponsesResponseBodyTypedDict": ".createresponses",
|
||||
"CreateResponsesResponseTypedDict": ".createresponses",
|
||||
"DeleteGuardrailGlobals": ".deleteguardrail",
|
||||
"DeleteGuardrailGlobalsTypedDict": ".deleteguardrail",
|
||||
"DeleteGuardrailRequest": ".deleteguardrail",
|
||||
"DeleteGuardrailRequestTypedDict": ".deleteguardrail",
|
||||
"DeleteGuardrailResponse": ".deleteguardrail",
|
||||
"DeleteGuardrailResponseTypedDict": ".deleteguardrail",
|
||||
"DeleteKeysGlobals": ".deletekeys",
|
||||
"DeleteKeysGlobalsTypedDict": ".deletekeys",
|
||||
"DeleteKeysRequest": ".deletekeys",
|
||||
"DeleteKeysRequestTypedDict": ".deletekeys",
|
||||
"DeleteKeysResponse": ".deletekeys",
|
||||
"DeleteKeysResponseTypedDict": ".deletekeys",
|
||||
"ExchangeAuthCodeForAPIKeyCodeChallengeMethod": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyGlobals": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyGlobalsTypedDict": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyRequest": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyRequestBody": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyRequestBodyTypedDict": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyRequestTypedDict": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyResponse": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyResponseTypedDict": ".exchangeauthcodeforapikey",
|
||||
"GetCreditsData": ".getcredits",
|
||||
"GetCreditsDataTypedDict": ".getcredits",
|
||||
"GetCreditsGlobals": ".getcredits",
|
||||
"GetCreditsGlobalsTypedDict": ".getcredits",
|
||||
"GetCreditsRequest": ".getcredits",
|
||||
"GetCreditsRequestTypedDict": ".getcredits",
|
||||
"GetCreditsResponse": ".getcredits",
|
||||
"GetCreditsResponseTypedDict": ".getcredits",
|
||||
"GetCurrentKeyData": ".getcurrentkey",
|
||||
"GetCurrentKeyDataTypedDict": ".getcurrentkey",
|
||||
"GetCurrentKeyGlobals": ".getcurrentkey",
|
||||
"GetCurrentKeyGlobalsTypedDict": ".getcurrentkey",
|
||||
"GetCurrentKeyRequest": ".getcurrentkey",
|
||||
"GetCurrentKeyRequestTypedDict": ".getcurrentkey",
|
||||
"GetCurrentKeyResponse": ".getcurrentkey",
|
||||
"GetCurrentKeyResponseTypedDict": ".getcurrentkey",
|
||||
"RateLimit": ".getcurrentkey",
|
||||
@@ -615,12 +880,19 @@ _dynamic_imports: dict[str, str] = {
|
||||
"APIType": ".getgeneration",
|
||||
"GetGenerationData": ".getgeneration",
|
||||
"GetGenerationDataTypedDict": ".getgeneration",
|
||||
"GetGenerationGlobals": ".getgeneration",
|
||||
"GetGenerationGlobalsTypedDict": ".getgeneration",
|
||||
"GetGenerationRequest": ".getgeneration",
|
||||
"GetGenerationRequestTypedDict": ".getgeneration",
|
||||
"GetGenerationResponse": ".getgeneration",
|
||||
"GetGenerationResponseTypedDict": ".getgeneration",
|
||||
"ProviderName": ".getgeneration",
|
||||
"ProviderResponse": ".getgeneration",
|
||||
"ProviderResponseTypedDict": ".getgeneration",
|
||||
"GetGuardrailData": ".getguardrail",
|
||||
"GetGuardrailDataTypedDict": ".getguardrail",
|
||||
"GetGuardrailGlobals": ".getguardrail",
|
||||
"GetGuardrailGlobalsTypedDict": ".getguardrail",
|
||||
"GetGuardrailRequest": ".getguardrail",
|
||||
"GetGuardrailRequestTypedDict": ".getguardrail",
|
||||
"GetGuardrailResetInterval": ".getguardrail",
|
||||
@@ -628,43 +900,67 @@ _dynamic_imports: dict[str, str] = {
|
||||
"GetGuardrailResponseTypedDict": ".getguardrail",
|
||||
"GetKeyData": ".getkey",
|
||||
"GetKeyDataTypedDict": ".getkey",
|
||||
"GetKeyGlobals": ".getkey",
|
||||
"GetKeyGlobalsTypedDict": ".getkey",
|
||||
"GetKeyRequest": ".getkey",
|
||||
"GetKeyRequestTypedDict": ".getkey",
|
||||
"GetKeyResponse": ".getkey",
|
||||
"GetKeyResponseTypedDict": ".getkey",
|
||||
"Category": ".getmodels",
|
||||
"GetModelsGlobals": ".getmodels",
|
||||
"GetModelsGlobalsTypedDict": ".getmodels",
|
||||
"GetModelsRequest": ".getmodels",
|
||||
"GetModelsRequestTypedDict": ".getmodels",
|
||||
"GetUserActivityGlobals": ".getuseractivity",
|
||||
"GetUserActivityGlobalsTypedDict": ".getuseractivity",
|
||||
"GetUserActivityRequest": ".getuseractivity",
|
||||
"GetUserActivityRequestTypedDict": ".getuseractivity",
|
||||
"GetUserActivityResponse": ".getuseractivity",
|
||||
"GetUserActivityResponseTypedDict": ".getuseractivity",
|
||||
"ListData": ".list",
|
||||
"ListDataTypedDict": ".list",
|
||||
"ListGlobals": ".list",
|
||||
"ListGlobalsTypedDict": ".list",
|
||||
"ListRequest": ".list",
|
||||
"ListRequestTypedDict": ".list",
|
||||
"ListResponse": ".list",
|
||||
"ListResponseTypedDict": ".list",
|
||||
"ListEmbeddingsModelsGlobals": ".listembeddingsmodels",
|
||||
"ListEmbeddingsModelsGlobalsTypedDict": ".listembeddingsmodels",
|
||||
"ListEmbeddingsModelsRequest": ".listembeddingsmodels",
|
||||
"ListEmbeddingsModelsRequestTypedDict": ".listembeddingsmodels",
|
||||
"ListEndpointsGlobals": ".listendpoints",
|
||||
"ListEndpointsGlobalsTypedDict": ".listendpoints",
|
||||
"ListEndpointsRequest": ".listendpoints",
|
||||
"ListEndpointsRequestTypedDict": ".listendpoints",
|
||||
"ListEndpointsResponse": ".listendpoints",
|
||||
"ListEndpointsResponseTypedDict": ".listendpoints",
|
||||
"ListEndpointsZdrGlobals": ".listendpointszdr",
|
||||
"ListEndpointsZdrGlobalsTypedDict": ".listendpointszdr",
|
||||
"ListEndpointsZdrRequest": ".listendpointszdr",
|
||||
"ListEndpointsZdrRequestTypedDict": ".listendpointszdr",
|
||||
"ListEndpointsZdrResponse": ".listendpointszdr",
|
||||
"ListEndpointsZdrResponseTypedDict": ".listendpointszdr",
|
||||
"ListGuardrailKeyAssignmentsData": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsDataTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsGlobals": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsGlobalsTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsRequest": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsRequestTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsResponse": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsResponseTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailMemberAssignmentsData": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsDataTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsGlobals": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsGlobalsTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsRequest": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsRequestTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsResponse": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsResponseTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailsData": ".listguardrails",
|
||||
"ListGuardrailsDataTypedDict": ".listguardrails",
|
||||
"ListGuardrailsGlobals": ".listguardrails",
|
||||
"ListGuardrailsGlobalsTypedDict": ".listguardrails",
|
||||
"ListGuardrailsRequest": ".listguardrails",
|
||||
"ListGuardrailsRequestTypedDict": ".listguardrails",
|
||||
"ListGuardrailsResetInterval": ".listguardrails",
|
||||
@@ -672,26 +968,48 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ListGuardrailsResponseTypedDict": ".listguardrails",
|
||||
"ListKeyAssignmentsData": ".listkeyassignments",
|
||||
"ListKeyAssignmentsDataTypedDict": ".listkeyassignments",
|
||||
"ListKeyAssignmentsGlobals": ".listkeyassignments",
|
||||
"ListKeyAssignmentsGlobalsTypedDict": ".listkeyassignments",
|
||||
"ListKeyAssignmentsRequest": ".listkeyassignments",
|
||||
"ListKeyAssignmentsRequestTypedDict": ".listkeyassignments",
|
||||
"ListKeyAssignmentsResponse": ".listkeyassignments",
|
||||
"ListKeyAssignmentsResponseTypedDict": ".listkeyassignments",
|
||||
"ListMemberAssignmentsData": ".listmemberassignments",
|
||||
"ListMemberAssignmentsDataTypedDict": ".listmemberassignments",
|
||||
"ListMemberAssignmentsGlobals": ".listmemberassignments",
|
||||
"ListMemberAssignmentsGlobalsTypedDict": ".listmemberassignments",
|
||||
"ListMemberAssignmentsRequest": ".listmemberassignments",
|
||||
"ListMemberAssignmentsRequestTypedDict": ".listmemberassignments",
|
||||
"ListMemberAssignmentsResponse": ".listmemberassignments",
|
||||
"ListMemberAssignmentsResponseTypedDict": ".listmemberassignments",
|
||||
"ListModelsCountGlobals": ".listmodelscount",
|
||||
"ListModelsCountGlobalsTypedDict": ".listmodelscount",
|
||||
"ListModelsCountRequest": ".listmodelscount",
|
||||
"ListModelsCountRequestTypedDict": ".listmodelscount",
|
||||
"ListModelsUserGlobals": ".listmodelsuser",
|
||||
"ListModelsUserGlobalsTypedDict": ".listmodelsuser",
|
||||
"ListModelsUserRequest": ".listmodelsuser",
|
||||
"ListModelsUserRequestTypedDict": ".listmodelsuser",
|
||||
"ListModelsUserSecurity": ".listmodelsuser",
|
||||
"ListModelsUserSecurityTypedDict": ".listmodelsuser",
|
||||
"ListProvidersData": ".listproviders",
|
||||
"ListProvidersDataTypedDict": ".listproviders",
|
||||
"ListProvidersGlobals": ".listproviders",
|
||||
"ListProvidersGlobalsTypedDict": ".listproviders",
|
||||
"ListProvidersRequest": ".listproviders",
|
||||
"ListProvidersRequestTypedDict": ".listproviders",
|
||||
"ListProvidersResponse": ".listproviders",
|
||||
"ListProvidersResponseTypedDict": ".listproviders",
|
||||
"SendChatCompletionRequestGlobals": ".sendchatcompletionrequest",
|
||||
"SendChatCompletionRequestGlobalsTypedDict": ".sendchatcompletionrequest",
|
||||
"SendChatCompletionRequestRequest": ".sendchatcompletionrequest",
|
||||
"SendChatCompletionRequestRequestTypedDict": ".sendchatcompletionrequest",
|
||||
"SendChatCompletionRequestResponse": ".sendchatcompletionrequest",
|
||||
"SendChatCompletionRequestResponseTypedDict": ".sendchatcompletionrequest",
|
||||
"UpdateGuardrailData": ".updateguardrail",
|
||||
"UpdateGuardrailDataTypedDict": ".updateguardrail",
|
||||
"UpdateGuardrailGlobals": ".updateguardrail",
|
||||
"UpdateGuardrailGlobalsTypedDict": ".updateguardrail",
|
||||
"UpdateGuardrailRequest": ".updateguardrail",
|
||||
"UpdateGuardrailRequestBody": ".updateguardrail",
|
||||
"UpdateGuardrailRequestBodyTypedDict": ".updateguardrail",
|
||||
@@ -702,6 +1020,8 @@ _dynamic_imports: dict[str, str] = {
|
||||
"UpdateGuardrailResponseTypedDict": ".updateguardrail",
|
||||
"UpdateKeysData": ".updatekeys",
|
||||
"UpdateKeysDataTypedDict": ".updatekeys",
|
||||
"UpdateKeysGlobals": ".updatekeys",
|
||||
"UpdateKeysGlobalsTypedDict": ".updatekeys",
|
||||
"UpdateKeysLimitReset": ".updatekeys",
|
||||
"UpdateKeysRequest": ".updatekeys",
|
||||
"UpdateKeysRequestBody": ".updatekeys",
|
||||
|
||||
@@ -2,9 +2,48 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailRequestBodyTypedDict(TypedDict):
|
||||
@@ -21,6 +60,15 @@ class BulkAssignKeysToGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkAssignKeysToGuardrailRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailRequest(BaseModel):
|
||||
@@ -34,6 +82,25 @@ class BulkAssignKeysToGuardrailRequest(BaseModel):
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Assignment result"""
|
||||
|
||||
@@ -2,9 +2,48 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailRequestBodyTypedDict(TypedDict):
|
||||
@@ -21,6 +60,15 @@ class BulkAssignMembersToGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkAssignMembersToGuardrailRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailRequest(BaseModel):
|
||||
@@ -34,6 +82,25 @@ class BulkAssignMembersToGuardrailRequest(BaseModel):
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Assignment result"""
|
||||
|
||||
@@ -2,9 +2,48 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailRequestBodyTypedDict(TypedDict):
|
||||
@@ -21,6 +60,15 @@ class BulkUnassignKeysFromGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkUnassignKeysFromGuardrailRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailRequest(BaseModel):
|
||||
@@ -34,6 +82,25 @@ class BulkUnassignKeysFromGuardrailRequest(BaseModel):
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Unassignment result"""
|
||||
|
||||
@@ -2,9 +2,48 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailRequestBodyTypedDict(TypedDict):
|
||||
@@ -21,6 +60,15 @@ class BulkUnassignMembersFromGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkUnassignMembersFromGuardrailRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailRequest(BaseModel):
|
||||
@@ -34,6 +82,25 @@ class BulkUnassignMembersFromGuardrailRequest(BaseModel):
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Unassignment result"""
|
||||
|
||||
@@ -10,13 +10,52 @@ from openrouter.types import (
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class CreateAuthKeysCodeGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateAuthKeysCodeGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateAuthKeysCodeCodeChallengeMethod = Union[
|
||||
Literal[
|
||||
"S256",
|
||||
@@ -27,7 +66,7 @@ CreateAuthKeysCodeCodeChallengeMethod = Union[
|
||||
r"""The method used to generate the code challenge"""
|
||||
|
||||
|
||||
class CreateAuthKeysCodeRequestTypedDict(TypedDict):
|
||||
class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict):
|
||||
callback_url: str
|
||||
r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
|
||||
code_challenge: NotRequired[str]
|
||||
@@ -40,7 +79,7 @@ class CreateAuthKeysCodeRequestTypedDict(TypedDict):
|
||||
r"""Optional expiration time for the API key to be created"""
|
||||
|
||||
|
||||
class CreateAuthKeysCodeRequest(BaseModel):
|
||||
class CreateAuthKeysCodeRequestBody(BaseModel):
|
||||
callback_url: str
|
||||
r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
|
||||
|
||||
@@ -95,6 +134,45 @@ class CreateAuthKeysCodeRequest(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class CreateAuthKeysCodeRequestTypedDict(TypedDict):
|
||||
request_body: CreateAuthKeysCodeRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateAuthKeysCodeRequest(BaseModel):
|
||||
request_body: Annotated[
|
||||
CreateAuthKeysCodeRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateAuthKeysCodeDataTypedDict(TypedDict):
|
||||
r"""Auth code data"""
|
||||
|
||||
|
||||
@@ -1,9 +1,50 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.components import createchargerequest as components_createchargerequest
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, SecurityMetadata
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
SecurityMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class CreateCoinbaseChargeGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateCoinbaseChargeGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateCoinbaseChargeSecurityTypedDict(TypedDict):
|
||||
@@ -24,6 +65,45 @@ class CreateCoinbaseChargeSecurity(BaseModel):
|
||||
]
|
||||
|
||||
|
||||
class CreateCoinbaseChargeRequestTypedDict(TypedDict):
|
||||
create_charge_request: components_createchargerequest.CreateChargeRequestTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateCoinbaseChargeRequest(BaseModel):
|
||||
create_charge_request: Annotated[
|
||||
components_createchargerequest.CreateChargeRequest,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CallDataTypedDict(TypedDict):
|
||||
deadline: str
|
||||
fee_amount: str
|
||||
|
||||
@@ -3,13 +3,53 @@
|
||||
from __future__ import annotations
|
||||
from openrouter.components import providerpreferences as components_providerpreferences
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import get_discriminator, validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
get_discriminator,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import Discriminator, Tag
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
class CreateEmbeddingsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateEmbeddingsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
TypeImageURL = Literal["image_url",]
|
||||
|
||||
|
||||
@@ -88,7 +128,7 @@ EncodingFormat = Union[
|
||||
]
|
||||
|
||||
|
||||
class CreateEmbeddingsRequestTypedDict(TypedDict):
|
||||
class CreateEmbeddingsRequestBodyTypedDict(TypedDict):
|
||||
input: InputUnionTypedDict
|
||||
model: str
|
||||
encoding_format: NotRequired[EncodingFormat]
|
||||
@@ -99,7 +139,7 @@ class CreateEmbeddingsRequestTypedDict(TypedDict):
|
||||
input_type: NotRequired[str]
|
||||
|
||||
|
||||
class CreateEmbeddingsRequest(BaseModel):
|
||||
class CreateEmbeddingsRequestBody(BaseModel):
|
||||
input: InputUnion
|
||||
|
||||
model: str
|
||||
@@ -118,6 +158,45 @@ class CreateEmbeddingsRequest(BaseModel):
|
||||
input_type: Optional[str] = None
|
||||
|
||||
|
||||
class CreateEmbeddingsRequestTypedDict(TypedDict):
|
||||
request_body: CreateEmbeddingsRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateEmbeddingsRequest(BaseModel):
|
||||
request_body: Annotated[
|
||||
CreateEmbeddingsRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Object = Literal["list",]
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,52 @@ from openrouter.types import (
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Union
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class CreateGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateGuardrailResetIntervalRequest = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
@@ -27,7 +66,7 @@ CreateGuardrailResetIntervalRequest = Union[
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class CreateGuardrailRequestTypedDict(TypedDict):
|
||||
class CreateGuardrailRequestBodyTypedDict(TypedDict):
|
||||
name: str
|
||||
r"""Name for the new guardrail"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
@@ -44,7 +83,7 @@ class CreateGuardrailRequestTypedDict(TypedDict):
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
|
||||
class CreateGuardrailRequest(BaseModel):
|
||||
class CreateGuardrailRequestBody(BaseModel):
|
||||
name: str
|
||||
r"""Name for the new guardrail"""
|
||||
|
||||
@@ -114,6 +153,45 @@ class CreateGuardrailRequest(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class CreateGuardrailRequestTypedDict(TypedDict):
|
||||
request_body: CreateGuardrailRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateGuardrailRequest(BaseModel):
|
||||
request_body: Annotated[
|
||||
CreateGuardrailRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateGuardrailResetIntervalResponse = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
|
||||
@@ -10,13 +10,52 @@ from openrouter.types import (
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class CreateKeysGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateKeysGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateKeysLimitReset = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
@@ -28,7 +67,7 @@ CreateKeysLimitReset = Union[
|
||||
r"""Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday."""
|
||||
|
||||
|
||||
class CreateKeysRequestTypedDict(TypedDict):
|
||||
class CreateKeysRequestBodyTypedDict(TypedDict):
|
||||
name: str
|
||||
r"""Name for the new API key"""
|
||||
limit: NotRequired[Nullable[float]]
|
||||
@@ -41,7 +80,7 @@ class CreateKeysRequestTypedDict(TypedDict):
|
||||
r"""Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected"""
|
||||
|
||||
|
||||
class CreateKeysRequest(BaseModel):
|
||||
class CreateKeysRequestBody(BaseModel):
|
||||
name: str
|
||||
r"""Name for the new API key"""
|
||||
|
||||
@@ -96,6 +135,45 @@ class CreateKeysRequest(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class CreateKeysRequestTypedDict(TypedDict):
|
||||
request_body: CreateKeysRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateKeysRequest(BaseModel):
|
||||
request_body: Annotated[
|
||||
CreateKeysRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateKeysDataTypedDict(TypedDict):
|
||||
r"""The created API key information"""
|
||||
|
||||
|
||||
@@ -3,12 +3,93 @@
|
||||
from __future__ import annotations
|
||||
from openrouter.components import (
|
||||
openresponsesnonstreamingresponse as components_openresponsesnonstreamingresponse,
|
||||
openresponsesrequest as components_openresponsesrequest,
|
||||
openresponsesstreamevent as components_openresponsesstreamevent,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import eventstreaming
|
||||
from typing import Union
|
||||
from typing_extensions import TypeAliasType, TypedDict
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
eventstreaming,
|
||||
)
|
||||
import pydantic
|
||||
from typing import Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
class CreateResponsesGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateResponsesGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateResponsesRequestTypedDict(TypedDict):
|
||||
open_responses_request: (
|
||||
components_openresponsesrequest.OpenResponsesRequestTypedDict
|
||||
)
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateResponsesRequest(BaseModel):
|
||||
open_responses_request: Annotated[
|
||||
components_openresponsesrequest.OpenResponsesRequest,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateResponsesResponseBodyTypedDict(TypedDict):
|
||||
|
||||
@@ -2,16 +2,63 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, validate_const
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
validate_const,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import Literal
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from typing import Literal, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class DeleteGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail to delete"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteGuardrailRequest(BaseModel):
|
||||
@@ -20,6 +67,25 @@ class DeleteGuardrailRequest(BaseModel):
|
||||
]
|
||||
r"""The unique identifier of the guardrail to delete"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Guardrail deleted successfully"""
|
||||
|
||||
@@ -2,16 +2,63 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, validate_const
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
validate_const,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import Literal
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from typing import Literal, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class DeleteKeysGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteKeysGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteKeysRequestTypedDict(TypedDict):
|
||||
hash: str
|
||||
r"""The hash identifier of the API key to delete"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteKeysRequest(BaseModel):
|
||||
@@ -20,6 +67,25 @@ class DeleteKeysRequest(BaseModel):
|
||||
]
|
||||
r"""The hash identifier of the API key to delete"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class DeleteKeysResponseTypedDict(TypedDict):
|
||||
r"""API key deleted successfully"""
|
||||
|
||||
@@ -9,13 +9,52 @@ from openrouter.types import (
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
ExchangeAuthCodeForAPIKeyCodeChallengeMethod = Union[
|
||||
Literal[
|
||||
"S256",
|
||||
@@ -26,7 +65,7 @@ ExchangeAuthCodeForAPIKeyCodeChallengeMethod = Union[
|
||||
r"""The method used to generate the code challenge"""
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyRequestTypedDict(TypedDict):
|
||||
class ExchangeAuthCodeForAPIKeyRequestBodyTypedDict(TypedDict):
|
||||
code: str
|
||||
r"""The authorization code received from the OAuth redirect"""
|
||||
code_verifier: NotRequired[str]
|
||||
@@ -37,7 +76,7 @@ class ExchangeAuthCodeForAPIKeyRequestTypedDict(TypedDict):
|
||||
r"""The method used to generate the code challenge"""
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyRequest(BaseModel):
|
||||
class ExchangeAuthCodeForAPIKeyRequestBody(BaseModel):
|
||||
code: str
|
||||
r"""The authorization code received from the OAuth redirect"""
|
||||
|
||||
@@ -81,6 +120,45 @@ class ExchangeAuthCodeForAPIKeyRequest(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyRequestTypedDict(TypedDict):
|
||||
request_body: ExchangeAuthCodeForAPIKeyRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyRequest(BaseModel):
|
||||
request_body: Annotated[
|
||||
ExchangeAuthCodeForAPIKeyRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ExchangeAuthCodeForAPIKeyResponseTypedDict(TypedDict):
|
||||
r"""Successfully exchanged code for an API key"""
|
||||
|
||||
|
||||
@@ -2,7 +2,76 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from typing_extensions import TypedDict
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetCreditsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCreditsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCreditsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCreditsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCreditsDataTypedDict(TypedDict):
|
||||
|
||||
@@ -9,11 +9,79 @@ from openrouter.types import (
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict, deprecated
|
||||
|
||||
|
||||
class GetCurrentKeyGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCurrentKeyGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCurrentKeyRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetCurrentKeyRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@deprecated(
|
||||
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
||||
)
|
||||
@@ -69,8 +137,10 @@ class GetCurrentKeyDataTypedDict(TypedDict):
|
||||
r"""External BYOK usage (in USD) for current UTC month"""
|
||||
is_free_tier: bool
|
||||
r"""Whether this is a free tier API key"""
|
||||
is_management_key: bool
|
||||
r"""Whether this is a management key"""
|
||||
is_provisioning_key: bool
|
||||
r"""Whether this is a provisioning key"""
|
||||
r"""Whether this is a management key"""
|
||||
limit_remaining: Nullable[float]
|
||||
r"""Remaining spending limit in USD"""
|
||||
limit_reset: Nullable[str]
|
||||
@@ -119,8 +189,16 @@ class GetCurrentKeyData(BaseModel):
|
||||
is_free_tier: bool
|
||||
r"""Whether this is a free tier API key"""
|
||||
|
||||
is_provisioning_key: bool
|
||||
r"""Whether this is a provisioning key"""
|
||||
is_management_key: bool
|
||||
r"""Whether this is a management key"""
|
||||
|
||||
is_provisioning_key: Annotated[
|
||||
bool,
|
||||
pydantic.Field(
|
||||
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
||||
),
|
||||
]
|
||||
r"""Whether this is a management key"""
|
||||
|
||||
limit_remaining: Nullable[float]
|
||||
r"""Remaining spending limit in USD"""
|
||||
|
||||
@@ -2,15 +2,63 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
QueryParamMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Union
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetGenerationGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetGenerationGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetGenerationRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetGenerationRequest(BaseModel):
|
||||
@@ -18,6 +66,25 @@ class GetGenerationRequest(BaseModel):
|
||||
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
APIType = Union[
|
||||
Literal[
|
||||
@@ -29,6 +96,178 @@ APIType = Union[
|
||||
r"""Type of API used for the generation"""
|
||||
|
||||
|
||||
ProviderName = Union[
|
||||
Literal[
|
||||
"AnyScale",
|
||||
"Atoma",
|
||||
"Cent-ML",
|
||||
"CrofAI",
|
||||
"Enfer",
|
||||
"GoPomelo",
|
||||
"HuggingFace",
|
||||
"Hyperbolic 2",
|
||||
"InoCloud",
|
||||
"Kluster",
|
||||
"Lambda",
|
||||
"Lepton",
|
||||
"Lynn 2",
|
||||
"Lynn",
|
||||
"Mancer",
|
||||
"Meta",
|
||||
"Modal",
|
||||
"Nineteen",
|
||||
"OctoAI",
|
||||
"Recursal",
|
||||
"Reflection",
|
||||
"Replicate",
|
||||
"SambaNova 2",
|
||||
"SF Compute",
|
||||
"Targon",
|
||||
"Together 2",
|
||||
"Ubicloud",
|
||||
"01.AI",
|
||||
"AI21",
|
||||
"AionLabs",
|
||||
"Alibaba",
|
||||
"Ambient",
|
||||
"Amazon Bedrock",
|
||||
"Amazon Nova",
|
||||
"Anthropic",
|
||||
"Arcee AI",
|
||||
"AtlasCloud",
|
||||
"Avian",
|
||||
"Azure",
|
||||
"BaseTen",
|
||||
"BytePlus",
|
||||
"Black Forest Labs",
|
||||
"Cerebras",
|
||||
"Chutes",
|
||||
"Cirrascale",
|
||||
"Clarifai",
|
||||
"Cloudflare",
|
||||
"Cohere",
|
||||
"Crusoe",
|
||||
"DeepInfra",
|
||||
"DeepSeek",
|
||||
"Featherless",
|
||||
"Fireworks",
|
||||
"Friendli",
|
||||
"GMICloud",
|
||||
"Google",
|
||||
"Google AI Studio",
|
||||
"Groq",
|
||||
"Hyperbolic",
|
||||
"Inception",
|
||||
"Inceptron",
|
||||
"InferenceNet",
|
||||
"Infermatic",
|
||||
"Inflection",
|
||||
"Liquid",
|
||||
"Mara",
|
||||
"Mancer 2",
|
||||
"Minimax",
|
||||
"ModelRun",
|
||||
"Mistral",
|
||||
"Modular",
|
||||
"Moonshot AI",
|
||||
"Morph",
|
||||
"NCompass",
|
||||
"Nebius",
|
||||
"NextBit",
|
||||
"Novita",
|
||||
"Nvidia",
|
||||
"OpenAI",
|
||||
"OpenInference",
|
||||
"Parasail",
|
||||
"Perplexity",
|
||||
"Phala",
|
||||
"Relace",
|
||||
"SambaNova",
|
||||
"Seed",
|
||||
"SiliconFlow",
|
||||
"Sourceful",
|
||||
"StepFun",
|
||||
"Stealth",
|
||||
"StreamLake",
|
||||
"Switchpoint",
|
||||
"Together",
|
||||
"Upstage",
|
||||
"Venice",
|
||||
"WandB",
|
||||
"Xiaomi",
|
||||
"xAI",
|
||||
"Z.AI",
|
||||
"FakeProvider",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class ProviderResponseTypedDict(TypedDict):
|
||||
status: Nullable[float]
|
||||
id: NotRequired[str]
|
||||
endpoint_id: NotRequired[str]
|
||||
model_permaslug: NotRequired[str]
|
||||
provider_name: NotRequired[ProviderName]
|
||||
latency: NotRequired[float]
|
||||
is_byok: NotRequired[bool]
|
||||
|
||||
|
||||
class ProviderResponse(BaseModel):
|
||||
status: Nullable[float]
|
||||
|
||||
id: Optional[str] = None
|
||||
|
||||
endpoint_id: Optional[str] = None
|
||||
|
||||
model_permaslug: Optional[str] = None
|
||||
|
||||
provider_name: Annotated[
|
||||
Optional[ProviderName], PlainValidator(validate_open_enum(False))
|
||||
] = None
|
||||
|
||||
latency: Optional[float] = None
|
||||
|
||||
is_byok: Optional[bool] = None
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"id",
|
||||
"endpoint_id",
|
||||
"model_permaslug",
|
||||
"provider_name",
|
||||
"latency",
|
||||
"is_byok",
|
||||
]
|
||||
nullable_fields = ["status"]
|
||||
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 GetGenerationDataTypedDict(TypedDict):
|
||||
r"""Generation data"""
|
||||
|
||||
@@ -98,6 +337,8 @@ class GetGenerationDataTypedDict(TypedDict):
|
||||
r"""Type of API used for the generation"""
|
||||
router: Nullable[str]
|
||||
r"""Router used for the request (e.g., openrouter/auto)"""
|
||||
provider_responses: Nullable[List[ProviderResponseTypedDict]]
|
||||
r"""List of provider responses for this generation, including fallback attempts"""
|
||||
|
||||
|
||||
class GetGenerationData(BaseModel):
|
||||
@@ -202,6 +443,9 @@ class GetGenerationData(BaseModel):
|
||||
router: Nullable[str]
|
||||
r"""Router used for the request (e.g., openrouter/auto)"""
|
||||
|
||||
provider_responses: Nullable[List[ProviderResponse]]
|
||||
r"""List of provider responses for this generation, including fallback attempts"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
@@ -232,6 +476,7 @@ class GetGenerationData(BaseModel):
|
||||
"external_user",
|
||||
"api_type",
|
||||
"router",
|
||||
"provider_responses",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -9,16 +9,64 @@ from openrouter.types import (
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Union
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail to retrieve"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetGuardrailRequest(BaseModel):
|
||||
@@ -27,6 +75,25 @@ class GetGuardrailRequest(BaseModel):
|
||||
]
|
||||
r"""The unique identifier of the guardrail to retrieve"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
GetGuardrailResetInterval = Union[
|
||||
Literal[
|
||||
|
||||
@@ -9,14 +9,58 @@ from openrouter.types import (
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetKeyGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetKeyGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetKeyRequestTypedDict(TypedDict):
|
||||
hash: str
|
||||
r"""The hash identifier of the API key to retrieve"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetKeyRequest(BaseModel):
|
||||
@@ -25,6 +69,25 @@ class GetKeyRequest(BaseModel):
|
||||
]
|
||||
r"""The hash identifier of the API key to retrieve"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetKeyDataTypedDict(TypedDict):
|
||||
r"""The API key information"""
|
||||
|
||||
@@ -2,12 +2,51 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
QueryParamMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetModelsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetModelsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Category = Union[
|
||||
Literal[
|
||||
"programming",
|
||||
@@ -29,12 +68,40 @@ r"""Filter models by use case category"""
|
||||
|
||||
|
||||
class GetModelsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
category: NotRequired[Category]
|
||||
r"""Filter models by use case category"""
|
||||
supported_parameters: NotRequired[str]
|
||||
|
||||
|
||||
class GetModelsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
category: Annotated[
|
||||
Annotated[Optional[Category], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -3,18 +3,79 @@
|
||||
from __future__ import annotations
|
||||
from openrouter.components import activityitem as components_activityitem
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetUserActivityGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetUserActivityGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class GetUserActivityRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
date_: NotRequired[str]
|
||||
r"""Filter by a single UTC date in the last 30 days (YYYY-MM-DD format)."""
|
||||
|
||||
|
||||
class GetUserActivityRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
date_: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="date"),
|
||||
|
||||
@@ -9,13 +9,56 @@ from openrouter.types import (
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
include_disabled: NotRequired[str]
|
||||
r"""Whether to include disabled API keys in the response"""
|
||||
offset: NotRequired[str]
|
||||
@@ -23,6 +66,25 @@ class ListRequestTypedDict(TypedDict):
|
||||
|
||||
|
||||
class ListRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
include_disabled: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListEmbeddingsModelsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEmbeddingsModelsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEmbeddingsModelsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEmbeddingsModelsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
@@ -5,13 +5,57 @@ from openrouter.components import (
|
||||
listendpointsresponse as components_listendpointsresponse,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListEndpointsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsRequestTypedDict(TypedDict):
|
||||
author: str
|
||||
slug: str
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsRequest(BaseModel):
|
||||
@@ -23,6 +67,25 @@ class ListEndpointsRequest(BaseModel):
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsResponseTypedDict(TypedDict):
|
||||
r"""Returns a list of endpoints"""
|
||||
|
||||
@@ -3,8 +3,76 @@
|
||||
from __future__ import annotations
|
||||
from openrouter.components import publicendpoint as components_publicendpoint
|
||||
from openrouter.types import BaseModel
|
||||
from typing import List
|
||||
from typing_extensions import TypedDict
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListEndpointsZdrGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsZdrGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsZdrRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsZdrRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListEndpointsZdrResponseTypedDict(TypedDict):
|
||||
|
||||
@@ -2,15 +2,63 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
QueryParamMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
@@ -23,6 +71,25 @@ class ListGuardrailKeyAssignmentsRequest(BaseModel):
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -2,15 +2,63 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
QueryParamMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
@@ -23,6 +71,25 @@ class ListGuardrailMemberAssignmentsRequest(BaseModel):
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -9,14 +9,62 @@ from openrouter.types import (
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
QueryParamMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGuardrailsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGuardrailsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListGuardrailsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
@@ -24,6 +72,25 @@ class ListGuardrailsRequestTypedDict(TypedDict):
|
||||
|
||||
|
||||
class ListGuardrailsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -2,13 +2,56 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListKeyAssignmentsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListKeyAssignmentsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
@@ -16,6 +59,25 @@ class ListKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
|
||||
|
||||
class ListKeyAssignmentsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -2,13 +2,56 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListMemberAssignmentsGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListMemberAssignmentsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
@@ -16,6 +59,25 @@ class ListMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
|
||||
|
||||
class ListMemberAssignmentsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListModelsCountGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListModelsCountGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListModelsCountRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListModelsCountRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
@@ -2,8 +2,43 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, SecurityMetadata
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, SecurityMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListModelsUserGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListModelsUserGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListModelsUserSecurityTypedDict(TypedDict):
|
||||
@@ -22,3 +57,36 @@ class ListModelsUserSecurity(BaseModel):
|
||||
)
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ListModelsUserRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListModelsUserRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
@@ -8,9 +8,77 @@ from openrouter.types import (
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List
|
||||
from typing_extensions import NotRequired, TypedDict
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListProvidersGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListProvidersGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListProvidersRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListProvidersRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListProvidersDataTypedDict(TypedDict):
|
||||
|
||||
@@ -2,12 +2,96 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.components import (
|
||||
chatgenerationparams as components_chatgenerationparams,
|
||||
chatresponse as components_chatresponse,
|
||||
chatstreamingresponsechunk as components_chatstreamingresponsechunk,
|
||||
)
|
||||
from openrouter.utils import eventstreaming
|
||||
from typing import Union
|
||||
from typing_extensions import TypeAliasType
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
eventstreaming,
|
||||
)
|
||||
import pydantic
|
||||
from typing import Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
class SendChatCompletionRequestGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class SendChatCompletionRequestGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class SendChatCompletionRequestRequestTypedDict(TypedDict):
|
||||
chat_generation_params: (
|
||||
components_chatgenerationparams.ChatGenerationParamsTypedDict
|
||||
)
|
||||
r"""Chat completion request parameters"""
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class SendChatCompletionRequestRequest(BaseModel):
|
||||
chat_generation_params: Annotated[
|
||||
components_chatgenerationparams.ChatGenerationParams,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
r"""Chat completion request parameters"""
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
SendChatCompletionRequestResponseTypedDict = TypeAliasType(
|
||||
|
||||
@@ -11,16 +11,51 @@ from openrouter.types import (
|
||||
)
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class UpdateGuardrailGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class UpdateGuardrailGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
UpdateGuardrailResetIntervalRequest = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
@@ -124,6 +159,15 @@ class UpdateGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail to update"""
|
||||
request_body: UpdateGuardrailRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class UpdateGuardrailRequest(BaseModel):
|
||||
@@ -137,6 +181,25 @@ class UpdateGuardrailRequest(BaseModel):
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
UpdateGuardrailResetIntervalResponse = Union[
|
||||
Literal[
|
||||
|
||||
@@ -12,16 +12,51 @@ from openrouter.types import (
|
||||
)
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class UpdateKeysGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class UpdateKeysGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
UpdateKeysLimitReset = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
@@ -106,6 +141,15 @@ class UpdateKeysRequestTypedDict(TypedDict):
|
||||
hash: str
|
||||
r"""The hash identifier of the API key to update"""
|
||||
request_body: UpdateKeysRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class UpdateKeysRequest(BaseModel):
|
||||
@@ -119,6 +163,25 @@ class UpdateKeysRequest(BaseModel):
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class UpdateKeysDataTypedDict(TypedDict):
|
||||
r"""The updated API key information"""
|
||||
|
||||
@@ -15,6 +15,8 @@ class Providers(BaseSDK):
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -22,6 +24,11 @@ class Providers(BaseSDK):
|
||||
) -> operations.ListProvidersResponse:
|
||||
r"""List all providers
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -36,18 +43,28 @@ class Providers(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListProvidersRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/providers",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListProvidersGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -100,6 +117,8 @@ class Providers(BaseSDK):
|
||||
async def list_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -107,6 +126,11 @@ class Providers(BaseSDK):
|
||||
) -> operations.ListProvidersResponse:
|
||||
r"""List all providers
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
@@ -121,18 +145,28 @@ class Providers(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListProvidersRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/providers",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=False,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListProvidersGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
+178
-148
@@ -22,6 +22,8 @@ class Responses(BaseSDK):
|
||||
def send(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
input: Optional[
|
||||
Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict]
|
||||
] = None,
|
||||
@@ -84,16 +86,10 @@ class Responses(BaseSDK):
|
||||
truncation: OptionalNullable[components.Truncation] = UNSET,
|
||||
stream: Union[Literal[False], None] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.OpenResponsesRequestProvider,
|
||||
components.OpenResponsesRequestProviderTypedDict,
|
||||
]
|
||||
Union[components.Provider, components.ProviderTypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.OpenResponsesRequestPluginUnion],
|
||||
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Plugin], List[components.PluginTypedDict]]
|
||||
] = None,
|
||||
user: Optional[str] = None,
|
||||
session_id: Optional[str] = None,
|
||||
@@ -106,6 +102,11 @@ class Responses(BaseSDK):
|
||||
|
||||
Creates a streaming or non-streaming response using OpenResponses API format
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param input: Input for a response request - can be a string or array of items
|
||||
:param instructions:
|
||||
:param metadata: Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
|
||||
@@ -150,6 +151,8 @@ class Responses(BaseSDK):
|
||||
def send(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
input: Optional[
|
||||
Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict]
|
||||
] = None,
|
||||
@@ -212,16 +215,10 @@ class Responses(BaseSDK):
|
||||
truncation: OptionalNullable[components.Truncation] = UNSET,
|
||||
stream: Literal[True],
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.OpenResponsesRequestProvider,
|
||||
components.OpenResponsesRequestProviderTypedDict,
|
||||
]
|
||||
Union[components.Provider, components.ProviderTypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.OpenResponsesRequestPluginUnion],
|
||||
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Plugin], List[components.PluginTypedDict]]
|
||||
] = None,
|
||||
user: Optional[str] = None,
|
||||
session_id: Optional[str] = None,
|
||||
@@ -234,6 +231,11 @@ class Responses(BaseSDK):
|
||||
|
||||
Creates a streaming or non-streaming response using OpenResponses API format
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param input: Input for a response request - can be a string or array of items
|
||||
:param instructions:
|
||||
:param metadata: Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
|
||||
@@ -277,6 +279,8 @@ class Responses(BaseSDK):
|
||||
def send(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
input: Optional[
|
||||
Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict]
|
||||
] = None,
|
||||
@@ -339,16 +343,10 @@ class Responses(BaseSDK):
|
||||
truncation: OptionalNullable[components.Truncation] = UNSET,
|
||||
stream: Optional[bool] = False,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.OpenResponsesRequestProvider,
|
||||
components.OpenResponsesRequestProviderTypedDict,
|
||||
]
|
||||
Union[components.Provider, components.ProviderTypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.OpenResponsesRequestPluginUnion],
|
||||
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Plugin], List[components.PluginTypedDict]]
|
||||
] = None,
|
||||
user: Optional[str] = None,
|
||||
session_id: Optional[str] = None,
|
||||
@@ -361,6 +359,11 @@ class Responses(BaseSDK):
|
||||
|
||||
Creates a streaming or non-streaming response using OpenResponses API format
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param input: Input for a response request - can be a string or array of items
|
||||
:param instructions:
|
||||
:param metadata: Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
|
||||
@@ -410,56 +413,60 @@ class Responses(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.OpenResponsesRequest(
|
||||
input=utils.get_pydantic_model(
|
||||
input, Optional[components.OpenResponsesInput]
|
||||
request = operations.CreateResponsesRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
open_responses_request=components.OpenResponsesRequest(
|
||||
input=utils.get_pydantic_model(
|
||||
input, Optional[components.OpenResponsesInput]
|
||||
),
|
||||
instructions=instructions,
|
||||
metadata=metadata,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.OpenResponsesRequestToolUnion]]
|
||||
),
|
||||
tool_choice=utils.get_pydantic_model(
|
||||
tool_choice, Optional[components.OpenAIResponsesToolChoiceUnion]
|
||||
),
|
||||
parallel_tool_calls=parallel_tool_calls,
|
||||
model=model,
|
||||
models=models,
|
||||
text=utils.get_pydantic_model(
|
||||
text, Optional[components.OpenResponsesResponseText]
|
||||
),
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, OptionalNullable[components.OpenResponsesReasoningConfig]
|
||||
),
|
||||
max_output_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
top_p=top_p,
|
||||
top_logprobs=top_logprobs,
|
||||
max_tool_calls=max_tool_calls,
|
||||
presence_penalty=presence_penalty,
|
||||
frequency_penalty=frequency_penalty,
|
||||
top_k=top_k,
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
prompt_cache_key=prompt_cache_key,
|
||||
previous_response_id=previous_response_id,
|
||||
prompt=utils.get_pydantic_model(
|
||||
prompt, OptionalNullable[components.OpenAIResponsesPrompt]
|
||||
),
|
||||
include=include,
|
||||
background=background,
|
||||
safety_identifier=safety_identifier,
|
||||
service_tier=service_tier,
|
||||
truncation=truncation,
|
||||
stream=stream,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Provider]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Plugin]]
|
||||
),
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
),
|
||||
instructions=instructions,
|
||||
metadata=metadata,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.OpenResponsesRequestToolUnion]]
|
||||
),
|
||||
tool_choice=utils.get_pydantic_model(
|
||||
tool_choice, Optional[components.OpenAIResponsesToolChoiceUnion]
|
||||
),
|
||||
parallel_tool_calls=parallel_tool_calls,
|
||||
model=model,
|
||||
models=models,
|
||||
text=utils.get_pydantic_model(
|
||||
text, Optional[components.OpenResponsesResponseText]
|
||||
),
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, OptionalNullable[components.OpenResponsesReasoningConfig]
|
||||
),
|
||||
max_output_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
top_p=top_p,
|
||||
top_logprobs=top_logprobs,
|
||||
max_tool_calls=max_tool_calls,
|
||||
presence_penalty=presence_penalty,
|
||||
frequency_penalty=frequency_penalty,
|
||||
top_k=top_k,
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
prompt_cache_key=prompt_cache_key,
|
||||
previous_response_id=previous_response_id,
|
||||
prompt=utils.get_pydantic_model(
|
||||
prompt, OptionalNullable[components.OpenAIResponsesPrompt]
|
||||
),
|
||||
include=include,
|
||||
background=background,
|
||||
safety_identifier=safety_identifier,
|
||||
service_tier=service_tier,
|
||||
truncation=truncation,
|
||||
stream=stream,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.OpenResponsesRequestProvider]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
|
||||
),
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -474,9 +481,17 @@ class Responses(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="text/event-stream" if stream else "application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateResponsesGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.OpenResponsesRequest
|
||||
request.open_responses_request,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.OpenResponsesRequest,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -655,6 +670,8 @@ class Responses(BaseSDK):
|
||||
async def send_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
input: Optional[
|
||||
Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict]
|
||||
] = None,
|
||||
@@ -717,16 +734,10 @@ class Responses(BaseSDK):
|
||||
truncation: OptionalNullable[components.Truncation] = UNSET,
|
||||
stream: Union[Literal[False], None] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.OpenResponsesRequestProvider,
|
||||
components.OpenResponsesRequestProviderTypedDict,
|
||||
]
|
||||
Union[components.Provider, components.ProviderTypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.OpenResponsesRequestPluginUnion],
|
||||
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Plugin], List[components.PluginTypedDict]]
|
||||
] = None,
|
||||
user: Optional[str] = None,
|
||||
session_id: Optional[str] = None,
|
||||
@@ -739,6 +750,11 @@ class Responses(BaseSDK):
|
||||
|
||||
Creates a streaming or non-streaming response using OpenResponses API format
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param input: Input for a response request - can be a string or array of items
|
||||
:param instructions:
|
||||
:param metadata: Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
|
||||
@@ -783,6 +799,8 @@ class Responses(BaseSDK):
|
||||
async def send_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
input: Optional[
|
||||
Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict]
|
||||
] = None,
|
||||
@@ -845,16 +863,10 @@ class Responses(BaseSDK):
|
||||
truncation: OptionalNullable[components.Truncation] = UNSET,
|
||||
stream: Literal[True],
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.OpenResponsesRequestProvider,
|
||||
components.OpenResponsesRequestProviderTypedDict,
|
||||
]
|
||||
Union[components.Provider, components.ProviderTypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.OpenResponsesRequestPluginUnion],
|
||||
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Plugin], List[components.PluginTypedDict]]
|
||||
] = None,
|
||||
user: Optional[str] = None,
|
||||
session_id: Optional[str] = None,
|
||||
@@ -867,6 +879,11 @@ class Responses(BaseSDK):
|
||||
|
||||
Creates a streaming or non-streaming response using OpenResponses API format
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param input: Input for a response request - can be a string or array of items
|
||||
:param instructions:
|
||||
:param metadata: Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
|
||||
@@ -910,6 +927,8 @@ class Responses(BaseSDK):
|
||||
async def send_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
input: Optional[
|
||||
Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict]
|
||||
] = None,
|
||||
@@ -972,16 +991,10 @@ class Responses(BaseSDK):
|
||||
truncation: OptionalNullable[components.Truncation] = UNSET,
|
||||
stream: Optional[bool] = False,
|
||||
provider: OptionalNullable[
|
||||
Union[
|
||||
components.OpenResponsesRequestProvider,
|
||||
components.OpenResponsesRequestProviderTypedDict,
|
||||
]
|
||||
Union[components.Provider, components.ProviderTypedDict]
|
||||
] = UNSET,
|
||||
plugins: Optional[
|
||||
Union[
|
||||
List[components.OpenResponsesRequestPluginUnion],
|
||||
List[components.OpenResponsesRequestPluginUnionTypedDict],
|
||||
]
|
||||
Union[List[components.Plugin], List[components.PluginTypedDict]]
|
||||
] = None,
|
||||
user: Optional[str] = None,
|
||||
session_id: Optional[str] = None,
|
||||
@@ -994,6 +1007,11 @@ class Responses(BaseSDK):
|
||||
|
||||
Creates a streaming or non-streaming response using OpenResponses API format
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param input: Input for a response request - can be a string or array of items
|
||||
:param instructions:
|
||||
:param metadata: Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.
|
||||
@@ -1043,56 +1061,60 @@ class Responses(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.OpenResponsesRequest(
|
||||
input=utils.get_pydantic_model(
|
||||
input, Optional[components.OpenResponsesInput]
|
||||
request = operations.CreateResponsesRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
open_responses_request=components.OpenResponsesRequest(
|
||||
input=utils.get_pydantic_model(
|
||||
input, Optional[components.OpenResponsesInput]
|
||||
),
|
||||
instructions=instructions,
|
||||
metadata=metadata,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.OpenResponsesRequestToolUnion]]
|
||||
),
|
||||
tool_choice=utils.get_pydantic_model(
|
||||
tool_choice, Optional[components.OpenAIResponsesToolChoiceUnion]
|
||||
),
|
||||
parallel_tool_calls=parallel_tool_calls,
|
||||
model=model,
|
||||
models=models,
|
||||
text=utils.get_pydantic_model(
|
||||
text, Optional[components.OpenResponsesResponseText]
|
||||
),
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, OptionalNullable[components.OpenResponsesReasoningConfig]
|
||||
),
|
||||
max_output_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
top_p=top_p,
|
||||
top_logprobs=top_logprobs,
|
||||
max_tool_calls=max_tool_calls,
|
||||
presence_penalty=presence_penalty,
|
||||
frequency_penalty=frequency_penalty,
|
||||
top_k=top_k,
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
prompt_cache_key=prompt_cache_key,
|
||||
previous_response_id=previous_response_id,
|
||||
prompt=utils.get_pydantic_model(
|
||||
prompt, OptionalNullable[components.OpenAIResponsesPrompt]
|
||||
),
|
||||
include=include,
|
||||
background=background,
|
||||
safety_identifier=safety_identifier,
|
||||
service_tier=service_tier,
|
||||
truncation=truncation,
|
||||
stream=stream,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Provider]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Plugin]]
|
||||
),
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
),
|
||||
instructions=instructions,
|
||||
metadata=metadata,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.OpenResponsesRequestToolUnion]]
|
||||
),
|
||||
tool_choice=utils.get_pydantic_model(
|
||||
tool_choice, Optional[components.OpenAIResponsesToolChoiceUnion]
|
||||
),
|
||||
parallel_tool_calls=parallel_tool_calls,
|
||||
model=model,
|
||||
models=models,
|
||||
text=utils.get_pydantic_model(
|
||||
text, Optional[components.OpenResponsesResponseText]
|
||||
),
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, OptionalNullable[components.OpenResponsesReasoningConfig]
|
||||
),
|
||||
max_output_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
top_p=top_p,
|
||||
top_logprobs=top_logprobs,
|
||||
max_tool_calls=max_tool_calls,
|
||||
presence_penalty=presence_penalty,
|
||||
frequency_penalty=frequency_penalty,
|
||||
top_k=top_k,
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
prompt_cache_key=prompt_cache_key,
|
||||
previous_response_id=previous_response_id,
|
||||
prompt=utils.get_pydantic_model(
|
||||
prompt, OptionalNullable[components.OpenAIResponsesPrompt]
|
||||
),
|
||||
include=include,
|
||||
background=background,
|
||||
safety_identifier=safety_identifier,
|
||||
service_tier=service_tier,
|
||||
truncation=truncation,
|
||||
stream=stream,
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.OpenResponsesRequestProvider]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
|
||||
),
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -1107,9 +1129,17 @@ class Responses(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="text/event-stream" if stream else "application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateResponsesGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.OpenResponsesRequest
|
||||
request.open_responses_request,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.OpenResponsesRequest,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
@@ -20,7 +20,6 @@ if TYPE_CHECKING:
|
||||
from openrouter.api_keys import APIKeys
|
||||
from openrouter.beta import Beta
|
||||
from openrouter.chat import Chat
|
||||
from openrouter.completions import Completions
|
||||
from openrouter.credits import Credits
|
||||
from openrouter.embeddings import Embeddings
|
||||
from openrouter.endpoints import Endpoints
|
||||
@@ -32,7 +31,7 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
class OpenRouter(BaseSDK):
|
||||
r"""OpenRouter API: OpenAI-compatible Chat Completions and Completions API with additional OpenRouter features
|
||||
r"""OpenRouter API: OpenAI-compatible API with additional OpenRouter features
|
||||
https://openrouter.ai/docs - OpenRouter Documentation
|
||||
"""
|
||||
|
||||
@@ -58,7 +57,6 @@ class OpenRouter(BaseSDK):
|
||||
o_auth: "OAuth"
|
||||
r"""OAuth authentication endpoints"""
|
||||
chat: "Chat"
|
||||
completions: "Completions"
|
||||
_sub_sdk_map = {
|
||||
"beta": ("openrouter.beta", "Beta"),
|
||||
"analytics": ("openrouter.analytics", "Analytics"),
|
||||
@@ -72,7 +70,6 @@ class OpenRouter(BaseSDK):
|
||||
"guardrails": ("openrouter.guardrails", "Guardrails"),
|
||||
"o_auth": ("openrouter.oauth", "OAuth"),
|
||||
"chat": ("openrouter.chat", "Chat"),
|
||||
"completions": ("openrouter.completions", "Completions"),
|
||||
}
|
||||
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user