"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from openrouter.types import BaseModel, Nullable
import pydantic
from pydantic import ConfigDict
from typing import Any, Dict, Optional
from typing_extensions import NotRequired, TypedDict


class TraceConfigTypedDict(TypedDict):
    r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""

    generation_name: NotRequired[str]
    parent_span_id: NotRequired[str]
    span_name: NotRequired[str]
    trace_id: NotRequired[str]
    trace_name: NotRequired[str]


class TraceConfig(BaseModel):
    r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""

    model_config = ConfigDict(
        populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
    )
    __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)

    generation_name: Optional[str] = None

    parent_span_id: Optional[str] = None

    span_name: Optional[str] = None

    trace_id: Optional[str] = None

    trace_name: Optional[str] = None

    @property
    def additional_properties(self):
        return self.__pydantic_extra__

    @additional_properties.setter
    def additional_properties(self, value):
        self.__pydantic_extra__ = value  # pyright: ignore[reportIncompatibleVariableOverride]
