语言模型是机器学习程序,经过训练以理解自然语言和代码。
模型充当 Agent 的大脑 - 帮助它进行推理、行动并响应用户。模型越好,Agent 就越智能。
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
exponential_backoff
True
agent = Agent( model=OpenAIChat(id="gpt-4o"), exponential_backoff=True, retries=2, retry_delay=1, )
Agno 支持以下模型提供程序: