Commit Graph

403 Commits

  • Python: Add OpenAI reasoning events support to Responses client (#698)
    * feat: add OpenAI reasoning events support with comprehensive test coverage
    
    - Implement reasoning event handling in OpenAI Responses client
      * Add support for ResponseReasoningTextDeltaEvent
      * Add support for ResponseReasoningTextDoneEvent
      * Add support for ResponseReasoningSummaryTextDeltaEvent
      * Add support for ResponseReasoningSummaryTextDoneEvent
      * Map all reasoning events to TextReasoningContent objects
      * Preserve metadata across reasoning events
    
    - Add comprehensive test coverage (5 focused test functions)
      * test_streaming_reasoning_text_delta_event
      * test_streaming_reasoning_text_done_event
      * test_streaming_reasoning_summary_text_delta_event
      * test_streaming_reasoning_summary_text_done_event
      * test_streaming_reasoning_events_preserve_metadata
    
    - Add sample demonstrating reasoning functionality
      * Shows how to enable reasoning in chat options
      * Demonstrates accessing reasoning content from responses
    
    - Code quality improvements
      * Follow existing code patterns and style guidelines
      * Organize imports properly
      * Maintain backwards compatibility
      * All tests pass and quality checks succeed
    
    * fix: resolve type errors and cleanup unused imports after rebase
    
    - Add proper hasattr checks for optional attributes in union types
    - Remove unused OpenAI event type imports
    - Fix line length formatting issues
    - Ensure type safety when accessing content attributes
  • Python: Add Concurrent orchestration builder support. Samples. Tests. (#683)
    * Add Concurrent orchestration builder support. Samples. Tests.
    
    * Add sample output
    
    * Add better docstrings
    
    * PR feedback
    
    * PR feedback
  • 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>
  • 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>
  • 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>
  • 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
  • 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>
  • 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>
  • 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
  • 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>
  • Python: Added examples with explicit settings (#562)
    * Added examples with explicit settings
    
    * Added info about RBAC roles
  • Python: Small fixes in examples (#540)
    * Fixed Ruff formatting
    
    * Added more info to chat response cancellation example
    
    * Improved example
    
    * Small fix
  • Python: Documentation updates (#538)
    * Added README for each sample sub-folder
    
    * More documentation updates
  • 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
  • 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>
  • 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
  • Python: Clean up and formatting (#487)
    * Clean up and formatting
    
    * Fix mypy
    
    * Bug fix
  • Python: Removed DefaultAzureCredential (#490)
    * Removed DefaultAzureCredential
    
    * Renamed ad_credential to credential
  • 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>
  • 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
  • Python: Request cancellation sample (#459)
    * request cancellation via tasks
    
    * fix missing kwargs
  • 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>
  • 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>
  • 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>
  • 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
  • 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
  • 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
  • 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
  • Python: added create_agent and removed need for Field in annotations (#380)
    * added create_agent
    
    * add minimal sample
    
    * allow multiple annotations
    
    * improved docstring
  • Python: Added examples for Azure OpenAI Responses agent (#363)
    * Added examples for Azure OpenAI Responses agent
    
    * Update python/samples/getting_started/agents/azure_responses_client/azure_responses_client_with_code_interpreter.py
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Define Workflow and Executor APIs (#272)
    * Workflow init commit
    
    * Add samples and clean up
    
    * ExecutionContext -> WorkflowContext
    
    * Address comments 1
    
    * Fix mypy
    
    * flatting folder structure, and rename contexts
    
    * Remove add_loop
    
    * Add map reduce sample, remove Activation conditions
    
    * Add AgentExecutor and allow multiple handlers per executor
    
    * Minor improvement
    
    * Add RequestInfoExecutor
    
    * Add unit tests part 1
    
    * Address comments 2
    
    * Pre-commit update
    
    * Add run method and more unit tests
    
    * Add xml docs
    
    * run_stream -> run_streaming
    
    * message_handler -> handler
    
    ---------
    
    Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
    Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>
  • Python: Azure Responses client (#311)
    * Azure Responses client
    
    * Fix a change made in the wrong place
    
    * allow api_version and token_endpoint to use env vars
    
    * Add getting started sample
    
    * add responses deployment name env var
    
    * update azure clients to use defaults for api_version and token_endpoint
    
    * make tests more reliable
    
    ---------
    
    Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
  • Python: Azure OpenAI Assistants Chat Client and Agent (#300)
    * Initial version of assistant client
    
    * More updates to assistant client
    
    * Finished assistant chat client implementation
    
    * Small fixes and basic example
    
    * Added code interpreter example
    
    * More examples
    
    * Added chat client example
    
    * Small fixes
    
    * Added tests
    
    * Enabled telemetry
    
    * Small fix
    
    * Removed files temporarily
    
    * Revert "Removed files temporarily"
    
    This reverts commit 5cdfa0d299.
    
    * Small fixes
    
    * Addressed PR feedback
    
    * Fixed tests
    
    * Small update
    
    * Added Azure assistants client and examples
    
    * Added tests
    
    * Small fix
  • Python: small fixes in foundry (#297)
    * small fixes in foundry
    
    * other samples updated
    
    * make it optional
    
    * added instructions and response format to create agent
    
    * mypy fix
    
    * shortened main readme and improved python readme
  • Python: OpenAI Assistants Chat Client and Agent (#288)
    * Initial version of assistant client
    
    * More updates to assistant client
    
    * Finished assistant chat client implementation
    
    * Small fixes and basic example
    
    * Added code interpreter example
    
    * More examples
    
    * Added chat client example
    
    * Small fixes
    
    * Added tests
    
    * Enabled telemetry
    
    * Small fix
    
    * Removed files temporarily
    
    * Revert "Removed files temporarily"
    
    This reverts commit 5cdfa0d299.
    
    * Small fixes
    
    * Addressed PR feedback
    
    * Fixed tests
    
    * Small update
  • Python: add agent telemetry (#283)
    * add agent telemetry
    
    * updated comments
    
    * update AgentRunResponseUpdate
    
    * updated create_agent var
    
    ---------
    
    Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
  • Python: updated API in sync with dotnet (#269)
    * updated API in sync with dotnet
    
    * fix test
    
    * updated name and display_name
    
    * fixed mypy setup
    
    * add pre-commit cache
  • Python: OpenAI Responses Agent - threads, code interpreter, bug fixes and examples (#242)
    * Added basic example with small fix
    
    * Added example with function tools
    
    * Added example with thread management
    
    * Small renaming
    
    * Added example with code interpreter
  • Python telemetry (#223)
    * initial work on telemetry
    
    * moved tool operation const
    
    * missing quotes
    
    * working otel with samples
    
    * updated readme and other assets
    
    * added tests
    
    * added tests
    
    * small updates
    
    * updated genaiattributes docs
    
    * updated tests
    
    * additional warning
    
    * cleanup of tests
  • Python: OpenAI responses client (#239)
    * Responses client WIP
    
    * add responses class
    
    * fix typing errors
    
    * move test
    
    * streaming responses, structured outputs
    
    * tests
    
    * Update python/packages/main/tests/openai/test_openai_responses_client.py
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * pr comments
    
    * fix override import
    
    * fix mypy
    
    * add missing function override
    
    * PR comments
    
    * add docstrings
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Python: Added fixes and more examples for OpenAI and Azure chat client agents (#232)
    * Added non-streaming and streaming examples
    
    * Updated resource management
    
    * Added examples with thread management
    
    * Added function tools examples
    
    * Small rename
    
    * Added code interpreter example
    
    * Updated example
    
    * Addressed PR feedback
    
    * Added more OpenAI and Azure chat completion examples
    
    * File renaming
    
    * Small fix in tests
    
    * Small revert
    
    * More renaming
    
    * Small fix
  • Python: Added fixes and more examples for Foundry agent (#217)
    * Added non-streaming and streaming examples
    
    * Updated resource management
    
    * Added examples with thread management
    
    * Added function tools examples
    
    * Small rename
    
    * Added code interpreter example
    
    * Updated example
    
    * Addressed PR feedback
    
    * Addressed PR feedback
  • Python: Added more examples (#208)
    * Small cleanup
    
    * Added Azure and Foundry chat client samples
    
    * Added Azure chat client agent example
  • Python: Implemented FoundryChatClient (#193)
    * Initial version of FoundryChatClient
    
    * Updates to the tool call streaming wrapper
    
    * Small fixes
    
    * Small updates and addressed PR feedback
    
    * Handle automatic client creation
    
    * Small improvement
    
    * Added credential parameter
    
    * Small improvements
    
    * Made FoundryChatClient disposable
    
    * Small fixes
    
    * Added unit tests
    
    * Refactored samples
    
    * Small improvements
    
    * Small fix
    
    * Addressed PR feedback
    
    * Small fixes
    
    * Small updates
    
    * Small fix
    
    * Addressed PR feedback