-
Notifications
You must be signed in to change notification settings - Fork 1k
.NET: [BREAKING] feat: Improve Agent hosting inside Workflows #3142
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
base: main
Are you sure you want to change the base?
Changes from all commits
acbf254
035f832
6b3782d
15a25dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||
| // Copyright (c) Microsoft. All rights reserved. | ||||||
|
|
||||||
| using Microsoft.Extensions.AI; | ||||||
|
|
||||||
| namespace Microsoft.Agents.AI.Workflows; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// . | ||||||
| /// </summary> | ||||||
| public sealed class AIAgentHostOptions | ||||||
| { | ||||||
| /// <summary> | ||||||
| /// Gets or sets a value indicating whether agent streaming update events should be emitted during execution. | ||||||
| /// If <see langword="null"/>, the value will be taken from the <see cref="TurnToken"/> /> | ||||||
|
||||||
| /// If <see langword="null"/>, the value will be taken from the <see cref="TurnToken"/> /> | |
| /// If <see langword="null"/>, the value will be taken from the <see cref="TurnToken"/>. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |||||
|
|
||||||
| using System; | ||||||
| using System.Collections.Generic; | ||||||
| using System.Diagnostics.CodeAnalysis; | ||||||
| using System.Threading; | ||||||
| using System.Threading.Tasks; | ||||||
| using Microsoft.Extensions.AI; | ||||||
|
|
@@ -18,6 +19,12 @@ public class ChatProtocolExecutorOptions | |||||
| /// If set, the executor will accept string messages and convert them to chat messages with this role. | ||||||
| /// </summary> | ||||||
| public ChatRole? StringMessageChatRole { get; set; } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Gets or sets a value indicating whether the executor should automatically send the <see cref="TurnToken"/> | ||||||
| /// after returning from <see cref="ChatProtocolExecutor.TakeTurnAsync(List{ChatMessage}, IWorkflowContext, bool?, CancellationToken)"/> | ||||||
| /// </summary> | ||||||
| public bool AutoSendTurnToken { get; set; } = true; | ||||||
| } | ||||||
|
|
||||||
| /// <summary> | ||||||
|
|
@@ -26,8 +33,8 @@ public class ChatProtocolExecutorOptions | |||||
| /// </summary> | ||||||
| public abstract class ChatProtocolExecutor : StatefulExecutor<List<ChatMessage>> | ||||||
| { | ||||||
| private static readonly Func<List<ChatMessage>> s_initFunction = () => []; | ||||||
| private readonly ChatRole? _stringMessageChatRole; | ||||||
| internal static readonly Func<List<ChatMessage>> s_initFunction = () => []; | ||||||
| private readonly ChatProtocolExecutorOptions _options; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Initializes a new instance of the <see cref="ChatProtocolExecutor"/> class. | ||||||
|
|
@@ -38,16 +45,28 @@ public abstract class ChatProtocolExecutor : StatefulExecutor<List<ChatMessage>> | |||||
| protected ChatProtocolExecutor(string id, ChatProtocolExecutorOptions? options = null, bool declareCrossRunShareable = false) | ||||||
| : base(id, () => [], declareCrossRunShareable: declareCrossRunShareable) | ||||||
| { | ||||||
| this._stringMessageChatRole = options?.StringMessageChatRole; | ||||||
| this._options = options ?? new(); | ||||||
| } | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Gets a value indicating whether string-based messages are by this <see cref="ChatProtocolExecutor"/>. | ||||||
|
||||||
| /// Gets a value indicating whether string-based messages are by this <see cref="ChatProtocolExecutor"/>. | |
| /// Gets a value indicating whether string-based messages are supported by this <see cref="ChatProtocolExecutor"/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XML documentation summary for AIAgentHostOptions is incomplete. It only contains a period "." without any descriptive text. Please provide a complete summary describing what this class represents and its purpose in configuring AI agent hosting behavior.