Skip to content

Commit c1b0456

Browse files
authored
Merge branch 'main' into setting-prefix
2 parents 9a92b7b + 6e95089 commit c1b0456

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/docs/interactive/assistants.md

+11
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,17 @@ async with Assistant(name='Marvin') as ai:
238238
await ai.say_async('hi')
239239
```
240240

241+
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:
242+
243+
```python
244+
async def secret_message():
245+
return "The answer is 42"
246+
247+
ai = Assistant(tools=[secret_message])
248+
ai.say("What's the secret message?")
249+
# 42
250+
```
251+
241252

242253
## Threads
243254

0 commit comments

Comments
 (0)