Skip to content

Commit 64e0ee2

Browse files
committed
Expose strict_json_schema in activity_as_tool
1 parent 634c5ec commit 64e0ee2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

temporalio/contrib/openai_agents/workflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def activity_as_tool(
4444
versioning_intent: Optional[VersioningIntent] = None,
4545
summary: Optional[str] = None,
4646
priority: Priority = Priority.default,
47+
strict_json_schema: bool = True,
4748
) -> Tool:
4849
"""Convert a single Temporal activity function to an OpenAI agent tool.
4950
@@ -59,6 +60,7 @@ def activity_as_tool(
5960
6061
Args:
6162
fn: A Temporal activity function to convert to a tool.
63+
strict_json_schema: Whether the tool should follow a strict schema
6264
For other arguments, refer to :py:mod:`workflow` :py:meth:`start_activity`
6365
6466
Returns:
@@ -149,7 +151,7 @@ async def run_activity(ctx: RunContextWrapper[Any], input: str) -> Any:
149151
description=schema.description or "",
150152
params_json_schema=schema.params_json_schema,
151153
on_invoke_tool=run_activity,
152-
strict_json_schema=True,
154+
strict_json_schema=strict_json_schema,
153155
)
154156

155157

uv.lock

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

0 commit comments

Comments
 (0)