> ## 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.

# Before LLM Call • Rust AI Agent SDK

> before_llm_call: Called before LLM call

# before\_llm\_call

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**LLMPluginProtocol**](../classes/LLMPluginProtocol) class in the [**plugins**](../modules/plugins) module.

Called before LLM call

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def before_llm_call(&self, _messages: &[LLMMessage]) -> Result<Option<Vec<LLMMessage>>, String>
```

## Parameters

<ParamField query="_messages" type="&" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Result<Option<Vec<LLMMessage>>, String>">
  The result of the operation.
</ResponseField>

***

## 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>
