Skip to content

Commit 2d3270f

Browse files
committed
chore: align docs with dapr/dapr-agents#283
Signed-off-by: Casper Nielsen <casper@diagrid.io>
1 parent 491511c commit 2d3270f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

daprdocs/content/en/developing-applications/dapr-agents/dapr-agents-core-concepts.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ async def main():
6969
)
7070
)
7171

72-
travel_planner.start()
7372
runner = AgentRunner()
7473

7574
try:
@@ -79,8 +78,7 @@ async def main():
7978
)
8079
print(itinerary)
8180
finally:
82-
travel_planner.stop()
83-
runner.shutdown()
81+
runner.shutdown(travel_planner)
8482

8583
```
8684
This example demonstrates creating a workflow-backed agent that runs autonomously in the background. The `AgentRunner` schedules the workflow for you, waits for completion, and ensures the agent can be triggered once yet continue execution across restarts.
@@ -267,15 +265,14 @@ travel_planner = DurableAgent(
267265
],
268266
tools=[search_flights],
269267
)
270-
travel_planner.start()
271268
runner = AgentRunner()
272269
```
273270

274271
The snippets below reuse this `travel_planner` instance to illustrate each mode.
275272

276273
#### 1. Ad-hoc execution with `runner.run(...)`
277274

278-
Use `run` when you want to trigger a durable workflow directly from Python code (tests, CLIs, notebooks, etc.). The runner locates the agent's `@workflow_entry`, schedules it, and optionally waits for completion. Call `travel_planner.start()` first so the workflow runtime is registered.
275+
Use `run` when you want to trigger a durable workflow directly from Python code (tests, CLIs, notebooks, etc.). The runner locates the agent's `@workflow_entry`, schedules it, and optionally waits for completion.
279276

280277
```python
281278
result = await runner.run(
@@ -520,16 +517,14 @@ frodo = DurableAgent(
520517
)
521518
),
522519
)
523-
frodo.start()
524520

525521
async def main():
526522
runner = AgentRunner()
527523
try:
528524
runner.subscribe(frodo)
529525
await wait_for_shutdown()
530526
finally:
531-
runner.shutdown()
532-
frodo.stop()
527+
runner.shutdown(frodo)
533528

534529
asyncio.run(main())
535530
```
@@ -570,7 +565,6 @@ llm_orchestrator = LLMOrchestrator(
570565
execution=AgentExecutionConfig(max_iterations=3),
571566
runtime=wf.WorkflowRuntime(),
572567
)
573-
llm_orchestrator.start()
574568

575569
runner = AgentRunner()
576570
runner.serve(llm_orchestrator, port=8004)

daprdocs/content/en/developing-applications/dapr-agents/dapr-agents-patterns.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ travel_planner = DurableAgent(
408408
)
409409

410410
async def main():
411-
travel_planner.start()
412411
runner = AgentRunner()
413412
try:
414413
result = await runner.run(
@@ -417,8 +416,7 @@ async def main():
417416
)
418417
print(result)
419418
finally:
420-
runner.shutdown()
421-
travel_planner.stop()
419+
runner.shutdown(travel_planner)
422420

423421
asyncio.run(main())
424422
```

0 commit comments

Comments
 (0)