Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.14"]
python: ["3.11", "3.14"]
project: ${{ fromJSON(needs.detect-standalone-changes.outputs.projects) }}
exclude:
# temporalio 1.36.0, which arize_tracing needs, requires Python 3.11+
- project: arize_tracing
python: "3.10"
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand Down Expand Up @@ -103,7 +99,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python: ["3.10", "3.14"]
python: ["3.11", "3.14"]
os: [ubuntu-latest, macos-intel, macos-arm, windows-latest]
include:
- os: macos-intel
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Prerequisites:
temporal server start-dev
```

The SDK requires Python >= 3.10. You can install Python using uv. For example,
The samples require Python >= 3.11, as Temporal Python SDK 1.36 does. You can install Python using uv. For example,

uv python install 3.13

Expand Down
3 changes: 2 additions & 1 deletion deepagents_plugin/external_storage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ async def connect_client(
]
),
)
yield await Client.connect(**config, plugins=[plugin])
config["plugins"] = [*config.get("plugins", []), plugin]
yield await Client.connect(**config)
9 changes: 5 additions & 4 deletions langfuse_tracing/ticket_triage/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ async def main() -> None:

config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[OpenTelemetryPlugin(add_temporal_spans=True)],
)
config["plugins"] = [
*config.get("plugins", []),
OpenTelemetryPlugin(add_temporal_spans=True),
]
client = await Client.connect(**config)

# A fresh workflow ID per run avoids Temporal workflow ID conflicts and
# gives each run its own Langfuse session (langfuse.session.id on the root
Expand Down
9 changes: 5 additions & 4 deletions langfuse_tracing/ticket_triage/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ async def main() -> None:
# add_temporal_spans=True emits spans for Temporal operations (StartWorkflow,
# RunWorkflow, RunActivity, HandleUpdate, ...) in addition to propagating
# trace context across the client/workflow/activity boundaries.
client = await Client.connect(
**config,
plugins=[OpenTelemetryPlugin(add_temporal_spans=True)],
)
config["plugins"] = [
*config.get("plugins", []),
OpenTelemetryPlugin(add_temporal_spans=True),
]
client = await Client.connect(**config)

worker = Worker(
client,
Expand Down
6 changes: 2 additions & 4 deletions langsmith_tracing/basic/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ async def main() -> str:
add_temporal_runs=add_temporal_runs,
)

client = await Client.connect(
**config,
plugins=[plugin],
)
config["plugins"] = [*config.get("plugins", []), plugin]
client = await Client.connect(**config)

result = await client.execute_workflow(
BasicLLMWorkflow.run,
Expand Down
7 changes: 2 additions & 5 deletions langsmith_tracing/chatbot/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ async def main():
add_temporal_runs=add_temporal_runs,
)

client = await Client.connect(
**config,
data_converter=pydantic_data_converter,
plugins=[plugin],
)
config["plugins"] = [*config.get("plugins", []), plugin]
client = await Client.connect(**config, data_converter=pydantic_data_converter)

wf_id = f"langsmith-chatbot-{uuid.uuid4().hex[:8]}"

Expand Down
6 changes: 2 additions & 4 deletions openai_agents/basic/run_remote_image_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ async def main():
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")

client = await Client.connect(
**config,
plugins=[OpenAIAgentsPlugin()],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

# Use the URL from the original example
image_url = (
Expand Down
8 changes: 2 additions & 6 deletions openai_agents/handoffs/run_message_filter_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ async def main():
config.setdefault("target_host", "localhost:7233")

# Create client connected to server at the given address
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(),
],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

# Execute a workflow
result = await client.execute_workflow(
Expand Down
19 changes: 9 additions & 10 deletions openai_agents/mcp/run_file_system_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
mcp_server_providers=[file_system_server],
config["plugins"] = [
*config.get("plugins", []),
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
],
)
mcp_server_providers=[file_system_server],
),
]
client = await Client.connect(**config)
# @@@SNIPEND

worker = Worker(
Expand Down
8 changes: 2 additions & 6 deletions openai_agents/mcp/run_file_system_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(),
],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

# Execute a workflow
result = await client.execute_workflow(
Expand Down
19 changes: 9 additions & 10 deletions openai_agents/mcp/run_memory_research_scratchpad_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
mcp_server_providers=[memory_server_provider],
config["plugins"] = [
*config.get("plugins", []),
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
],
)
mcp_server_providers=[memory_server_provider],
),
]
client = await Client.connect(**config)
# @@@SNIPEND

worker = Worker(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@
async def main():
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(),
],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

result = await client.execute_workflow(
MemoryResearchScratchpadWorkflow.run,
Expand Down
19 changes: 9 additions & 10 deletions openai_agents/mcp/run_prompt_server_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=120)
),
mcp_server_providers=[prompt_server_provider],
config["plugins"] = [
*config.get("plugins", []),
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=120)
),
],
)
mcp_server_providers=[prompt_server_provider],
),
]
client = await Client.connect(**config)

worker = Worker(
client,
Expand Down
6 changes: 2 additions & 4 deletions openai_agents/mcp/run_prompt_server_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[OpenAIAgentsPlugin()],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

# Execute a workflow
result = await client.execute_workflow(
Expand Down
19 changes: 9 additions & 10 deletions openai_agents/mcp/run_sse_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
mcp_server_providers=[sse_server_provider],
config["plugins"] = [
*config.get("plugins", []),
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
],
)
mcp_server_providers=[sse_server_provider],
),
]
client = await Client.connect(**config)

worker = Worker(
client,
Expand Down
6 changes: 2 additions & 4 deletions openai_agents/mcp/run_sse_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[OpenAIAgentsPlugin()],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

# Execute a workflow
result = await client.execute_workflow(
Expand Down
19 changes: 9 additions & 10 deletions openai_agents/mcp/run_streamable_http_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
mcp_server_providers=[streamable_http_server_provider],
config["plugins"] = [
*config.get("plugins", []),
OpenAIAgentsPlugin(
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60)
),
],
)
mcp_server_providers=[streamable_http_server_provider],
),
]
client = await Client.connect(**config)

worker = Worker(
client,
Expand Down
6 changes: 2 additions & 4 deletions openai_agents/mcp/run_streamable_http_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ async def main():
# Create client connected to server at the given address
config = ClientConfig.load_client_connect_config()
config.setdefault("target_host", "localhost:7233")
client = await Client.connect(
**config,
plugins=[OpenAIAgentsPlugin()],
)
config["plugins"] = [*config.get("plugins", []), OpenAIAgentsPlugin()]
client = await Client.connect(**config)

# Execute a workflow
result = await client.execute_workflow(
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name = "temporalio-samples"
version = "0.1a1"
description = "Temporal.io Python SDK samples"
authors = [{ name = "Temporal Technologies Inc", email = "sdk@temporal.io" }]
requires-python = ">=3.10"
requires-python = ">=3.11"
readme = "README.md"
license = "MIT"
dependencies = ["temporalio>=1.34.0,<2", "protobuf>=5.29.6,<6"]
dependencies = ["temporalio>=1.36.0,<2", "protobuf>=5.29.6,<6"]

[project.urls]
Homepage = "https://github.com/temporalio/samples-python"
Expand Down Expand Up @@ -141,7 +141,7 @@ log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(linen
testpaths = ["tests"]

[tool.ruff]
target-version = "py310"
target-version = "py311"

[tool.mypy]
ignore_missing_imports = true
Expand Down
Loading
Loading