mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
chore: 🐝 Update SDK - Generate 0.9.2 (#205)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev> Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
speakeasybot
speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent
0c735989c1
commit
0f116c9792
@@ -0,0 +1,127 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .observabilityfilterrulesconfig import (
|
||||
ObservabilityFilterRulesConfig,
|
||||
ObservabilityFilterRulesConfigTypedDict,
|
||||
)
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import Dict, List, Literal, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ObservabilityBraintrustDestinationConfigTypedDict(TypedDict):
|
||||
api_key: str
|
||||
project_id: str
|
||||
base_url: NotRequired[str]
|
||||
headers: NotRequired[Dict[str, str]]
|
||||
r"""Custom HTTP headers to include in requests to this destination."""
|
||||
|
||||
|
||||
class ObservabilityBraintrustDestinationConfig(BaseModel):
|
||||
api_key: Annotated[str, pydantic.Field(alias="apiKey")]
|
||||
|
||||
project_id: Annotated[str, pydantic.Field(alias="projectId")]
|
||||
|
||||
base_url: Annotated[Optional[str], pydantic.Field(alias="baseUrl")] = (
|
||||
"https://api.braintrust.dev"
|
||||
)
|
||||
|
||||
headers: Optional[Dict[str, str]] = None
|
||||
r"""Custom HTTP headers to include in requests to this destination."""
|
||||
|
||||
|
||||
ObservabilityBraintrustDestinationType = Literal["braintrust",]
|
||||
|
||||
|
||||
class ObservabilityBraintrustDestinationTypedDict(TypedDict):
|
||||
api_key_hashes: Nullable[List[str]]
|
||||
r"""Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."""
|
||||
config: ObservabilityBraintrustDestinationConfigTypedDict
|
||||
created_at: str
|
||||
r"""ISO timestamp of when the destination was created."""
|
||||
enabled: bool
|
||||
r"""Whether this destination is currently enabled."""
|
||||
filter_rules: Nullable[ObservabilityFilterRulesConfigTypedDict]
|
||||
r"""Optional structured filter rules controlling which events are forwarded."""
|
||||
id: str
|
||||
r"""Stable public identifier for this destination."""
|
||||
name: Nullable[str]
|
||||
r"""Human-readable name for the destination."""
|
||||
privacy_mode: bool
|
||||
r"""When true, request/response bodies are not forwarded to this destination — only metadata."""
|
||||
sampling_rate: float
|
||||
r"""Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%)."""
|
||||
type: ObservabilityBraintrustDestinationType
|
||||
updated_at: str
|
||||
r"""ISO timestamp of when the destination was last updated."""
|
||||
workspace_id: str
|
||||
r"""ID of the workspace this destination belongs to."""
|
||||
|
||||
|
||||
class ObservabilityBraintrustDestination(BaseModel):
|
||||
api_key_hashes: Nullable[List[str]]
|
||||
r"""Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys."""
|
||||
|
||||
config: ObservabilityBraintrustDestinationConfig
|
||||
|
||||
created_at: str
|
||||
r"""ISO timestamp of when the destination was created."""
|
||||
|
||||
enabled: bool
|
||||
r"""Whether this destination is currently enabled."""
|
||||
|
||||
filter_rules: Nullable[ObservabilityFilterRulesConfig]
|
||||
r"""Optional structured filter rules controlling which events are forwarded."""
|
||||
|
||||
id: str
|
||||
r"""Stable public identifier for this destination."""
|
||||
|
||||
name: Nullable[str]
|
||||
r"""Human-readable name for the destination."""
|
||||
|
||||
privacy_mode: bool
|
||||
r"""When true, request/response bodies are not forwarded to this destination — only metadata."""
|
||||
|
||||
sampling_rate: float
|
||||
r"""Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%)."""
|
||||
|
||||
type: ObservabilityBraintrustDestinationType
|
||||
|
||||
updated_at: str
|
||||
r"""ISO timestamp of when the destination was last updated."""
|
||||
|
||||
workspace_id: str
|
||||
r"""ID of the workspace this destination belongs to."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
nullable_fields = ["api_key_hashes", "filter_rules", "name"]
|
||||
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
|
||||
Reference in New Issue
Block a user