← 全部集成
// 集成
在 Google Gemini 上跑多智能体团队
经原生 Google GenAI SDK 使用 Gemini——多装一个包、设一个环境变量。
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.' },
]
// npm install @google/genai — then set GEMINI_API_KEY in the environment.
const oma = new OpenMultiAgent({ defaultProvider: 'gemini', defaultModel: 'gemini-2.5-pro' })
const team = oma.createTeam('brief', { name: 'brief', agents })
const result = await oma.runTeam(team, 'Summarize the latest release notes.')
console.log(result.success) 02 怎么契合
它怎么契合。
Gemini 是内置提供方,走原生 Google GenAI SDK;它需要 peer 依赖 @google/genai。和每个提供方一样,智能体可以在一个团队里把 Gemini 与 Claude、GPT 或本地模型混用。
// 企业服务
要把它用到生产环境?
open-multi-agent 采用 MIT 许可、可自行免费运行。当你需要在期限内交付、集成,或获得支持时,元定义科技(YuanASI)提供商业交付与支持。