@@ -13,8 +13,10 @@ internal class ChatProtocolExecutorOptions
1313 public ChatRole ? StringMessageChatRole { get ; set ; }
1414}
1515
16- // TODO: Make this a public type (in a later PR; todo: make an issue)
17- internal abstract class ChatProtocolExecutor : StatefulExecutor < List < ChatMessage > >
16+ /// <summary>
17+ /// .
18+ /// </summary>
19+ public abstract class ChatProtocolExecutor : StatefulExecutor < List < ChatMessage > >
1820{
1921 private readonly static Func < List < ChatMessage > > s_initFunction = ( ) => [ ] ;
2022 private readonly ChatRole ? _stringMessageChatRole ;
@@ -25,6 +27,11 @@ internal ChatProtocolExecutor(string id, ChatProtocolExecutorOptions? options =
2527 this . _stringMessageChatRole = options ? . StringMessageChatRole ;
2628 }
2729
30+ /// <summary>
31+ /// .
32+ /// </summary>
33+ /// <param name="routeBuilder"></param>
34+ /// <returns></returns>
2835 protected override RouteBuilder ConfigureRoutes ( RouteBuilder routeBuilder )
2936 {
3037 if ( this . _stringMessageChatRole . HasValue )
@@ -40,6 +47,13 @@ protected override RouteBuilder ConfigureRoutes(RouteBuilder routeBuilder)
4047 . AddHandler < TurnToken > ( this . TakeTurnAsync ) ;
4148 }
4249
50+ /// <summary>
51+ /// .
52+ /// </summary>
53+ /// <param name="message"></param>
54+ /// <param name="context"></param>
55+ /// <param name="cancellationToken"></param>
56+ /// <returns></returns>
4357 protected ValueTask AddMessageAsync ( ChatMessage message , IWorkflowContext context , CancellationToken cancellationToken = default )
4458 {
4559 return this . InvokeWithStateAsync ( ForwardMessageAsync , context , cancellationToken : cancellationToken ) ;
@@ -52,6 +66,13 @@ protected ValueTask AddMessageAsync(ChatMessage message, IWorkflowContext contex
5266 }
5367 }
5468
69+ /// <summary>
70+ /// .
71+ /// </summary>
72+ /// <param name="messages"></param>
73+ /// <param name="context"></param>
74+ /// <param name="cancellationToken"></param>
75+ /// <returns></returns>
5576 protected ValueTask AddMessagesAsync ( IEnumerable < ChatMessage > messages , IWorkflowContext context , CancellationToken cancellationToken = default )
5677 {
5778 return this . InvokeWithStateAsync ( ForwardMessageAsync , context , cancellationToken : cancellationToken ) ;
@@ -64,6 +85,13 @@ protected ValueTask AddMessagesAsync(IEnumerable<ChatMessage> messages, IWorkflo
6485 }
6586 }
6687
88+ /// <summary>
89+ /// .
90+ /// </summary>
91+ /// <param name="token"></param>
92+ /// <param name="context"></param>
93+ /// <param name="cancellationToken"></param>
94+ /// <returns></returns>
6795 public ValueTask TakeTurnAsync ( TurnToken token , IWorkflowContext context , CancellationToken cancellationToken = default )
6896 {
6997 return this . InvokeWithStateAsync ( InvokeTakeTurnAsync , context , cancellationToken : cancellationToken ) ;
@@ -81,5 +109,13 @@ await this.TakeTurnAsync(maybePendingMessages ?? s_initFunction(), context, toke
81109 }
82110 }
83111
112+ /// <summary>
113+ /// .
114+ /// </summary>
115+ /// <param name="messages"></param>
116+ /// <param name="context"></param>
117+ /// <param name="emitEvents"></param>
118+ /// <param name="cancellationToken"></param>
119+ /// <returns></returns>
84120 protected abstract ValueTask TakeTurnAsync ( List < ChatMessage > messages , IWorkflowContext context , bool ? emitEvents , CancellationToken cancellationToken = default ) ;
85121}
0 commit comments