import os

from .utils import APIProvider


class Config:
    # Feasibility gate settings
    gate_model: str = os.getenv("POINTER_GATE_AGENT_MODEL", "claude-sonnet-4-6")
    gate_max_steps: int = int(os.getenv("POINTER_GATE_AGENT_MAX_STEPS", 20))
    gate_effort: str = os.getenv("POINTER_GATE_AGENT_EFFORT_LEVEL", "high")
    gate_n_recent_images: int = int(os.getenv("POINTER_GATE_AGENT_N_RECENT_IMAGES", 5))

    # Planner settings
    planner_model: str = os.getenv("POINTER_PLANNER_AGENT_MODEL", "claude-sonnet-4-6")
    planner_max_steps: int = int(os.getenv("POINTER_PLANNER_AGENT_MAX_STEPS", 20))
    planner_effort: str = os.getenv("POINTER_PLANNER_AGENT_EFFORT_LEVEL", "max")
    planner_n_recent_images: int = int(os.getenv("POINTER_PLANNER_AGENT_N_RECENT_IMAGES", 3))
    max_replan_count: int = int(os.getenv("POINTER_MAX_REPLAN_COUNT", 1))

    # Executor settings
    executor_model: str = os.getenv("POINTER_EXECUTOR_AGENT_MODEL", "claude-opus-4-7")
    executor_max_steps: int = int(os.getenv("POINTER_EXECUTOR_AGENT_MAX_STEPS", 20))
    executor_effort: str = os.getenv("POINTER_EXECUTOR_AGENT_EFFORT_LEVEL", "max")
    executor_n_recent_images: int = int(os.getenv("POINTER_EXECUTOR_AGENT_N_RECENT_IMAGES", 5))

    verifier_model: str = os.getenv("POINTER_VERIFIER_AGENT_MODEL", "claude-sonnet-4-6")
    verifier_max_steps: int = int(os.getenv("POINTER_VERIFIER_AGENT_MAX_STEPS", 50))
    verifier_effort: str = os.getenv("POINTER_VERIFIER_AGENT_EFFORT_LEVEL", "max")
    verifier_n_recent_images: int = int(os.getenv("POINTER_VERIFIER_AGENT_N_RECENT_IMAGES", 3))

    provider: APIProvider = APIProvider.BEDROCK
    max_tokens: int = os.getenv("POINTER_MAX_TOKENS", 4096)
    summarization_model: str = os.getenv("POINTER_SUMMARIZATION_MODEL", "claude-haiku-4-5")
    max_input_token_threshold: int = int(os.environ.get("POINTER_MAX_INPUT_TOKEN_THRESHOLD", 256_000))


config = Config()
