Skip to content

Commit 7fb0723

Browse files
committed
use gateway in temporal example, uprev pydantic-ai
1 parent 17b3c53 commit 7fb0723

File tree

4 files changed

+43
-24
lines changed

4 files changed

+43
-24
lines changed

durable-exec/deep_research_temporal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async def deep_research_durable(query: str):
132132
print('resuming existing workflow', resume_id)
133133
summary = await client.get_workflow_handle(resume_id).result() # type: ignore[ReportUnknownMemberType]
134134
else:
135-
summary = await client.execute_workflow( # type: ignore[ReportUnknownMemberType]
135+
summary = await client.execute_workflow(
136136
DeepResearchWorkflow.run,
137137
args=[query],
138138
id=f'deep_research-{uuid.uuid4()}',

durable-exec/twenty_questions_temporal.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
secret = 'potato'
1919

2020
answerer_agent = Agent(
21-
'anthropic:claude-3-5-haiku-latest',
21+
'gateway/anthropic:claude-3-5-haiku-latest',
2222
instructions=f"""
2323
You are playing a question and answer game.
2424
Your job is to answer yes/no questions about the secret object truthfully.
@@ -34,7 +34,7 @@
3434

3535
# Agent that asks questions to guess the object
3636
questioner_agent = Agent(
37-
'anthropic:claude-sonnet-4-5',
37+
'gateway/anthropic:claude-sonnet-4-5',
3838
instructions="""
3939
You are playing a question and answer game. You need to guess what object the other player is thinking of.
4040
Your job is to ask yes/no questions to narrow down the possibilities.
@@ -83,9 +83,11 @@ async def play(resume_id: str | None):
8383
print('resuming existing workflow', resume_id)
8484
await client.get_workflow_handle(resume_id).result() # type: ignore[ReportUnknownMemberType]
8585
else:
86+
workflow_id = f'twenty_questions-{uuid.uuid4()}'
87+
print(f'{workflow_id=}')
8688
await client.execute_workflow(
8789
TwentyQuestionsWorkflow.run,
88-
id=f'twenty_questions-{uuid.uuid4()}',
90+
id=workflow_id,
8991
task_queue='twenty_questions',
9092
)
9193

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies = [
1010
"fastapi>=0.115.14",
1111
"logfire[asyncpg,fastapi,httpx]>=4.10",
1212
"mcp>=1.15.0",
13-
"pydantic-ai>=1.20.0",
13+
"pydantic-ai>=1.22.0",
1414
"tavily-python>=0.7.12",
1515
"dbos>=2",
1616
]

uv.lock

Lines changed: 36 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)