- 1단계: 프로젝트 디렉터리에서 npm install openai-swarm-node를 실행하세요.
- 2단계: Swarm 클래스를 import하세요: import { Swarm } from 'openai-swarm-node'
- 3단계: 군집 인스턴스를 초기화하세요: const swarm = new Swarm({ model: 'gpt-4', agents: 5, strategy: 'majority' })
- 4단계: const result = await swarm.ask('여기에 프롬프트 입력')를 호출하여 컨센서스 응답을 얻습니다.
- 5단계: 집계된 결과를 처리하고 애플리케이션에 통합하세요.