To start a conversation between multiple agents, instantiate AIbitat, define agents with specific roles, group them into a channel, and call .start().
In the example below, a client (human-like) asks a question, a mathematician solves it, and a reviewer confirms the result.
import {AIbitat} from 'aibitat'
import {cli} from 'aibitat/plugins'
const aibitat = new AIbitat()
.use(cli())
.agent('client', {
interrupt: 'ALWAYS',
role: 'You are a human assistant. Reply "TERMINATE" when there is a correct answer or there`s no answer to the question.',
})
.agent('mathematician', {
role: `You are a Mathematician and only solve math problems from @client`,
})
.agent('reviewer', {
role: `You are a Peer-Reviewer and you do not solve math problems.
Check the result from @mathematician and then confirm. Just confirm, no talk.`,
})
.channel('management', ['mathematician', 'reviewer', 'client'])
await aibitat.start({
from: 'client',
to: 'management',
content: 'How much is 2 + 2?',
})
console.log(aibitat.chats)
import {AIbitat} from 'aibitat'
import {cli} from 'aibitat/plugins'
const aibitat = new AIbitat()
.use(cli())
.agent('client', {
interrupt: 'ALWAYS',
role: 'You are a human assistant. Reply "TERMINATE" when there is a correct answer or there`s no answer to the question.',
})
.agent('mathematician', {
role: `You are a Mathematician and only solve math problems from @client`,
})
.agent('reviewer', {
role: `You are a Peer-Reviewer and you do not solve math problems.
Check the result from @mathematician and then confirm. Just confirm, no talk.`,
})
.channel('management', ['mathematician', 'reviewer', 'client'])
await aibitat.start({
from: 'client',
to: 'management',
content: 'How much is 2 + 2?',
})
console.log(aibitat.chats)