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