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 (spec change merged) 0.11.17 (#422)
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
e62415b7ce
commit
4a9b45c2a0
@@ -0,0 +1,62 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr
|
||||
from pydantic import model_serializer
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import NotRequired, TypedDict
|
||||
|
||||
|
||||
Category = Union[
|
||||
Literal[
|
||||
"latency",
|
||||
"incoherence",
|
||||
"incorrect_response",
|
||||
"formatting",
|
||||
"billing",
|
||||
"api_error",
|
||||
"other",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""The category of feedback being reported"""
|
||||
|
||||
|
||||
class SubmitGenerationFeedbackRequestTypedDict(TypedDict):
|
||||
r"""Structured feedback about a specific generation"""
|
||||
|
||||
category: Category
|
||||
r"""The category of feedback being reported"""
|
||||
generation_id: str
|
||||
r"""The generation to submit feedback on"""
|
||||
comment: NotRequired[str]
|
||||
r"""An optional free-text comment describing the feedback"""
|
||||
|
||||
|
||||
class SubmitGenerationFeedbackRequest(BaseModel):
|
||||
r"""Structured feedback about a specific generation"""
|
||||
|
||||
category: Category
|
||||
r"""The category of feedback being reported"""
|
||||
|
||||
generation_id: str
|
||||
r"""The generation to submit feedback on"""
|
||||
|
||||
comment: Optional[str] = None
|
||||
r"""An optional free-text comment describing the feedback"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(["comment"])
|
||||
serialized = handler(self)
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k, serialized.get(n))
|
||||
|
||||
if val != UNSET_SENTINEL:
|
||||
if val is not None or k not in optional_fields:
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
Reference in New Issue
Block a user