Skip to content

Commit

Permalink
Add note about async tools
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Jan 17, 2024
1 parent e7fa2ef commit 74c3899
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/docs/interactive/assistants.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@ async with Assistant(name='Marvin') as ai:
await ai.say_async('hi')
```

In addition, assistants can use `async` tools, even when called with the sync API. To do so, simply pass an async function to the `tools` parameter:

```python
async def secret_message():
return "The answer is 42"

ai = Assistant(tools=[secret_message])
ai.say("What's the secret message?")
# 42
```


## Threads

Expand Down

0 comments on commit 74c3899

Please sign in to comment.