Skip to content

Commit 4152411

Browse files
authored
Update hosted agent samples to support Python 3.14 and fix response handling (#47549)
1 parent 9a25a43 commit 4152411

6 files changed

Lines changed: 5 additions & 3 deletions

File tree

sdk/ai/azure-ai-projects/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Breaking changes in beta methods:
1818
* Updated `sample_dataset_generation_job_traces_for_evaluation.py` and `sample_dataset_generation_job_traces_for_finetuning.py` to create a temporary agent, seed conversations, retry the data generation job over the trace window, and clean up all created resources.
1919
* Updated `sample_memory_crud.py` and `sample_memory_crud_async.py` to demonstrate memory item CRUD (`create_memory`, `get_memory`, `update_memory`, `list_memories`, `delete_memory`) in addition to memory store CRUD.
2020
* Updated the rubric evaluator generation samples (`sample_rubric_evaluator_generation_basic.py`, `sample_rubric_evaluator_generation_iterate.py`, `sample_rubric_evaluator_generation_lifecycle.py`, `sample_rubric_evaluator_generation_all_sources.py`) to use the typed `EvaluatorGenerationJob` / `EvaluatorGenerationInputs` / `*EvaluatorGenerationJobSource` models. The job inputs are now nested under `inputs` per the service contract, and the traces source uses `datetime` values for `start_time` / `end_time`.
21+
* Updated Hosted Agent code-upload samples (`sample_create_hosted_agent_from_code.py`, `sample_create_hosted_agent_from_code_async.py`) to target runtime `python_3_14`, since `python_3_12` is no longer supported.
22+
* Updated Hosted Agent echo-agent assets (`samples/hosted_agents/assets/echo-agent/main.py`, `echo-agent.zip`, `echo-agent-prebuilt.zip`) to use `@app.response_handler`, resolving a response-handling issue.
2123

2224
## 2.2.0 (2026-05-29)
2325

Binary file not shown.
Binary file not shown.

sdk/ai/azure-ai-projects/samples/hosted_agents/assets/echo-agent/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# app = ResponsesAgentServerHost()
2222

2323

24-
# @app.create_handler
24+
# @app.response_handler
2525
# async def handler(request: CreateResponse, context: ResponseContext, cancellation_signal: asyncio.Event):
2626
# """Echo the user's input back as a single message."""
2727
# input_text = await context.get_input_text()

sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
cpu="0.5",
8181
memory="1Gi",
8282
code_configuration=CodeConfiguration(
83-
runtime="python_3_12",
83+
runtime="python_3_14",
8484
entry_point=["python", "main.py"],
8585
dependency_resolution=dependency_resolution,
8686
),

sdk/ai/azure-ai-projects/samples/hosted_agents/sample_create_hosted_agent_from_code_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def main() -> None:
8484
cpu="0.5",
8585
memory="1Gi",
8686
code_configuration=CodeConfiguration(
87-
runtime="python_3_12",
87+
runtime="python_3_14",
8888
entry_point=["python", "main.py"],
8989
dependency_resolution=dependency_resolution,
9090
),

0 commit comments

Comments
 (0)