Praison AI
Enterprise
Agents
Bot
Use Cases
University
Docs
LLMGuardrail, retries, and budget caps
Run
from praisonai import Agent, ExecutionConfig, LLMGuardrail semantic_guard = LLMGuardrail( description='Reply must be polite, factual, and under 2 sentences.', llm='gpt-4o-mini', ) agent = Agent( name='GuardedSupport', instructions='Answer customer refund questions politely in one sentence.', execution=ExecutionConfig(max_iter=3, max_retry_limit=2, max_budget=0.25, context_compaction=True), output='silent', ) print('Guardrail:', semantic_guard.description) print('Reply :', agent.start('How long do standard refunds take?'))
Press Run. The result appears here.
Esc
Search in
All
Docs
University