Skip to content

Commit 9d3c90a

Browse files
committed
chore(ag-ui): improve example instructions and docs
Improve the agent instructions for more reliable execution and update the documentation with more examples and formatting fixes.
1 parent 9941800 commit 9d3c90a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

examples/pydantic_ai_ag_ui_examples/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ What is the time in New York?
5858
Change the background to blue
5959
```
6060

61+
A complex example which mixes both AG-UI and PydanticAI tools:
62+
63+
```text
64+
Perform the following steps, waiting for the response of each step before continuing:
65+
1. Get the time
66+
2. Set the background to red
67+
3. Get the time
68+
4. Report how long the background set took by diffing the two times
69+
```
70+
6171
### [Agentic Generative UI](http://localhost:3000/pydantic-ai/feature/agentic_generative_ui)
6272

6373
Demonstrates a long running task where the agent sends updates to the frontend
@@ -108,8 +118,7 @@ Bruce was a good dog,
108118
Agent prompt
109119
110120
```text
111-
Help me complete my story about bruce the dog, is should be no longer than a
112-
sentence.
121+
Help me complete my story about bruce the dog, is should be no longer than a sentence.
113122
```
114123
115124
### [Shared State](http://localhost:3000/pydantic-ai/feature/shared_state)

examples/pydantic_ai_ag_ui_examples/api/human_in_the_loop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
instructions: str = """When planning tasks use tools only, without any other messages.
2222
IMPORTANT:
23-
- Use the `human_in_the_loop` tool to display the suggested steps to the user
23+
- Use the `generate_task_steps` tool to display the suggested steps to the user
2424
- Never repeat the plan, or send a message detailing steps
2525
- If accepted, confirm the creation of the plan and the number of selected (enabled) steps only
26-
- If rejected, ask the user for additional information
26+
- If not accepted, ask the user for more information, DO NOT use the `generate_task_steps` tool again
2727
"""
2828
router: APIRouter = APIRouter(prefix='/human_in_the_loop')
2929
agui: AGUIAgent = AGUIAgent(instructions=instructions)

0 commit comments

Comments
 (0)