← 全部集成
// 集成
在 OpenAI GPT 上跑多智能体团队
经 OpenAI API 使用 GPT——默认提供方,设一个环境变量即可。
01 配置
一份最小配置。
import { OpenMultiAgent, type AgentConfig } from '@open-multi-agent/core'
const agents: AgentConfig[] = [
{ name: 'researcher', systemPrompt: 'Gather the key facts.' },
{ name: 'writer', systemPrompt: 'Write a tight summary.' },
]
// Set OPENAI_API_KEY in the environment.
const oma = new OpenMultiAgent({ defaultProvider: 'openai', defaultModel: 'gpt-4o' })
const team = oma.createTeam('brief', { name: 'brief', agents })
const result = await oma.runTeam(team, 'Summarize the latest release notes.')
console.log(result.success) 02 怎么契合
它怎么契合。
OpenAI 是默认提供方。同一个 OpenAI 适配器只要设 baseURL,也能对接任意兼容 OpenAI 的端点(Groq、OpenRouter、本地服务)——见专门的那一页集成。
// 企业服务
要把它用到生产环境?
open-multi-agent 采用 MIT 许可、可自行免费运行。当你需要在期限内交付、集成,或获得支持时,元定义科技(YuanASI)提供商业交付与支持。