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
* Created an example with dapr-based conversation history agent
Signed-off-by: Bilgin Ibryam <[email protected]>
* Added a new example with AssistantAgent
Signed-off-by: Bilgin Ibryam <[email protected]>
* Fix for linting errors
Signed-off-by: Bilgin Ibryam <[email protected]>
---------
Signed-off-by: Bilgin Ibryam <[email protected]>
Co-authored-by: Marc Duiker <[email protected]>
Co-authored-by: Yaron Schneider <[email protected]>
Unlike simpler agents, this stateful agent exposes a RESTAPIfor workflow interactions:
280
+
281
+
#### Start a new workflow:
282
+
283
+
```bash
284
+
curl -i -X POST http://localhost:8001/start-workflow \
285
+
-H "Content-Type: application/json" \
286
+
-d '{"task": "I want to find flights to Paris"}'
287
+
```
288
+
289
+
You'll receive a workflow ID in response, which you can use to track progress.
290
+
291
+
#### Check workflow status:
292
+
293
+
```bash
294
+
# Replace WORKFLOW_ID with the ID from the previous response
295
+
curl -i -X GET http://localhost:3500/v1.0/workflows/durableTaskHub/WORKFLOW_ID
296
+
```
297
+
298
+
### How It Works
299
+
300
+
The key components of this implementation are:
301
+
302
+
1. **Persistent Memory**: The agent stores conversation state in Dapr's state store, enabling it to remember context across sessions and system restarts.
303
+
304
+
2. **Workflow Orchestration**: Long-running tasks are managed through Dapr's workflow system, providing:
305
+
- Durability - workflows survive process crashes
306
+
- Observability - track status and progress
307
+
- Recoverability - automatic retry on failures
308
+
309
+
3. **Tool Integration**: A flight search tool is defined using the `@tool` decorator, which automatically handles input validation andtype conversion.
310
+
311
+
4. **Service Exposure**: The agent exposes REST endpoints to start and manage workflows.
312
+
313
+
### 5. Simple Workflow
314
+
194
315
Run the workflow example to see how to create a multi-step LLM process:
195
316
196
317
<!--STEP
@@ -202,7 +323,7 @@ expected_stdout_lines:
202
323
output_match_mode: substring
203
324
-->
204
325
```bash
205
-
dapr run --app-id dapr-agent-wf -- python 04_chain_tasks.py
326
+
dapr run --app-id dapr-agent-wf -- python 05_chain_tasks.py
0 commit comments