fix: update Python samples for agent-framework-durabletask 1.0.0b260212 breaking changes#30
Open
clsweeting wants to merge 1 commit intoAzure-Samples:mainfrom
Open
Conversation
…12 breaking changes Three breaking changes in the agent-framework SDK were causing all Python samples and quickstarts to fail at runtime: 1. get_new_thread() removed -- replaced with create_session(), and the 'thread' keyword argument in agent.run() renamed to 'session'. 2. try_parse_value(Model) removed -- replaced with the .value property on AgentResponse, which returns the parsed model directly. 3. @tool decorator now required -- tool functions passed to agents must be decorated with @tool from agent_framework for the SDK to discover them. Also bumps agent-framework-durabletask version pin from >=0.0.2b260126 to >=1.0.0b260212 in all requirements.txt files. Tested end-to-end with the container-apps travel planner sample against the DTS emulator -- all 3 agents, human approval, and booking complete successfully.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: update Python samples for agent-framework-durabletask 1.0.0b260212 breaking changes
Three breaking changes in the agent-framework SDK were causing all Python samples and quickstarts to fail at runtime:
get_new_thread() removed -- replaced with create_session(), and the 'thread' keyword argument in agent.run() renamed to 'session'.
try_parse_value(Model) removed -- replaced with the .value property on AgentResponse, which returns the parsed model directly.
@tool decorator now required -- tool functions passed to agents must be decorated with @tool from agent_framework for the SDK to discover them.
Also bumps agent-framework-durabletask version pin from >=0.0.2b260126 to >=1.0.0b260212 in all requirements.txt files.
Tested end-to-end with the container-apps travel planner sample against the DTS emulator -- all 3 agents, human approval, and booking complete successfully.
Purpose
Updates all Python samples and quickstarts to work with
agent-framework-durabletask >= 1.0.0b260212, which introduced several breaking API changes from0.0.2b260126.Breaking Changes Fixed
1. Session API rename —
get_new_thread()renamed tocreate_session(),thread=parameter renamed tosession=2. Result value access —
try_parse_value()removed, results accessed via.valueproperty3. Tool decorator requirement — Tools now require the
@tooldecoratorFiles Changed (17 files)
Quickstart requirements.txt (10 files) — all updated from
>=0.0.2b260126to>=1.0.0b260212Quickstart function_app.py (4 files) —
04_chat_with_history,05_fan_out,06_human_in_the_loop,07_resumableTravel Planner samples (3 files) —
worker.py,currency_converter.py,function_app.pyDoes this introduce a breaking change?
Pull Request Type
How to Test
What to Check
pip install -r requirements.txt)get_new_thread,try_parse_value) remain in Python filesOther Information
The
agent-framework-durabletaskpackage released1.0.0b260212with breaking changes that prevent all existing Python samples from running. This PR brings every Python sample and quickstart up to date with the new API surface.