# AUTO-GENERATED by ninja-codegen — DO NOT EDIT
# Re-run `ninjastack sync` to regenerate.
# Domain Agent for: {{ domain.name }}

from __future__ import annotations

from ninja_agents.base import DataAgent, DomainAgent
from ninja_core.schema.agent import AgentConfig, ReasoningLevel
from ninja_core.schema.domain import DomainSchema


# Domain definition for {{ domain.name }}
{{ domain.name | upper }}_DOMAIN = DomainSchema(
    name={{ domain.name | repr }},
    entities={{ domain.entities | repr }},
    agent_config=AgentConfig(
        model_provider={{ domain.agent_config.model_provider | repr }},
        model_name={{ domain.agent_config.model_name | repr }},
        reasoning_level=ReasoningLevel.{{ domain.agent_config.reasoning_level.name }},
{% if domain.agent_config.temperature != 0.7 %}
        temperature={{ domain.agent_config.temperature }},
{% endif %}
{% if domain.agent_config.system_prompt %}
        system_prompt={{ domain.agent_config.system_prompt | repr }},
{% endif %}
    ),
{% if domain.description %}
    description={{ domain.description | repr }},
{% endif %}
)

ENTITY_NAMES: list[str] = {{ domain.entities | repr }}


def create_{{ domain.name | lower }}_domain_agent(data_agents: list[DataAgent] | None = None) -> DomainAgent:
    """Create a DomainAgent for {{ domain.name }}.

    Args:
        data_agents: List of DataAgent instances for entities in this domain.
                     If None, you must provide them before using the agent.
    """
    return DomainAgent(
        domain={{ domain.name | upper }}_DOMAIN,
        data_agents=data_agents or [],
    )
