"""
First prototype of a reasoner agent

using reasoner as a tool call

support meta agent may better @cybersentry.sdk.agents.meta.reasoner_support
"""
from cybersentry.tools.misc.reasoning import think
from cybersentry.sdk.agents import Agent, OpenAIChatCompletionsModel  # pylint: disable=import-error
from openai import AsyncOpenAI
from cybersentry.util import load_prompt_template, create_system_prompt_renderer
import os

thought_agent_system_prompt = load_prompt_template("prompts/system_thought_router.md")

# Thought Process Agent for analysis and planning
thought_agent = Agent(
    name="ThoughtAgent",
    model=OpenAIChatCompletionsModel(
        model=os.getenv('CYBERSENTRY_MODEL', "cybe4sent1nel0"),
        openai_client=AsyncOpenAI(),
    ),
    description="""Agent focused on analyzing and planning the next steps
                   in a security assessment or CTF challenge.""",
    instructions=create_system_prompt_renderer(thought_agent_system_prompt),
    tools=[think],
)
