Mock LLM Provider • Rust AI Agent SDK
MockLlmProvider: Mock LLM provider for testing (no API calls)
MockLlmProvider
Defined in the LLM module.
Rust AI Agent SDK
Mock LLM provider for testing (no API calls)
Fields
| Name | Type | Description |
|---|---|---|
model | String | – |
responses | std::sync::Mutex<Vec<String>> | – |
tool_calls | std::sync::Mutex<Vec<Vec<ToolCall>>> | – |
Methods
new
fn new() -> SelfCreate a new mock provider
add_response
fn add_response(&self, response: impl Into<String>) -> ()Add a response to return (FIFO queue)
Parameters:
| Name | Type |
|---|---|
response | impl Into<String> |
add_tool_calls
fn add_tool_calls(&self, calls: Vec<ToolCall>) -> ()Add tool calls to return with next response
Parameters:
| Name | Type |
|---|---|
calls | Vec<ToolCall> |
with_response
fn with_response(response: impl Into<String>) -> SelfCreate with a single response
Parameters:
| Name | Type |
|---|---|
response | impl Into<String> |
Source
View on GitHubpraisonai/src/llm/mod.rs at line 393