初始准备
首先需要确保已安装Node.js环境(建议LTS版本)。安装过程主要通过CLI工具完成,步骤如下:
Installation steps
- Create a project: Running
npm create voltagent-app@latest my-voltagent-app
- Selection Tools: 根据提示选择包管理器(npm/yarn/pnpm)
- Access to the catalog:
cd my-voltagent-app
Environment Configuration
In the project root directory, create the.env
文件配置API密钥,例如OpenAI:
OPENAI_API_KEY=sk-proj-你的密钥
Initiation of projects
(of a computer) runnpm run dev
启动开发服务器,支持代码热更新。默认可通过http://localhost:3000
访问调试控制台。
caveat
针对不同LLM提供商需要配置相应的环境变量,详细参数参考官方文档voltagent.dev/docs。
This answer comes from the articleVoltAgent: TypeScript Open Source Framework for Rapidly Building AI IntelligentsiaThe