Praison AI
Enterprise
Agents
Bot
Use Cases
University
Docs
Mini-project: Production-ready research & briefing agent
Run
from pydantic import BaseModel from praisonai import Agent, CachingConfig, ExecutionConfig METRICS = {'checkout': {'p95_ms': 142, 'error_rate': 0.002}} def fetch_service_metrics(service: str) -> str: """Return latency and error rate for an internal service.""" return f'{service}: {METRICS.get(service, "unknown")}' class ServiceBrief(BaseModel): service: str healthy: bool summary: str ops_agent = Agent( name='ServiceBriefAgent', instructions='Call fetch_service_metrics and return a ServiceBrief summary.', tools=[fetch_service_metrics], caching=CachingConfig(enabled=True, prompt_caching=True), execution=ExecutionConfig(max_iter=4, max_budget=0.05, context_compaction=True), output='silent', ) brief = ops_agent.chat('Check checkout service health (healthy if error_rate < 0.01)', output_pydantic=ServiceBrief) print('Verified brief:', brief.model_dump())
Press Run. The result appears here.
Esc
Search in
All
Docs
University