# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .feedback_score_public_source import FeedbackScorePublicSource
from .value_entry_public import ValueEntryPublic


class FeedbackScorePublic(UniversalBaseModel):
    """
    Aggregated feedback scores from all spans in this trace, averaged by score name
    """

    name: str
    category_name: typing.Optional[str] = None
    value: float
    reason: typing.Optional[str] = None
    source: FeedbackScorePublicSource
    created_at: typing.Optional[dt.datetime] = None
    last_updated_at: typing.Optional[dt.datetime] = None
    created_by: typing.Optional[str] = None
    last_updated_by: typing.Optional[str] = None
    value_by_author: typing.Optional[typing.Dict[str, ValueEntryPublic]] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
