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

from __future__ import annotations
from .document import Document, DocumentTypedDict
from duckyai.types import BaseModel
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class ConfigUsedTypedDict(TypedDict):
    r"""The retrieval, self-correction, and query translation config used for this generation"""


class ConfigUsed(BaseModel):
    r"""The retrieval, self-correction, and query translation config used for this generation"""


class GenerateResponseTypedDict(TypedDict):
    generation_id: NotRequired[str]
    r"""The unique identifier for the generation"""
    generated_text: NotRequired[str]
    r"""The generated response"""
    documents_used: NotRequired[List[DocumentTypedDict]]
    config_used: NotRequired[ConfigUsedTypedDict]
    r"""The retrieval, self-correction, and query translation config used for this generation"""


class GenerateResponse(BaseModel):
    generation_id: Optional[str] = None
    r"""The unique identifier for the generation"""

    generated_text: Optional[str] = None
    r"""The generated response"""

    documents_used: Optional[List[Document]] = None

    config_used: Optional[ConfigUsed] = None
    r"""The retrieval, self-correction, and query translation config used for this generation"""
