Skip to content

Commit 85b0342

Browse files
fix(tutorials): repair five tutorials that fail with a real model (#546)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6d68f3a commit 85b0342

6 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎examples/tutorials/10_async/00_base/040_other_sdks/Dockerfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y \
1515
gcc \
1616
cmake \
1717
netcat-openbsd \
18+
nodejs \
19+
npm \
1820
&& apt-get clean \
1921
&& rm -rf /var/lib/apt/lists/*
2022

‎examples/tutorials/10_async/00_base/040_other_sdks/project/acp.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ class StateModel(BaseModel):
5454
args=["-y", "@modelcontextprotocol/server-sequential-thinking"],
5555
),
5656
StdioServerParameters(
57-
command="uvx", args=["openai-websearch-mcp"], env={"OPENAI_API_KEY": os.environ.get("OPENAI_API_KEY", "")}
57+
# openai-websearch-mcp pins mcp 1.13.1, which imports a private
58+
# pydantic helper that pydantic 2.14 removed; uvx resolves pydantic
59+
# unpinned, so cap it until the server allows a newer mcp.
60+
command="uvx",
61+
args=["--with", "pydantic<2.14", "openai-websearch-mcp"],
62+
env={"OPENAI_API_KEY": os.environ.get("OPENAI_API_KEY", "")},
5863
),
5964
]
6065

‎examples/tutorials/10_async/00_base/110_pydantic_ai/project/agent.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Guidelines:
2323
- Be concise and helpful
2424
- Use tools when they would help answer the user's question
25+
- When asked for the current weather in a place, call get_weather; never answer that from memory
2526
- If you're unsure, ask clarifying questions
2627
- Always provide accurate information
2728
"""

‎examples/tutorials/10_async/10_temporal/010_agent_chat/project/workflow.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ class StateModel(BaseModel):
5555
# ),
5656
StdioServerParameters(
5757
command="uvx",
58-
args=["openai-websearch-mcp"],
58+
# openai-websearch-mcp pins mcp 1.13.1, which imports a private
59+
# pydantic helper that pydantic 2.14 removed; uvx resolves pydantic
60+
# unpinned, so cap it until the server allows a newer mcp.
61+
args=["--with", "pydantic<2.14", "openai-websearch-mcp"],
5962
env={"OPENAI_API_KEY": os.environ.get("OPENAI_API_KEY", "")},
6063
),
6164
]

‎examples/tutorials/10_async/10_temporal/020_state_machine/project/workflows/deep_research/performing_deep_research.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
# resolves ``mcp`` unpinned there, ignoring the version this project pins, so without
1919
# this constraint every server dies at import and the agent silently makes zero tool
2020
# calls. Drop the pin once the servers support mcp 2.x.
21-
_MCP_PIN = ["--with", "mcp<2"]
21+
# pydantic is capped for the same reason: openai-websearch-mcp pins mcp 1.13.1,
22+
# which imports a private pydantic helper that pydantic 2.14 removed. Drop the
23+
# cap once that server allows a newer mcp.
24+
_MCP_PIN = ["--with", "mcp<2", "--with", "pydantic<2.14"]
2225

2326
MCP_SERVERS = [
2427
StdioServerParameters(

‎examples/tutorials/10_async/10_temporal/110_pydantic_ai/project/agent.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
Guidelines:
4242
- Be concise and helpful
4343
- Use tools when they would help answer the user's question
44+
- When asked for the current weather in a place, call get_weather; never answer that from memory
4445
- If you're unsure, ask clarifying questions
4546
- Always provide accurate information
4647
"""

0 commit comments

Comments
 (0)