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

from __future__ import annotations
from opperai.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class FunctionCallConfigurationTypedDict(TypedDict):
    invocation_few_shot_count: NotRequired[int]
    r"""The number of few-shot examples to use for the call. The examples are selected using nearest neighbor search of the function's dataset for items that are similar to the input."""
    beta_evaluation_enabled: NotRequired[bool]
    r"""Whether to enable evaluation for the call. Evaluation is a beta feature and is enabled by default."""
    invocation_structured_generation_max_attempts: NotRequired[int]
    r"""The maximum number of attempts to make when generating a response matching the output schema if provided."""
    invocation_cache_ttl: NotRequired[int]
    r"""The time to live for the cache in seconds. If 0, the cache is disabled."""


class FunctionCallConfiguration(BaseModel):
    invocation_few_shot_count: Annotated[
        Optional[int], pydantic.Field(alias="invocation.few_shot.count")
    ] = 0
    r"""The number of few-shot examples to use for the call. The examples are selected using nearest neighbor search of the function's dataset for items that are similar to the input."""

    beta_evaluation_enabled: Annotated[
        Optional[bool], pydantic.Field(alias="beta.evaluation.enabled")
    ] = True
    r"""Whether to enable evaluation for the call. Evaluation is a beta feature and is enabled by default."""

    invocation_structured_generation_max_attempts: Annotated[
        Optional[int],
        pydantic.Field(alias="invocation.structured_generation.max_attempts"),
    ] = 5
    r"""The maximum number of attempts to make when generating a response matching the output schema if provided."""

    invocation_cache_ttl: Annotated[
        Optional[int], pydantic.Field(alias="invocation.cache.ttl")
    ] = 0
    r"""The time to live for the cache in seconds. If 0, the cache is disabled."""
