Skip to main content

invoke_model_context

Function invoke_model_context 

Source
pub fn invoke_model_context(messages: Vec<Message>) -> InvokeModelContext
Expand description

An InvokeModelContext for calling a model-stage handler’s logic on its own: the mock-agent view and a MockModel as in tool_context, messages, and no system prompt, tools or tool choice. Set the public fields for anything else.

use strands::Message;
use strands::testing::invoke_model_context;

let context = invoke_model_context(vec![Message::user("Hi")]);
assert_eq!(context.agent.id(), "mock-agent");
assert_eq!(context.messages.len(), 1);