* Addressing a SK bug where threads can't be reused + threads should be capture after the request, not created before
* Using storedenabled to align with AF default behavior
* Address copilot comment
* Address Azure + OpenAI remaining sample improvements
* Update OpenTelemetryAgent to latest spec
It was stale. Rather than try to keep it up-to-date manually, I've changed it to piggy back on OpenTelemetryChatClient, so that it inherits everything OpenTelemetryChatClient does and then augments it just with agent-specific tags.
* Address feedback / merge
* Make serialize methods sync and rename one to match others.
* Remove unnecessary async postfixes.
* Remove nullability of ChatMessageStore.Serialize return type, since the default JsonElement already represents an undefined json element.
* Fix unit test
* Rename AI Agent packages to use Microsoft.Agents.AI
* Fix for build
* Fix formatting
* Fix formatting
* Ignore in VSTHRD200 in migration samples
* Ignore in VSTHRD200 in migration samples
* Add some missing projects and run format
* Fix build errors
* Address code review feedback
* Fix merge issues
---------
Co-authored-by: Mark Wallace <markwallace@microsoft.com>
* feat: Make Executor id field mandatory
When checkpointing is involved, it is critical to keep executor ids consistent between runs, even when recreating a new object tree for the workflow.
The default id-setting mechanism generated a guid for part of the id, making it not work when restoring from a checkpoint.
This change prevents this situation from arising.
* feat: Enable running untyped Workflows
With the change to enable delay-instantiation of executors and support for async Executor factory methods, we must instantiate the starting executor to know what are the valid input types for the workflow.
To avoid forcing instantiation every time, and to better support workflows with multiple input types, we enable support for build and interacting with the base Workflow type without type annotations, and remove the requirement to know a valid input type when initiating a run.
* feat: Support Output from any executor and multiple outputs.
* Add AgentWorkflowBuilder group chat
And fix a variety of issues along the way:
- Use DateTime{Offset}.UtcNow rather than Now
- AIAgentHostExecutor shouldn't be publishing empty messages
- Sequential workflows should be flowing all history and not just the output from the previous agent as the input into the next agent
- Renamed some of the new agent workflow methods... still not super happy with the shape, though
- Simplified handoffs builder, e.g. using a hashset with a custom comparer instead of a dictionary
- Improved multi-service use by trying to change assistant->user role for messages created by other agents
- Changed MessageMerger to rely on M.E.AI's coalescing more and to avoid empty contents / text
- Ensured that messages from ChatClientAgent include MessageId and CreatedAt timestamps
- Avoided including instructions for agents in a handoff workflow that don't have any handoffs
- Removed the unnecessary end function in handoffs
- Improved naming of executors to include agent name for debuggability
- Use "N" formatting with Guid.ToString everywhere, to avoid the unnecessary extra dash character which is also not valid in various places (like function tool names)
- Replace `params T[]` with `params IEnumerable<T>` to make public APIs more flexible in what they consume
* Address feedback
- Fix unintentional provider change in sample
* Add GetService for AIContextProviders and ChatMessageStore
* Change styling and fix format issues
* Update sample code to allow for missing memory component.
* Subclass AgentThread so that different agents have their own threads with their own typed settings.
* Address PR comment.
* Add unit tests for base abstract threads
* Fix style warning
* Fix stlying
* FIx and suppress warnings as needed.
* Remove covariant thread response types and fix some styling.
* Remove unecessary json property name attributes and make OrchestratingAgentThread private
* Fix break from merge from main.
* Fix formatting
* Fix deserialization bug in Memory sample
* Remove thread deletion from basic samples.
* Remove public constructors for thread subclasses and add more factory methods to concrete agent types.
* Update AgentProxy thread constructors to be internal as well.
* Revert AgentProxyThread to internal
* Change AIContextProvider to internal set
* Change conversation id and message store properties to internal set
* Update styling.
* Seal various thread types.
* Add thread type check for thread deletion
* Fix tests after latest merge from main
* Add thread type checks for thread deletion.
---------
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
* feat: Support Checkpoint Serialization
* Implements serialization roundtripping for checkpoints.
* Adds support for JSON serialization
* Adds FileSystem-based checkpoint persistence
* fix: Executor State does not deserialize correctly
The StateManager was not properly handling delay-deserialized values.
* Fix PortableValue handling in StateManager (this makes it delegate to PortableValue the uwnrapping)
* Fix UnitTest to actually test checkpoint serialization
* Additional review comment fixes
---------
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
* Add AIContextProvider support
* Address feedback.
* Address PR comments.
* Switch to valuetask and remove parallel calls for AIContextProvider
* Remove Model from ModelInvokingAsync method name
* Remove agent thread id again and remove it from context provider interface
* Add AIContextProvider serialization support to AgentThread and update sample to show this feature
* Address PR comments
* Improve memory sample
* Update sample comment.
* Remove AggregateAIContextProvider for now since it makes too many assumptions. We can include it later as a sample if needed.
* Update AIContextProviders to have an Invoked method instead of MessagesAddingAsync.
* Remove unused using.
* Address PR comments.
* Address PR comment.
* Update comment.
* Update comment
* Address PR comments.
* Change implementation to use AsFunctionTool extension method to create a function from an agent
* Update dotnet/tests/Microsoft.Extensions.AI.Agents.UnitTests/AgentExtensionsTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Address code review feedback and add a new sample
* Address some code review feedback
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update AIAgent,Run to take IEnumerable instead of IReadonlyCollection
* Address PR comment.
* Cast to IReadonlyCollection since this is typically all that is required to avoid unecessary allocation.
* Update OrchestratingAgent protected methods as well.
* Add getting started samples that show how to call MCP tools
* Add getting started samples that show how to call MCP tools
* Update dotnet/samples/GettingStarted/ModelContextProtocol/Agent_MCP_Server_Auth/README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix README
* Address code review feedback
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>