> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mock LLM Provider • Rust AI Agent SDK

> MockLlmProvider: Mock LLM provider for testing (no API calls)

# MockLlmProvider

> Defined in the [**LLM**](../modules/llm) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Mock LLM provider for testing (no API calls)

## Fields

| Name         | Type                                                     | Description |
| ------------ | -------------------------------------------------------- | ----------- |
| `model`      | `String`                                                 | -           |
| `responses`  | `std::sync::Mutex&lt;Vec&lt;String&gt;&gt;`              | -           |
| `tool_calls` | `std::sync::Mutex&lt;Vec&lt;Vec&lt;ToolCall&gt;&gt;&gt;` | -           |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new mock provider

### `add_response`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn add_response(&self, response: impl Into<String>) -> ()
```

Add a response to return (FIFO queue)

**Parameters:**

| Name       | Type                      |
| ---------- | ------------------------- |
| `response` | `impl Into&lt;String&gt;` |

### `add_tool_calls`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn add_tool_calls(&self, calls: Vec<ToolCall>) -> ()
```

Add tool calls to return with next response

**Parameters:**

| Name    | Type                  |
| ------- | --------------------- |
| `calls` | `Vec&lt;ToolCall&gt;` |

### `with_response`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn with_response(response: impl Into<String>) -> Self
```

Create with a single response

**Parameters:**

| Name       | Type                      |
| ---------- | ------------------------- |
| `response` | `impl Into&lt;String&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/llm/mod.rs#L393">
  `praisonai/src/llm/mod.rs` at line 393
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust LLM" icon="microchip" href="/docs/rust/llm" />

  <Card title="Rust Providers" icon="server" href="/docs/rust/providers" />

  <Card title="Rust Failover" icon="shield" href="/docs/rust/failover" />
</CardGroup>
