Skip to content

Commit 8f003b4

Browse files
authored
Remove experimental notices from openai agents except otel integration (#1382)
* Remove experimental notices from openai agents except otel integration * Fix indentation * More docstyle fixing
1 parent 164096b commit 8f003b4

File tree

5 files changed

+20
-142
lines changed

5 files changed

+20
-142
lines changed

temporalio/contrib/openai_agents/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
33
This module provides compatibility between the
44
`OpenAI Agents SDK <https://github.com/openai/openai-agents-python>`_ and Temporal workflows.
5-
6-
.. warning::
7-
This module is experimental and may change in future versions.
8-
Use with caution in production environments.
95
"""
106

117
from temporalio.contrib.openai_agents._mcp import (

temporalio/contrib/openai_agents/_temporal_openai_agents.py

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,10 @@
4444

4545

4646
@contextmanager
47-
def set_open_ai_agent_temporal_overrides(
47+
def _set_open_ai_agent_temporal_overrides(
4848
model_params: ModelActivityParameters,
4949
start_spans_in_replay: bool = False,
5050
):
51-
"""Configure Temporal-specific overrides for OpenAI agents.
52-
53-
.. warning::
54-
This API is experimental and may change in future versions.
55-
Use with caution in production environments. Future versions may wrap the worker directly
56-
instead of requiring this context manager.
57-
58-
This context manager sets up the necessary Temporal-specific runners and trace providers
59-
for running OpenAI agents within Temporal workflows. It should be called in the main
60-
entry point of your application before initializing the Temporal client and worker.
61-
62-
The context manager handles:
63-
1. Setting up a Temporal-specific runner for OpenAI agents
64-
2. Configuring a Temporal-aware trace provider
65-
3. Restoring previous settings when the context exits
66-
67-
Args:
68-
model_params: Configuration parameters for Temporal activity execution of model calls.
69-
start_spans_in_replay: If set to true, start spans even during replay. Primarily used for otel integration.
70-
71-
Returns:
72-
A context manager that yields the configured TemporalTraceProvider.
73-
"""
7451
previous_runner = get_default_agent_runner()
7552
previous_trace_provider = get_trace_provider()
7653
provider = TemporalTraceProvider(
@@ -111,10 +88,6 @@ def _data_converter(converter: DataConverter | None) -> DataConverter:
11188
class OpenAIAgentsPlugin(SimplePlugin):
11289
"""Temporal plugin for integrating OpenAI agents with Temporal workflows.
11390
114-
.. warning::
115-
This class is experimental and may change in future versions.
116-
Use with caution in production environments.
117-
11891
This plugin provides seamless integration between the OpenAI Agents SDK and
11992
Temporal workflows. It automatically configures the necessary interceptors,
12093
activities, and data converters to enable OpenAI agents to run within
@@ -127,16 +100,6 @@ class OpenAIAgentsPlugin(SimplePlugin):
127100
4. Automatically registers MCP server activities and manages their lifecycles
128101
5. Manages the OpenAI agent runtime overrides during worker execution
129102
130-
Args:
131-
model_params: Configuration parameters for Temporal activity execution
132-
of model calls. If None, default parameters will be used.
133-
model_provider: Optional model provider for custom model implementations.
134-
Useful for testing or custom model integrations.
135-
mcp_server_providers: Sequence of MCP servers to automatically register with the worker.
136-
The plugin will wrap each server in a TemporalMCPServer if needed and
137-
manage their connection lifecycles tied to the worker lifetime. This is
138-
the recommended way to use MCP servers with Temporal workflows.
139-
140103
Example:
141104
>>> from temporalio.client import Client
142105
>>> from temporalio.worker import Worker
@@ -201,6 +164,9 @@ def __init__(
201164
but should not be disabled on all workers, or agents will not be able to progress.
202165
add_temporal_spans: Whether to add temporal spans to traces
203166
use_otel_instrumentation: If set to true, enable open telemetry instrumentation.
167+
Warning: use_otel_instrumentation is experimental and behavior may change in future versions.
168+
Use with caution in production environments.
169+
204170
"""
205171
if model_params is None:
206172
model_params = ModelActivityParameters()
@@ -280,7 +246,7 @@ def workflow_runner(runner: WorkflowRunner | None) -> WorkflowRunner:
280246
@asynccontextmanager
281247
async def run_context() -> AsyncIterator[None]:
282248
with self.tracing_context():
283-
with set_open_ai_agent_temporal_overrides(
249+
with _set_open_ai_agent_temporal_overrides(
284250
model_params, start_spans_in_replay=use_otel_instrumentation
285251
):
286252
yield

temporalio/contrib/openai_agents/_trace_interceptor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ class OpenAIAgentsContextPropagationInterceptor(
6565
):
6666
"""Interceptor that propagates OpenAI agent tracing context through Temporal workflows and activities.
6767
68-
.. warning::
69-
This API is experimental and may change in future versions.
70-
Use with caution in production environments.
71-
7268
This interceptor enables tracing of OpenAI agent operations across Temporal workflows
7369
and activities. It propagates trace context through workflow and activity boundaries,
7470
allowing for end-to-end tracing of agent operations.

temporalio/contrib/openai_agents/testing.py

Lines changed: 14 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,11 @@
3939

4040

4141
class ResponseBuilders:
42-
"""Builders for creating model responses for testing.
43-
44-
.. warning::
45-
This API is experimental and may change in the future.
46-
"""
42+
"""Builders for creating model responses for testing."""
4743

4844
@staticmethod
4945
def model_response(output: TResponseOutputItem) -> ModelResponse:
50-
"""Create a ModelResponse with the given output.
51-
52-
.. warning::
53-
This API is experimental and may change in the future.
54-
"""
46+
"""Create a ModelResponse with the given output."""
5547
return ModelResponse(
5648
output=[output],
5749
usage=Usage(),
@@ -60,11 +52,7 @@ def model_response(output: TResponseOutputItem) -> ModelResponse:
6052

6153
@staticmethod
6254
def response_output_message(text: str) -> ResponseOutputMessage:
63-
"""Create a ResponseOutputMessage with text content.
64-
65-
.. warning::
66-
This API is experimental and may change in the future.
67-
"""
55+
"""Create a ResponseOutputMessage with text content."""
6856
return ResponseOutputMessage(
6957
id="",
7058
content=[
@@ -81,11 +69,7 @@ def response_output_message(text: str) -> ResponseOutputMessage:
8169

8270
@staticmethod
8371
def tool_call(arguments: str, name: str) -> ModelResponse:
84-
"""Create a ModelResponse with a function tool call.
85-
86-
.. warning::
87-
This API is experimental and may change in the future.
88-
"""
72+
"""Create a ModelResponse with a function tool call."""
8973
return ResponseBuilders.model_response(
9074
ResponseFunctionToolCall(
9175
arguments=arguments,
@@ -99,57 +83,33 @@ def tool_call(arguments: str, name: str) -> ModelResponse:
9983

10084
@staticmethod
10185
def output_message(text: str) -> ModelResponse:
102-
"""Create a ModelResponse with an output message.
103-
104-
.. warning::
105-
This API is experimental and may change in the future.
106-
"""
86+
"""Create a ModelResponse with an output message."""
10787
return ResponseBuilders.model_response(
10888
ResponseBuilders.response_output_message(text)
10989
)
11090

11191

11292
class TestModelProvider(ModelProvider):
113-
"""Test model provider which simply returns the given module.
114-
115-
.. warning::
116-
This API is experimental and may change in the future.
117-
"""
93+
"""Test model provider which simply returns the given module."""
11894

11995
__test__ = False
12096

12197
def __init__(self, model: Model):
122-
"""Initialize a test model provider with a model.
123-
124-
.. warning::
125-
This API is experimental and may change in the future.
126-
"""
98+
"""Initialize a test model provider with a model."""
12799
self._model = model
128100

129101
def get_model(self, model_name: str | None) -> Model:
130-
"""Get a model from the model provider.
131-
132-
.. warning::
133-
This API is experimental and may change in the future.
134-
"""
102+
"""Get a model from the model provider."""
135103
return self._model
136104

137105

138106
class TestModel(Model):
139-
"""Test model for use mocking model responses.
140-
141-
.. warning::
142-
This API is experimental and may change in the future.
143-
"""
107+
"""Test model for use mocking model responses."""
144108

145109
__test__ = False
146110

147111
def __init__(self, fn: Callable[[], ModelResponse]) -> None:
148-
"""Initialize a test model with a callable.
149-
150-
.. warning::
151-
This API is experimental and may change in the future.
152-
"""
112+
"""Initialize a test model with a callable."""
153113
self.fn = fn
154114

155115
async def get_response(
@@ -182,11 +142,7 @@ def stream_response(
182142

183143
@staticmethod
184144
def returning_responses(responses: list[ModelResponse]) -> "TestModel":
185-
"""Create a mock model which sequentially returns responses from a list.
186-
187-
.. warning::
188-
This API is experimental and may change in the future.
189-
"""
145+
"""Create a mock model which sequentially returns responses from a list."""
190146
i = iter(responses)
191147
return TestModel(lambda: next(i))
192148

@@ -197,9 +153,6 @@ class AgentEnvironment:
197153
This async context manager provides a convenient way to set up testing environments
198154
for OpenAI agents with mocked model calls and Temporal integration.
199155
200-
.. warning::
201-
This API is experimental and may change in the future.
202-
203156
Example:
204157
>>> from temporalio.contrib.openai_agents.testing import AgentEnvironment, TestModelProvider, ResponseBuilders
205158
>>> from temporalio.client import Client
@@ -246,9 +199,8 @@ def __init__(
246199
register_activities: Whether to register activities during worker execution.
247200
add_temporal_spans: Whether to add temporal spans to traces
248201
use_otel_instrumentation: If set to true, enable open telemetry instrumentation.
249-
250-
.. warning::
251-
This API is experimental and may change in the future.
202+
Warning: use_otel_instrumentation is experimental and behavior may change in future versions.
203+
Use with caution in production environments.
252204
"""
253205
self._model_params = model_params
254206
self._model_provider = None
@@ -289,9 +241,6 @@ def applied_on_client(self, client: Client) -> Client:
289241
290242
Returns:
291243
A new Client instance with the OpenAI agents plugin applied.
292-
293-
.. warning::
294-
This API is experimental and may change in the future.
295244
"""
296245
if self._plugin is None:
297246
raise RuntimeError(
@@ -305,11 +254,7 @@ def applied_on_client(self, client: Client) -> Client:
305254

306255
@property
307256
def openai_agents_plugin(self) -> OpenAIAgentsPlugin:
308-
"""Get the underlying OpenAI agents plugin.
309-
310-
.. warning::
311-
This API is experimental and may change in the future.
312-
"""
257+
"""Get the underlying OpenAI agents plugin."""
313258
if self._plugin is None:
314259
raise RuntimeError(
315260
"AgentEnvironment must be entered before accessing plugin"

temporalio/contrib/openai_agents/workflow.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ def activity_as_tool(
5151
) -> Tool:
5252
"""Convert a single Temporal activity function to an OpenAI agent tool.
5353
54-
.. warning::
55-
This API is experimental and may change in future versions.
56-
Use with caution in production environments.
57-
5854
This function takes a Temporal activity function and converts it into an
5955
OpenAI agent tool that can be used by the agent to execute the activity
6056
during workflow execution. The tool will automatically handle the conversion
@@ -171,10 +167,6 @@ def nexus_operation_as_tool(
171167
) -> Tool:
172168
"""Convert a Nexus operation into an OpenAI agent tool.
173169
174-
.. warning::
175-
This API is experimental and may change in future versions.
176-
Use with caution in production environments.
177-
178170
This function takes a Nexus operation and converts it into an
179171
OpenAI agent tool that can be used by the agent to execute the operation
180172
during workflow execution. The tool will automatically handle the conversion
@@ -257,10 +249,6 @@ def stateless_mcp_server(
257249
) -> "MCPServer":
258250
"""A stateless MCP server implementation for Temporal workflows.
259251
260-
.. warning::
261-
This API is experimental and may change in future versions.
262-
Use with caution in production environments.
263-
264252
This uses a TemporalMCPServer of the same name registered with the OpenAIAgents plugin to implement
265253
durable MCP operations statelessly.
266254
@@ -292,10 +280,6 @@ def stateful_mcp_server(
292280
) -> AbstractAsyncContextManager["MCPServer"]:
293281
"""A stateful MCP server implementation for Temporal workflows.
294282
295-
.. warning::
296-
This API is experimental and may change in future versions.
297-
Use with caution in production environments.
298-
299283
This wraps an MCP server to maintain a persistent connection throughout
300284
the workflow execution. It creates a dedicated worker that stays connected to
301285
the MCP server and processes operations on a dedicated task queue.
@@ -327,10 +311,6 @@ def stateful_mcp_server(
327311
class ToolSerializationError(TemporalError):
328312
"""Error that occurs when a tool output could not be serialized.
329313
330-
.. warning::
331-
This exception is experimental and may change in future versions.
332-
Use with caution in production environments.
333-
334314
This exception is raised when a tool (created from an activity or Nexus operation)
335315
returns a value that cannot be properly serialized for use by the OpenAI agent.
336316
All tool outputs must be convertible to strings for the agent to process them.
@@ -351,9 +331,4 @@ class ToolSerializationError(TemporalError):
351331

352332

353333
class AgentsWorkflowError(TemporalError):
354-
"""Error that occurs when the agents SDK raises an error which should terminate the calling workflow or update.
355-
356-
.. warning::
357-
This exception is experimental and may change in future versions.
358-
Use with caution in production environments.
359-
"""
334+
"""Error that occurs when the agents SDK raises an error which should terminate the calling workflow or update."""

0 commit comments

Comments
 (0)