Mock model for testing without real API calls.
Configured with a list of responses (either LlmResponse structs or
functions that take an LlmRequest and return an LlmResponse).
Returns them in sequence via an internal Agent process for statefulness.
Falls back to a default text response if the list is exhausted.
Summary
Functions
Creates a new Mock model with an internal Agent for stateful response tracking.
Pops the next response from the model, returning {response, updated_model}.
Types
@type response_entry() :: ADK.Model.LlmResponse.t() | response_fn()
@type response_fn() :: (ADK.Model.LlmRequest.t() -> ADK.Model.LlmResponse.t())
@type t() :: %ADK.Model.Mock{ model_name: String.t(), pid: pid() | nil, responses: [response_entry()] }
Functions
Creates a new Mock model with an internal Agent for stateful response tracking.
@spec pop_response(t(), ADK.Model.LlmRequest.t()) :: {ADK.Model.LlmResponse.t(), t()}
Pops the next response from the model, returning {response, updated_model}.
Useful for tests that need to track consumed responses.