Skip to content

Commit b8c3ae6

Browse files
committed
Make temporal test script work
1 parent 65388f6 commit b8c3ae6

File tree

1 file changed

+8
-0
lines changed
  • pydantic_ai_slim/pydantic_ai/durable_exec/temporal

1 file changed

+8
-0
lines changed

pydantic_ai_slim/pydantic_ai/durable_exec/temporal/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
'TemporalWrapperToolset',
3737
]
3838

39+
# We need eagerly import the anyio backends or it will happens inside workflow code and temporal has issues
40+
import anyio._backends._asyncio # pyright: ignore[reportUnusedImport]
41+
42+
try:
43+
import anyio._backends._trio # noqa F401 # pyright: ignore[reportUnusedImport]
44+
except ImportError:
45+
pass
46+
3947

4048
class PydanticAIPlugin(ClientPlugin, WorkerPlugin):
4149
"""Temporal client and worker plugin for Pydantic AI."""

0 commit comments

Comments
 (0)