Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wladpaiva committed Oct 24, 2023
1 parent 2cbd76b commit 70b9fb7
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ 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`,
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.
Expand All @@ -71,7 +72,7 @@ bun run index.ts
| Feature | What it does | Status |
| ------------------ | ------------------------------------------------------ | ------ |
| Direct messages | Agents talk directly with each other. ||
| Feedback | Keep chats going until the agent interrupts the chat. ||
| Feedback | Keep chat alive until some agent interrupts the chat. ||
| Channels | Agents talk with many others, like in a Slack channel. ||
| Error handling | Manage mistakes smoothly without crashing. ||
| Function execution | Agents can execute tasks and understand the results. ||
Expand Down Expand Up @@ -141,42 +142,40 @@ By default, `maxRounds` is set to `100`.
### `.function(config)`

Functions are used to execute code and return the result to the conversation. To
use them, add them to the `function` object and add it to the `functions`
property to the node config:
use it, call the `function` method passing the definitions for the function and
add its name to the `functions` property to the node config:

```ts
const aibitat = new AIbitat({
...
}).function({
name: 'doSomething',
description: 'Let me do something for you.',
parameters: {
type: 'object',
properties: {},
},
async handler() {
return '...'
},
})
const aibitat = new AIbitat()
.agent('...', {functions: ['doSomething']})
.function({
name: 'doSomething',
description: 'Let me do something for you.',
parameters: {
type: 'object',
properties: {},
},
async handler() {
return '...'
},
})
```

The results will then be sent to the provider and returned to the conversation.

### `.use(plugin)`

Plugins are used to extend the functionality of AIbitat. They can be used to add
new features or to integrate with other services. You can create your own
plugins by implementing the `AIbitatPlugin` interface.
new features or to integrate with other services. You can create your own plugin
by implementing the `AIbitatPlugin` interface.

To use a plugin, call the `use` method:

```ts
...
import {cli} from 'aibitat/plugins'

const aibitat = new AIbitat({
...
}).use(cli())
const aibitat = new AIbitat().use(cli())
```

You can also create your own plugin by implementing the `AIbitatPlugin`
Expand Down

0 comments on commit 70b9fb7

Please sign in to comment.