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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .embedding_model_enum import EmbeddingModelEnum


class GetOrCreateRagIndexRequestModel(UncheckedBaseModel):
    document_id: str = pydantic.Field()
    """
    ID of the knowledgebase document for which to retrieve the index
    """

    create_if_missing: bool = pydantic.Field()
    """
    Whether to create the RAG index if it does not exist
    """

    model: EmbeddingModelEnum = pydantic.Field()
    """
    Embedding model to use for the RAG index
    """

    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
