Commit Graph
685 Commits
Author SHA1 Message Date
a480366d80 Python: added websockets as main dep for agent.run_stream (#672)
* added websockets as main dep for agent.run_stream

* Update python/packages/main/pyproject.toml

Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>

* Update python/packages/main/pyproject.toml

Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>

---------

Co-authored-by: Alex Lavaee <alexlavaee@microsoft.com>
Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
2025-09-11 09:50:50 +00:00
57d09afe04 Python: Context providers abstraction and Mem0 implementation (#631)
* Added context provider abstractions

* Added mem0 implementation

* Example and small fixes

* Added unit tests for agent

* Added unit tests for mem0 provider

* Updated README

* Small doc updates

* Update python/packages/mem0/agent_framework_mem0/_provider.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Small fixes in tests

* Renaming based on PR feedback

* Small fixes

* Added tests for AggregateContextProvider

* Small improvements

* More improvements based on PR feedback

* Small constant update

* Added more examples

* Added README for Mem0 examples

* Small updates to API

* Updated initialization logic

* Updates for context manager

* Updated Context class

* Dependency update

* Revert changes

* Fixed tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
2025-09-10 21:11:42 +00:00
82ca4065cb Python: Improved telemetry setup (#421)
* test with stack and simplified names

* quick demo of agent decorator

* moved builder to protocol to enhance functionality

* undid chatclientAgent -> agent rename

* one more

* reverted AIAgent rename

* final reverts

* fixed foundry import

* revert changes

* streamlined otel and fcc decorators

* cleanup of telemetry

* further refinement

* lots of updates

* fixed typing

* fix for mypy

* added input and output atttributes

* fix import

* initial work on baking in otel

* major update to telemetry

* final fixes after rename

* fix

* fix test

* updated tests

* fix for tests

* fixes for tests

* updated based on comments

* removed agent decorator

* fix for Python: ServiceResponseException when using multiple tools
Fixes #649

* addressed comments

* fix tests

* fix tests

* fix tools tests

* fix for conversation_id in assistants client

* fix responses test

* fix tests and mypy

* updated test

* foundry fix

---------

Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
2025-09-10 14:52:42 +00:00
6aa746d891 Python: Introducing UserInputRequest and Response types and HostedMcpTool (#405)
* initial work on User Approval (and hosted mcp to validate)

* small update to the comments in the sample

* enable local MCP tools in chatClient get methods

* working streaming and improved setup

* fix for pyright

* updated create_approval -> create_response method

* added tests

* updated HostedMcpTool and addressed feedback

* update type name

* naming updates

* small docstring update

* mypy fix

* fixes and updates

* fixes for responses

* fix int tests

* removed broken tests

* updated test running

* removed specific content check on websearch

* increased timeout

* split slow foundry test

* don't parallel run samples

* add dist load to unit tests

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-09-10 13:37:34 +00:00
Eduard van ValkenburgandGitHub 947f2bf642 Python: added user agents to foundry and azure openai (#658)
* added user agents to foundry and azure openai

* improvement

* improvement for disabled setup
2025-09-10 08:57:37 +00:00
Eduard van ValkenburgandGitHub 383d51443c Python: add base_url parameter for openai chat client (#661)
* added base_url option for openai chat client

* fix test url
2025-09-09 23:31:26 +00:00
9f8823192e MCP support for Foundry (#652)
Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
2025-09-09 20:07:20 +00:00
Evan MattsonandGitHub 2699b85285 Python: Update getting started with workflows sample structure and README (#653)
* Update getting started with workflows sample structure and README

* Small updates

* Adjust getting started samples. Fix agent executor bug. Add workflow tests to unit test file.

* Fix resource links
2025-09-09 06:06:22 +00:00
ee56314a26 Python: Samples Integration Tests (#615)
* Samples Tests

* small fixes

* job fix

* telemetry dependency fix

* job error fix

* sorting provider specific tests

* telemetry fixes

* openai file search fix

---------

Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
2025-09-08 23:45:51 +00:00
518fd447fd Python: Improve the workflow getting started samples (#570)
* Wip: samples

* wip - samples

* Updates to workflow getting started samples

* Checkpointing enhancements

* Cleanup

* PR feedback

* Updates

* Sample updates

* Updates

* Revamp samples, improve doc strings and code comments

* Cleanup unused comment

* Formatting cleanup

* wip

* Further work on samples. Allow agent to be specified as edge.

* Cleanup

* Typing cleanup

* Sample updates

---------

Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-09-05 19:16:25 +00:00
Eduard van ValkenburgandGitHub 40ab6e9d67 Python: name changes executed (#607)
* name changes executed

* updated adr to accepted

* renamed openai base config

* renamed openai config to mixin

* added renames in user docs

* reverted mcperror

* fix tests

* remove sse from tests
2025-09-04 15:00:38 +00:00
Eric ZhuandGitHub 71c047850c Python: Add edge group traces (#597)
* add edge group traces

* add edge group attributes

* update unit tests

* add span links
2025-09-04 04:16:01 +00:00
20ddf7cb31 Python: WorkflowViz to support sub workflows (#571)
* add visualization for sub workflows

* add visualization to subworkflow samples

* Update python/packages/workflow/agent_framework_workflow/_viz.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update python/packages/workflow/agent_framework_workflow/_viz.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update

* remove changes to samples

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
2025-09-04 02:25:47 +00:00
Eduard van ValkenburgandGitHub d42ebc8df6 fix typing for tools (#600) 2025-09-03 18:07:44 +00:00
peterychangandGitHub 9e8001a687 fast forward openai to 1.103.0, update web_search tool to work with it (#592) 2025-09-03 14:04:28 +00:00
Eric ZhuandGitHub ed8461aa7d Python: Add FunctionExecutor and @executor decorator (#589)
* Add FunctionExecutor and @executor decorator

* refactor

* add single argument function

* fix test

* update example code

* add support for sync funciton
2025-09-03 01:56:53 +00:00
3286e8c8b1 Python: Add Python agent runtime project infrastructure (#563)
* Add Python agent runtime project infrastructure.

* lint.

* Rename agent_runtime dir to agent_framework_runtime.

* fix uv.lock

* Update pyproject for rename.

* Update python/packages/runtime/agent_framework_runtime/agent_actor.py

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>

* Add runtime package to workspace and optional dependencies.

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-09-03 00:05:46 +00:00
3577508a20 Python: Introduce WorkflowAgent (#424)
* start a new implementation based on .net

* add response handling

* update init files

* remove handling of WorkflowCompletedEvent

* clean up implemenation

* fix bug

* update tests for merge_updates

* WorkflowAgent validation

* add a sample and fix bug

* revert pre-commit config

* revert pre-commit

* add human in the loop sample

* add comment

* fix type issue in Executor

* fix type errors and rename Executor.type to Executor.type_ with field alias

* fix test

---------

Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
2025-09-02 16:25:03 +00:00
peterychangandGitHub 7565a559ad Having the same ID in the func output causes problems with long running (#558) 2025-09-02 14:35:06 +00:00
Dmytro StrukandGitHub 2037e533b3 Removed list_messages method from thread (#564) 2025-08-29 22:51:52 +00:00
907792f18f improved openai integration tests (#553)
Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
2025-08-29 21:04:02 +00:00
Tao ChenandGitHub 15f0147164 Add message id to OpenAI chat response update (#561) 2025-08-29 19:52:30 +00:00
Victor DibiaandGitHub cc7fb43fde add OPENAI_RESPONSES_MODEL_ID to readme so users know which env var to set to use the responses api (#535) 2025-08-29 16:29:40 +00:00
Dmytro StrukandGitHub 0c28935382 Python: Improved exception messages in client initialization (#539)
* Improved exception messages in client initialization

* Fixed tests
2025-08-28 20:52:59 +00:00
Evan MattsonandGitHub 529341f58b Python: Add support for the MagenticWorkflowBuilder (#496)
* magentic happy path - wip

* Support workflow high-level magentic builder API. Add tests and samples.

* Add sample docstring

* Addressing PR feedback round 1

* Fix mypy errors

* Callback improvements

* Rename to MagenticBuilder

* Improvements

* Emit function calling deltas

* PR feedback 2

* Clean up sample
2025-08-28 05:39:48 +00:00
8e14dfc522 Python: Improved foundry integration tests (#514)
* improved foundry integration tests

* Update python/packages/foundry/tests/test_foundry_chat_client.py

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>

* Update python/packages/foundry/tests/test_foundry_chat_client.py

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>

---------

Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
2025-08-27 21:54:28 +00:00
1134350fcf Python: Improved Azure OpenAI integration tests (#489)
* Improved Azure OpenAI integration tests

* Small fixes

* Credential fixes

* small fix

* error fix

---------

Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
2025-08-27 17:41:11 +00:00
Eric ZhuandGitHub 379e3b9a00 Python: Tracing for workflows (#480)
* workflow tracing design doc

* add tracing implementation for workflow

* fix bug caused by double wrapping of sub workflow request

* add unit tests for tracing

* add documentation for workflow tracing

* remove unnecessary file

* update aspire command

* fix tests

* proper serialization of subworkflows and add workflow.definition

* add serialization test

* fix subworkflow serialization

* workflow_id --> id

* update workflow sample to address comments

* update naming; use costant

* use NoOpTracer instead of nullcontext

* use span event instead of attribtutes for status

* fix typing

* add workflow.build span

* rename methods for clarity

* ensure all source trace contexts are propagated in fan in
2025-08-27 14:09:16 +09:00
Tao ChenandGitHub beb5218838 Python: Clean up and formatting (#487)
* Clean up and formatting

* Fix mypy

* Bug fix
2025-08-26 20:21:32 +00:00
Dmytro StrukandGitHub fa88641263 Python: Removed DefaultAzureCredential (#490)
* Removed DefaultAzureCredential

* Renamed ad_credential to credential
2025-08-26 15:33:17 +00:00
peterychangandGitHub 7942a52ca1 fix chat_options in kwargs error path in responses client (#483) 2025-08-25 16:52:42 +00:00
Dmytro StrukandGitHub 4b9eea906f Improved exception messages (#479) 2025-08-25 14:46:48 +00:00
b0b3fd151c Python: Adding support for nested workflows (#460)
* Adding design documents and data flow descriptions for sub-workflows

* Updating docs.

* Sub-workflow implementation #1. Stuck because of singleton RequestInfoExecutor, going to make a change to remove that restrivtion.

* Removed the singleton restriction on RequestInfoExecutor so enable sub-workflows.

* Scenarios seem to be working.

* Sample improved.

* going to have intern add generic response wrappers.

* Wrapped responses working.

* Non-hardcoded routing is working.

* Sample showing external approved and not approved.

* Cleaning up.

* Updating some samples and user guide.

* Removing old design doc.

* Cleaning up.

* Adding python-package-setup.md back.

* Update python/packages/workflow/agent_framework_workflow/_executor.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update python/packages/workflow/agent_framework_workflow/_validation.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Removing prints.

* Fixing lint and type issues.

* Fixing lint and type issues.

* Update python/packages/workflow/agent_framework_workflow/_executor.py

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>

* Adding type hints to intercepts decorator.

* Removing unused files.

* Fixing issue with sample 5 groupchat with hil.

* Removing redundent samples.

* Updates to ensure no conflicting request interceptors and to support a subflow with multiple requests in a single super step.

* Fixing pypi errors.

* clean up samples

* update samples to make it more clear

* warning for unhandled request info from sub workflow

* add logger info

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-08-23 03:21:37 +00:00
Eric ZhuandGitHub 6e9d35830f Python: Move Workflow, Edge, EdgeGroup and Executor to AFBaseModel (#472)
* Refactor workflow to introduce EdgeRunner for edge execution.

* Fix edge cases

* Convert Workflow, Edge, EdgeGroup, and Executor into AFBaseModel to support object model serialization

* format

* remove accidental file

* fix typing

* Add type information to EdgeGroup and Executor subclasses

* fix format

* Add condition_name field to Edge

* Add new fields

* remove Optional

* Update
2025-08-22 22:02:34 +00:00
Eric ZhuandGitHub 65836ab125 Python: Use generic for WorkflowContext and use its type parameters to indicate executor's output types (#444)
* Use generic for WorkflowContext and use its type parameters to indicate executor's output types

* Update

* Fix type errors and add in-line comments

* fix test

* type

* Fix executor type issues
2025-08-21 02:40:43 +00:00
123a0bca10 Python: Improved main package test coverage (#445)
* Fixed failing foundry tests and improved main coverage

* Add back mistakenly deleted code

* Update python/packages/main/tests/openai/test_openai_assistants_client.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update python/packages/main/tests/openai/test_openai_assistants_client.py

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>

* Small fix

---------

Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
2025-08-20 20:18:48 +00:00
peterychangandGitHub feb4e908ae Python: Request cancellation sample (#459)
* request cancellation via tasks

* fix missing kwargs
2025-08-20 19:56:26 +00:00
6900d3456c Python: Workflow visualization. (#372)
* Workflow visualization.

* fix typing

* address comments

* update all samples

* Update fan in edge group visual

* fix quality check

* Update python/samples/getting_started/workflow/step_06_map_reduce.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* address comment

* Catch up with changes in workflow; add to_mermaid method

* Update examples

* fix test

* add installation guide to error messages

* Remove visualization for samples except for one.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
2025-08-20 00:07:49 +00:00
peterychangandGitHub 953ed7560d Fix chat options for Responses API (#441) 2025-08-19 00:23:01 +00:00
Tao ChenandGitHub c0c49d31d0 Enable Mypy for Workflow (#433) 2025-08-15 22:57:28 +00:00
0410f51777 Python: Web search file search tools (#395)
* Add web and file search tools

* add tests

* PR comments

* Add tools support for chat and assistants clients

* fix code checks

* add tests for assistants client

* Add samples

* fix fn descriptions

* Add openai responses model id to environment variables

---------

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
2025-08-15 19:35:23 +00:00
ed86baa6cb Python: Workflow Edge Groups (#393)
* Introducing edge groups

* Add conditional and partitioning edge groups; next add samples and tests

* Add unit tests

* Add samples

* Address comments 1

* Address comments 2

* Update conditional edge group to take in cases and default

* Minor updates to sample

* Collapsing Paritioning Edge group and Conditional Edge group to source edge group

* Improve sample clarity

* Name consolidation

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-08-15 18:11:35 +00:00
19d91bb950 Python: Foundry Chat Client unit tests to improve coverage (#423)
* Add unit tests for Foundry Chat Client to improve coverage

* Updated Azure OpenAI endpoint and tests timeout

* Error fixes for Foundry Chat Client tests

* Error fixes

---------

Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
2025-08-15 17:45:14 +00:00
Dmytro StrukandGitHub dea736e550 Python: Thread storage and serialization (#394)
* Updates for message store support

* Added unit tests

* Added suspend-resume example

* Added example with custom chat message store

* Small fix

* Addressed PR feedback

* Renaming and documentation

* More renaming

* Addressed more PR feedback

* Small fixes in Foundry chat client and examples

* Small update

* Addressed PR feedback

* Increased timeout for Azure tests
2025-08-14 21:15:42 +00:00
Dmytro StrukandGitHub 95cb20ca40 Small fix in Foundry chat client and samples (#407) 2025-08-14 20:21:23 +00:00
4007785b66 Azure package unit tests to improve coverage (#414)
Co-authored-by: Giles Odigwe <gilesodigwe@microsoft.com>
2025-08-14 16:19:44 +00:00
Eduard van ValkenburgandGitHub ad3d8171bf Python: Introducing Local MCP Servers (#389)
* mcp parts

* mcp parts 2

* removed structured output in favor of handling in chatresponse, mcp as AITool and running samples

* updated naming

* fixed test
2025-08-13 09:48:22 +00:00
Eduard van ValkenburgandGitHub 53866218d2 Python: add better test coverage to individual tests, and all-tests task, gh … (#400)
* add better test coverage to individual tests, and all-tests task, gh action to surface

* remove cache location

* test version-file

* updated uv setup for consistency

* mypy fix

* update naming

* temporarily removed mypy from workflow
2025-08-12 18:35:36 +00:00
Eduard van ValkenburgandGitHub df9d85d1f0 Python: openai updates (#388)
* openai updates

* rebuild of openai structure

* updated responses structure

* renamed sample

* added file id support to code interpreter

* added hosted file ids to code interpretor

* mypy fixes

* removed default az cred from codebase

* updated agent name setup

* added kwargs to entra methods

* and further kwargs

* extra comment

* updated all samples

* readded custom get methods for responses

* updated int tests with ad credential

* missed one
2025-08-12 06:14:22 +00:00
Evan MattsonandGitHub 19676978e9 Python: introduce workflow checkpointing (#366)
* Add workflow checkpointing functionality.

* Reintroduce protocol that went missing during merge

* Checkpoint updates

* Fix ordering of checkpointing

* Cleanup

* Cleanup - thanks Copilot

* Cleanup - thanks Copilot

* State reset updates

* State reset updates 2

* Workflow fixes and updates. Addressed PR feedback

* A few updates
2025-08-11 22:33:46 +00:00