latest updates

This commit is contained in:
Matt Apperson
2025-12-04 10:46:19 -05:00
parent a1dae775cb
commit 6cd0d2a76d
84 changed files with 9465 additions and 8751 deletions
+8 -22
View File
@@ -1,7 +1,6 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from .basesdk import BaseSDK
from enum import Enum
from openrouter import components, errors, operations, utils
from openrouter._hooks import HookContext
from openrouter.types import OptionalNullable, UNSET
@@ -10,11 +9,6 @@ from openrouter.utils.unmarshal_json_response import unmarshal_json_response
from typing import Any, Mapping, Optional, Union
class GenerateAcceptEnum(str, Enum):
APPLICATION_JSON = "application/json"
TEXT_EVENT_STREAM = "text/event-stream"
class Embeddings(BaseSDK):
r"""Text embedding endpoints"""
@@ -36,7 +30,6 @@ class Embeddings(BaseSDK):
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
accept_header_override: Optional[GenerateAcceptEnum] = None,
http_headers: Optional[Mapping[str, str]] = None,
) -> operations.CreateEmbeddingsResponse:
r"""Submit an embedding request
@@ -53,7 +46,6 @@ class Embeddings(BaseSDK):
: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 accept_header_override: Override the default accept header for this method
:param http_headers: Additional headers to set or replace on requests.
"""
base_url = None
@@ -88,14 +80,13 @@ class Embeddings(BaseSDK):
request_has_path_params=False,
request_has_query_params=True,
user_agent_header="user-agent",
accept_header_value=accept_header_override.value
if accept_header_override is not None
else "application/json;q=1, text/event-stream;q=0",
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", operations.CreateEmbeddingsRequest
),
allow_empty_value=None,
timeout_ms=timeout_ms,
)
@@ -138,10 +129,8 @@ class Embeddings(BaseSDK):
response_data: Any = None
if utils.match_response(http_res, "200", "application/json"):
return unmarshal_json_response(
operations.CreateEmbeddingsResponseBody, http_res
operations.CreateEmbeddingsResponse, http_res
)
if utils.match_response(http_res, "200", "text/event-stream"):
return http_res.text
if utils.match_response(http_res, "400", "application/json"):
response_data = unmarshal_json_response(
errors.BadRequestResponseErrorData, http_res
@@ -223,7 +212,6 @@ class Embeddings(BaseSDK):
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
accept_header_override: Optional[GenerateAcceptEnum] = None,
http_headers: Optional[Mapping[str, str]] = None,
) -> operations.CreateEmbeddingsResponse:
r"""Submit an embedding request
@@ -240,7 +228,6 @@ class Embeddings(BaseSDK):
: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 accept_header_override: Override the default accept header for this method
:param http_headers: Additional headers to set or replace on requests.
"""
base_url = None
@@ -275,14 +262,13 @@ class Embeddings(BaseSDK):
request_has_path_params=False,
request_has_query_params=True,
user_agent_header="user-agent",
accept_header_value=accept_header_override.value
if accept_header_override is not None
else "application/json;q=1, text/event-stream;q=0",
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", operations.CreateEmbeddingsRequest
),
allow_empty_value=None,
timeout_ms=timeout_ms,
)
@@ -325,10 +311,8 @@ class Embeddings(BaseSDK):
response_data: Any = None
if utils.match_response(http_res, "200", "application/json"):
return unmarshal_json_response(
operations.CreateEmbeddingsResponseBody, http_res
operations.CreateEmbeddingsResponse, http_res
)
if utils.match_response(http_res, "200", "text/event-stream"):
return http_res.text
if utils.match_response(http_res, "400", "application/json"):
response_data = unmarshal_json_response(
errors.BadRequestResponseErrorData, http_res
@@ -431,6 +415,7 @@ class Embeddings(BaseSDK):
accept_header_value="application/json",
http_headers=http_headers,
security=self.sdk_configuration.security,
allow_empty_value=None,
timeout_ms=timeout_ms,
)
@@ -522,6 +507,7 @@ class Embeddings(BaseSDK):
accept_header_value="application/json",
http_headers=http_headers,
security=self.sdk_configuration.security,
allow_empty_value=None,
timeout_ms=timeout_ms,
)