通用命名空间更新
此重构包括对命名空间的全面更新,以提高清晰度和一致性。请密切关注以下更改:- 所有
phi
命名空间现已替换为agno
,以反映更新后的结构。 - 子模块和类已重命名,以更好地代表其功能和上下文。
接口更改
模块和命名空间更新
- Models:
phi.model.x
➔agno.models.x
- 所有模型类现在都位于
agno.models
命名空间下,将相关功能集中在同一个位置。
- 所有模型类现在都位于
- Knowledge Bases:
phi.knowledge_base.x
➔agno.knowledge.x
- 知识库已进行了重构,以便在
agno.knowledge
下更好地组织。
- 知识库已进行了重构,以便在
- Document Readers:
phi.document.reader.xxx
➔agno.document.reader.xxx_reader
- 文档阅读器现在包含一个
_reader
后缀,以增强清晰度和一致性。
- 文档阅读器现在包含一个
- Toolkits:
- 所有 Agno 工具包现在都有一个
Tools
后缀。例如:DuckDuckGo
➔DuckDuckGoTools
。- 此更改标准化了工具的命名,使其用途更加明确。
- 所有 Agno 工具包现在都有一个
多模态接口更新
多模态接口现在使用特定类型来处理不同的媒体输入和输出:输入
-
Images:
- 现在使用专门的
Image
类来表示图像,为图像处理提供额外的元数据和控制。
- 现在使用专门的
-
Audio:
- 音频文件通过
Audio
类处理,允许指定内容和格式。
- 音频文件通过
-
Video:
- 视频拥有自己的
Video
类,能够更好地处理视频数据。
- 视频拥有自己的
输出
RunResponse
现在包含更新的工件类型:-
RunResponse.images
是ImageArtifact
类型的列表: -
RunResponse.audio
是AudioArtifact
类型的列表: -
RunResponse.videos
是VideoArtifact
类型的列表: -
RunResponse.response_audio
是AudioOutput
类型:- 此响应音频对应于模型以音频格式的响应。
-
模型名称更改
Hermes
➔OllamaHermes
AzureOpenAIChat
➔AzureOpenAI
CohereChat
➔Cohere
DeepSeekChat
➔DeepSeek
GeminiOpenAIChat
➔GeminiOpenAI
HuggingFaceChat
➔HuggingFace
Storage 类更新
- Agent Storage:
PgAgentStorage
➔PostgresAgentStorage
SqlAgentStorage
➔SqliteAgentStorage
MongoAgentStorage
➔MongoDbAgentStorage
S2AgentStorage
➔SingleStoreAgentStorage
- Workflow Storage:
SqlWorkflowStorage
➔SqliteWorkflowStorage
PgWorkflowStorage
➔PostgresWorkflowStorage
MongoWorkflowStorage
➔MongoDbWorkflowStorage
Knowledge Base 更新
phi.knowledge.pdf.PDFUrlKnowledgeBase
➔agno.knowledge.pdf_url.PDFUrlKnowledgeBase
phi.knowledge.csv.CSVUrlKnowledgeBase
➔agno.knowledge.csv_url.CSVUrlKnowledgeBase
Embedders 更新
Embedders 现在都接受id
作为参数,而不是 model
。例如:
OllamaEmbedder(model="llama3.2")
->OllamaEmbedder(id="llama3.2")
Reader 更新
phi.document.reader.arxiv
➔agno.document.reader.arxiv_reader
phi.document.reader.docx
➔agno.document.reader.docx_reader
phi.document.reader.json
➔agno.document.reader.json_reader
phi.document.reader.pdf
➔agno.document.reader.pdf_reader
phi.document.reader.s3.pdf
➔agno.document.reader.s3.pdf_reader
phi.document.reader.s3.text
➔agno.document.reader.s3.text_reader
phi.document.reader.text
➔agno.document.reader.text_reader
phi.document.reader.website
➔agno.document.reader.website_reader
Agent 更新
guidelines
,prevent_hallucinations
,prevent_prompt_leakage
,limit_tool_access
, 和task
已从Agent
类中移除。您可以根据需要将它们纳入instructions
参数中。
CLI 和基础设施更新
命令行界面更改
Agno CLI 已从phi
重构为 ag
。以下是主要更改:
现在必须使用命令
ag ws up dev
和 ag ws up prod
来分别在开发模式和生产模式下启动工作空间,而不是使用 ag ws up
。新增命令
ag ping
-> 检查您是否已通过身份验证
移除命令
phi ws setup
-> 已被ag setup
取代
基础设施路径更改
已对与基础设施相关的代码进行了重新组织,以提高清晰度:- Docker Infrastructure: 已移至
/libs/infra/agno_docker
中的一个单独包,并有一个单独的 PyPi 包agno-docker
。 - AWS Infrastructure: 已移至
/libs/infra/agno_aws
中的一个单独包,并有一个单独的 PyPi 包agno-aws
。
import phi.aws.resource.xxx
➔import agno.aws.resource.xxx
import phi.docker.xxx
➔import agno.docker.xxx
请按照上述步骤确保您的代码库与最新版本的 Agno AI 兼容。如果您遇到任何问题,请随时通过 Discourse 或 Discord 与我们联系。