Skip to content

Commit 09abf26

Browse files
Merge pull request #282 from microsoft/psl-upgrade-agent-framework-final
fix: Upgrade azure-ai-projects and agent-framework
2 parents cbf1c5c + 3e1685e commit 09abf26

43 files changed

Lines changed: 2593 additions & 849 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/broken-links-checker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: lycheeverse/lychee-action@v2.8.0
3838
with:
3939
args: >
40-
--verbose --exclude-mail --no-progress --exclude ^https?://
40+
--verbose --no-progress --exclude ^https?:// --exclude ^mailto:
4141
${{ steps.changed-markdown-files.outputs.all_changed_files }}
4242
failIfEmpty: false
4343
env:
@@ -50,7 +50,7 @@ jobs:
5050
uses: lycheeverse/lychee-action@v2.8.0
5151
with:
5252
args: >
53-
--verbose --exclude-mail --no-progress --exclude ^https?://
53+
--verbose --no-progress --exclude ^https?:// --exclude ^mailto:
5454
'**/*.md'
5555
failIfEmpty: false
5656
env:

docs/LocalDevelopmentSetup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ py -3.12 -m uv venv .venv
337337
py -3.12 -m uv sync --prerelease=allow
338338
```
339339

340-
> **⚠️ Important**: This repo currently depends on a prerelease/dev version of Microsoft Agent Framework. Always run `uv sync --prerelease=allow` (or `py -3.12 -m uv sync --prerelease=allow` on Windows) after creating the virtual environment to install all required dependencies. Missing dependencies will cause runtime errors like `ModuleNotFoundError: No module named 'pydantic'` or DNS resolution failures.
340+
> **⚠️ Important**: Always run `uv sync --prerelease=allow` (or `py -3.12 -m uv sync --prerelease=allow` on Windows) after creating the virtual environment to install all required dependencies. The `--prerelease=allow` flag is needed because some transitive dependencies may still use pre-release versions. Missing dependencies will cause runtime errors like `ModuleNotFoundError: No module named 'pydantic'` or DNS resolution failures.
341341
342342
### 5.4. Run the Processor
343343

docs/ProcessFrameworkGuide.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,21 @@ Inside each step, the orchestrator can use multi-agent patterns (maker-checker l
118118

119119
- Implementation: [src/processor/src/steps/migration_processor.py](../src/processor/src/steps/migration_processor.py)
120120
- The processor creates a workflow with `WorkflowBuilder`.
121-
- It registers four executors, sets the start executor, and defines edges.
121+
- It instantiates four executors, passes the start executor to `WorkflowBuilder`, and chains them with `add_chain`.
122122

123123
Example from the repo (simplified):
124124

125125
```python
126126
from agent_framework import WorkflowBuilder
127127

128+
analysis_exec = AnalysisExecutor(id="analysis", app_context=app_context)
129+
design_exec = DesignExecutor(id="design", app_context=app_context)
130+
yaml_exec = YamlConvertExecutor(id="yaml", app_context=app_context)
131+
docs_exec = DocumentationExecutor(id="documentation", app_context=app_context)
132+
128133
workflow = (
129-
WorkflowBuilder()
130-
.register_executor(lambda: AnalysisExecutor(id="analysis", app_context=app_context), name="analysis")
131-
.register_executor(lambda: DesignExecutor(id="design", app_context=app_context), name="design")
132-
.register_executor(lambda: YamlConvertExecutor(id="yaml", app_context=app_context), name="yaml")
133-
.register_executor(lambda: DocumentationExecutor(id="documentation", app_context=app_context), name="documentation")
134-
.set_start_executor("analysis")
135-
.add_edge("analysis", "design")
136-
.add_edge("design", "yaml")
137-
.add_edge("yaml", "documentation")
134+
WorkflowBuilder(start_executor=analysis_exec)
135+
.add_chain([analysis_exec, design_exec, yaml_exec, docs_exec])
138136
.build()
139137
)
140138
```
@@ -355,7 +353,7 @@ To run processor unit tests locally (example):
355353

356354
```bash
357355
cd src/processor
358-
uv run --prerelease=allow python -m pytest src/processor/src/tests/unit -v
356+
uv run python -m pytest src/tests/unit -v
359357
```
360358

361359
## Extending the pipeline

infra/vscode_web/codeSample.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from azure.ai.agents.models import ListSortOrder
12
from azure.ai.projects import AIProjectClient
23
from azure.identity import DefaultAzureCredential
34

@@ -7,19 +8,25 @@
78

89
agent = project_client.agents.get_agent("<%= agentId %>")
910

10-
thread = project_client.agents.create_thread()
11+
thread = project_client.agents.threads.create()
1112
print(f"Created thread, ID: {thread.id}")
1213

13-
message = project_client.agents.create_message(
14+
message = project_client.agents.messages.create(
1415
thread_id=thread.id,
1516
role="user",
1617
content="<%= userMessage %>"
1718
)
1819

19-
run = project_client.agents.create_and_process_run(
20+
run = project_client.agents.runs.create_and_process(
2021
thread_id=thread.id,
2122
agent_id=agent.id)
22-
messages = project_client.agents.list_messages(thread_id=thread.id)
2323

24-
for text_message in messages.text_messages:
25-
print(text_message.as_dict())
24+
if run.status == "failed":
25+
print(f"Run failed: {run.last_error}")
26+
else:
27+
messages = project_client.agents.messages.list(
28+
thread_id=thread.id, order=ListSortOrder.ASCENDING)
29+
30+
for message in messages:
31+
if message.text_messages:
32+
print(f"{message.role}: {message.text_messages[-1].text.value}")

infra/vscode_web/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
azure-ai-projects==1.0.0b12
1+
azure-ai-projects==2.1.0
22
azure-identity==1.20.0
33
ansible-core~=2.17.0

src/processor/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"agent-framework==1.0.0b260107",
8+
"agent-framework==1.3.0",
99
"aiohttp==3.13.5",
1010
"art==6.5",
1111
"azure-ai-agents==1.2.0b5",

0 commit comments

Comments
 (0)