Files
openrouter-python-sdk-retry…/src/openrouter/components/submitgenerationfeedbackrequest.py
T
github-actions[bot]GitHubspeakeasybotspeakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
4a9b45c2a0 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>
2026-07-09 21:39:01 +00:00

63 lines
1.7 KiB
Python

"""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