"""Simple agent that executes evaluation using the built-in EvalEngine."""

from typing import Optional

from agenteval.agents.base import EvalAgent, ProgressCallback
from agenteval.channels.base import EvalChannel
from agenteval.evaluation.engine import EvalEngine
from agenteval.models import EvalRun, EvalTarget, Scenario


class SimpleAgent(EvalAgent):
    """Default agent that delegates execution to EvalEngine."""

    async def run(
        self,
        target: EvalTarget,
        scenario: Scenario,
        channel: EvalChannel,
        progress_callback: Optional[ProgressCallback] = None,
    ) -> EvalRun:
        engine = EvalEngine(target=target, scenario=scenario)
        engine.channel = channel
        return await engine.run(progress_callback=progress_callback)
