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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .reasoning_config_schema import ReasoningConfigSchema
from .tool_configuration_schema import ToolConfigurationSchema


class AssistantResponse(UniversalBaseModel):
    """
    Full assistant response.
    """

    name: str = pydantic.Field()
    """
    Assistant name
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Assistant description
    """

    avatar_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Avatar ID
    """

    icon_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Icon ID (icon_ prefixed)
    """

    icon_type: typing.Optional[str] = pydantic.Field(default=None)
    """
    Icon type (deprecated)
    """

    icon_data: typing.Optional[str] = pydantic.Field(default=None)
    """
    Icon data (deprecated)
    """

    is_default: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Is default assistant
    """

    default_model_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    Default model key
    """

    allowed_model_providers: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Allowed model providers
    """

    allowed_models: typing.Optional[typing.Dict[str, typing.Optional[typing.List[str]]]] = pydantic.Field(default=None)
    """
    Per-provider model selection. Keys are provider slugs, values are lists of allowed model keys or null for all models from that provider. Example: {"openai": ["gpt-4o", "gpt-4o-mini"], "anthropic": null}
    """

    instructions: typing.Optional[str] = pydantic.Field(default=None)
    """
    System instructions
    """

    instructions_thread_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Instructions thread ID
    """

    system_message: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
    """
    System messages
    """

    context_strategy: typing.Optional[str] = pydantic.Field(default=None)
    """
    Context management strategy
    """

    context_window: typing.Optional[int] = pydantic.Field(default=None)
    """
    Context window size
    """

    max_tool_calls: typing.Optional[int] = pydantic.Field(default=None)
    """
    Max tool calls
    """

    parallel_tool_calls: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Allow parallel tool calls
    """

    service_tier: typing.Optional[str] = pydantic.Field(default=None)
    """
    Service tier
    """

    store_responses: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Store responses
    """

    temperature: typing.Optional[float] = pydantic.Field(default=None)
    """
    Randomness (0.0-1.0). Lower=focused, higher=creative
    """

    frequency_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Frequency penalty
    """

    presence_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Presence penalty
    """

    logit_bias: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Logit bias
    """

    top_logprobs: typing.Optional[int] = pydantic.Field(default=None)
    """
    Top log probs
    """

    top_p: typing.Optional[float] = pydantic.Field(default=None)
    """
    Top P
    """

    output_mode: typing.Optional[str] = pydantic.Field(default=None)
    """
    Output mode
    """

    response_format: typing.Optional[str] = pydantic.Field(default=None)
    """
    Response format
    """

    seed: typing.Optional[int] = pydantic.Field(default=None)
    """
    Random seed
    """

    stop_sequences: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Stop sequences
    """

    max_completion_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Max completion tokens
    """

    access_mode: typing.Optional[str] = pydantic.Field(default=None)
    """
    Access mode: private, organization, department, public
    """

    access_departments: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Department IDs with access (required when access_mode is 'department')
    """

    access_users: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    User IDs with access
    """

    editable_by_users: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    User IDs that can edit. Use ['*'] for all organization members
    """

    visible_in_chat_to_users: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    User IDs that can see assistant in chat interface
    """

    editable_by_roles: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Role IDs that can edit
    """

    visible_to_roles: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Role IDs that can view
    """

    api_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    API enabled
    """

    public_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Public enabled
    """

    is_active: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Is active
    """

    streaming: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Streaming enabled
    """

    memory_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Memory enabled
    """

    moderation_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Moderation enabled
    """

    safety_level: typing.Optional[str] = pydantic.Field(default=None)
    """
    Safety level
    """

    truncation: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Auto-truncate messages exceeding context window
    """

    preset_prompts: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Preset prompts
    """

    metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Custom metadata
    """

    text_config: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Text configuration
    """

    voice_profile_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Voice profile ID for meeting identity
    """

    id: str = pydantic.Field()
    """
    Assistant ID
    """

    organization_id: str = pydantic.Field()
    """
    Organization ID
    """

    created_by: str = pydantic.Field()
    """
    Creator user ID
    """

    created_at: int = pydantic.Field()
    """
    Creation timestamp
    """

    updated_at: int = pydantic.Field()
    """
    Update timestamp
    """

    deleted_at: typing.Optional[int] = pydantic.Field(default=None)
    """
    Deletion timestamp
    """

    icon_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Icon URL
    """

    user_access_level: typing.Optional[str] = pydantic.Field(default=None)
    """
    User's access level: owner, edit, view
    """

    tool_configurations: typing.Optional[ToolConfigurationSchema] = pydantic.Field(default=None)
    """
    Tool configurations
    """

    reasoning: typing.Optional[ReasoningConfigSchema] = pydantic.Field(default=None)
    """
    Reasoning configuration
    """

    vector_store_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Vector store IDs
    """

    slice_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Knowledge slice IDs
    """

    rule_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Attached rule IDs
    """

    tool_capabilities: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Tool capabilities (computed)
    """

    meeting_email: typing.Optional[str] = pydantic.Field(default=None)
    """
    Auto-generated meeting email address (read-only)
    """

    workflow_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Linked workflow ID (if workflow-based assistant)
    """

    workflow_version: typing.Optional[int] = pydantic.Field(default=None)
    """
    Version of linked workflow
    """

    workflow_based: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this assistant executes through a workflow
    """

    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
