-
Notifications
You must be signed in to change notification settings - Fork 192
fix: Upgrade azure-ai-projects and agent-framework #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Prachig-Microsoft
wants to merge
19
commits into
dev
Choose a base branch
from
feature/upgrade-azure-ai-libs
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
746b796
Upgrade azure-ai-projects to 2.1.0 and agent-framework to 1.3.0
Prachig-Microsoft c234316
fix: update agent_framework.azure imports to agent_framework.openai f…
Prachig-Microsoft e73f9f4
fix: replace removed event classes with WorkflowEvent type checks
Prachig-Microsoft 77f0171
revert: change agent-framework to 1.1.1, revert all 1.3.0 code changes
Prachig-Microsoft 4e87965
fix: apply breaking-change fixes for agent-framework 1.1.1
Prachig-Microsoft ee4650a
fix: regenerate uv.lock files for agent-framework 1.1.1
Prachig-Microsoft 1b14417
fix: update test patches to use new agent_framework.openai classes
Prachig-Microsoft b400522
fix: migrate all renamed agent-framework symbols for 1.1.1
Prachig-Microsoft 1e66f9e
fix: update docstring example to use Agent() constructor pattern
Prachig-Microsoft 803fc11
fix: pass start_executor to WorkflowBuilder constructor
Prachig-Microsoft 1927aa0
fix: use executor instances in WorkflowBuilder (1.1.1 API)
Prachig-Microsoft 793f1b3
fix: align all code with agent-framework 1.1.1 API
Prachig-Microsoft 369e3f7
fix: Workflow.run_stream() -> run(stream=True) in 1.1.1
Prachig-Microsoft 9c23281
fix: remove await from sync ctx.set_state() and fix Role enum usage
Prachig-Microsoft ce961ad
chore: revert irrelevant docstring/comment changes from upgrade
Prachig-Microsoft f7c4134
fix: remove unused imports and trailing blank line (lint fixes)
Prachig-Microsoft 8255859
Merge branch 'dev' into feature/upgrade-azure-ai-libs
Prachig-Microsoft 13fe76a
fix: replace invalid 'reasoning' dict with 'reasoning_effort' string …
Prachig-Microsoft 96df974
fix: replace Role.USER with 'user' string in test_input_observer_midd…
Prachig-Microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,32 @@ | ||
| from azure.ai.projects import AIProjectClient | ||
| from azure.identity import DefaultAzureCredential | ||
| from azure.ai.agents.models import ListSortOrder | ||
|
|
||
| project_client = AIProjectClient.from_connection_string( | ||
| credential=DefaultAzureCredential(), | ||
| conn_str="<%= connectionString %>") | ||
|
|
||
| agent = project_client.agents.get_agent("<%= agentId %>") | ||
|
|
||
| thread = project_client.agents.create_thread() | ||
| thread = project_client.agents.threads.create() | ||
| print(f"Created thread, ID: {thread.id}") | ||
|
|
||
| message = project_client.agents.create_message( | ||
| message = project_client.agents.messages.create( | ||
| thread_id=thread.id, | ||
| role="user", | ||
| content="<%= userMessage %>" | ||
| ) | ||
|
|
||
| run = project_client.agents.create_and_process_run( | ||
| run = project_client.agents.runs.create_and_process( | ||
| thread_id=thread.id, | ||
| agent_id=agent.id) | ||
| messages = project_client.agents.list_messages(thread_id=thread.id) | ||
|
|
||
| for text_message in messages.text_messages: | ||
| print(text_message.as_dict()) | ||
| if run.status == "failed": | ||
| print(f"Run failed: {run.last_error}") | ||
| else: | ||
| messages = project_client.agents.messages.list( | ||
| thread_id=thread.id, order=ListSortOrder.ASCENDING) | ||
|
|
||
| for message in messages: | ||
| if message.text_messages: | ||
| print(f"{message.role}: {message.text_messages[-1].text.value}") |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| azure-ai-projects==1.0.0b12 | ||
| azure-ai-projects==2.1.0 | ||
| azure-identity==1.20.0 | ||
| ansible-core~=2.17.0 |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.