from __future__ import annotations

from ..models import ProviderResponse, ToolProposal
from ..scenarios import Scenario
from .base import ProviderAdapter


class MockAdapter(ProviderAdapter):
    provider = "mock"

    def __init__(self) -> None:
        super().__init__(model="deterministic-mock-v1", api_key="")

    def propose(self, scenario: Scenario) -> ProviderResponse:
        call = scenario.proposed_call
        proposal = ToolProposal(
            name="propose_action",
            arguments=call.as_dict(),
            call_id=call.call_id or scenario.scenario_id,
        )
        return ProviderResponse(
            provider=self.provider,
            model=self.model,
            text="",
            proposals=(proposal,),
            input_tokens=0,
            output_tokens=0,
            raw_stop_reason="tool_call",
        )

