安裝自訂依賴項
AgentBuilder 提供選用的依賴項群組和自訂依賴項支援,以擴展 AgentBuilder 功能。本指南涵蓋如何為不同的 AgentBuilder 安裝添加依賴項,包括 AgentBuilder Desktop 和 AgentBuilder OSS。
AgentBuilder 程式碼庫使用兩個 pyproject.toml 檔案來管理依賴項,一個用於 base,一個用於 main:
main套件由根層級的pyproject.toml管理,它包含最終使用者功能和主要應用程式程式碼,例如 Langchain 和 OpenAI。base套件由src/backend/base/pyproject.toml管理,它包含核心基礎設施,例如 FastAPI 網路框架。
在 AgentBuilder Desktop 中安裝自訂依賴項
要在 AgentBuilder Desktop 中添加依賴項,請將套件項目添加到應用程式的 requirements.txt 檔案中:
- 在 macOS 上,檔案位於
/Users/USER/.langflow/data/requirements.txt。 - 在 Windows 上,檔案位於
C:\Users\USER\AppData\Roaming\com.AgentBuilder\data\requirements.txt。
以 DEPENDENCY==VERSION 格式將每個依賴項添加到 requirements.txt 中的單獨行,例如 matplotlib==3.10.0。
重新啟動 AgentBuilder Desktop 以安裝依賴項。
如果您需要變更或解除安裝自訂依賴項,請編輯 requirements.txt 檔案,然後重新啟動 AgentBuilder Desktop。