错误处理
您可以在Agent 上将 exponential_backoff 设置为 True,以自动重试因第三方模型提供程序错误而失败的请求。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
语言模型是机器学习程序,经过训练以理解自然语言和代码。
from agno.agent import Agent
from agno.models.openai import OpenAIChat
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
description="Share 15 minute healthy recipes.",
markdown=True,
)
agent.print_response("Share a breakfast recipe.", stream=True)
Agent 上将 exponential_backoff 设置为 True,以自动重试因第三方模型提供程序错误而失败的请求。
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
exponential_backoff=True,
retries=2,
retry_delay=1,
)