LLM Guardrail • Rust AI Agent SDK
LLMGuardrail: LLM-based guardrail for content validation
LLMGuardrail
Defined in the extras module.
Rust AI Agent SDK
LLM-based guardrail for content validation
Fields
| Name | Type | Description |
|---|---|---|
name | String | Name of the guardrail |
description | String | Description of what the guardrail checks |
prompt_template | String | The prompt template for the LLM check |
model | String | Model to use for the guardrail check |
block_on_failure | bool | Whether to block on failure |
Methods
new
fn new(name: impl Into<String>, description: impl Into<String>) -> SelfCreate a new LLM guardrail
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
description | impl Into<String> |
with_prompt
fn with_prompt(mut self, prompt: impl Into<String>) -> SelfSet the prompt template
Parameters:
| Name | Type |
|---|---|
prompt | impl Into<String> |
with_model
fn with_model(mut self, model: impl Into<String>) -> SelfSet the model
Parameters:
| Name | Type |
|---|---|
model | impl Into<String> |
block_on_failure
fn block_on_failure(mut self, block: bool) -> SelfSet whether to block on failure
Parameters:
| Name | Type |
|---|---|
block | bool |
Source
View on GitHubpraisonai/src/parity/extras.rs at line 260