You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The optional `metadata` parameter can attach arbitrary context to deferred tool calls, accessible in `DeferredToolRequests.metadata` keyed by `tool_call_id`.
180
+
178
181
_(This example is complete, it can be run "as is")_
result = ModelRetry('No result for this tool call was found.')
268
272
@@ -324,8 +328,9 @@ async def main():
324
328
"""
325
329
```
326
330
327
-
1. In reality, you'd likely use Celery or a similar task queue to run the task in the background.
328
-
2. In reality, this would typically happen in a separate process that polls for the task status or is notified when all pending tasks are complete.
331
+
1. Generate a task ID that can be tracked independently of the tool call ID.
332
+
2. The optional `metadata` parameter passes the `task_id` so it can be matched with results later, accessible in `DeferredToolRequests.metadata` keyed by `tool_call_id`.
333
+
3. In reality, this would typically happen in a separate process that polls for the task status or is notified when all pending tasks are complete.
329
334
330
335
_(This example is complete, it can be run "as is" — you'll need to add `asyncio.run(main())` to run `main`)_
0 commit comments