File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
BotSharp.Abstraction/Routing Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public interface IRoutingService
11
11
List < RoutingHandlerDef > GetHandlers ( ) ;
12
12
void ResetRecursiveCounter ( ) ;
13
13
Task < bool > InvokeAgent ( string agentId , List < RoleDialogModel > dialogs ) ;
14
+ Task < bool > InvokeFunction ( string name , RoleDialogModel message ) ;
14
15
Task < RoleDialogModel > InstructLoop ( RoleDialogModel message ) ;
15
16
16
17
/// <summary>
Original file line number Diff line number Diff line change
1
+ using BotSharp . Abstraction . Functions ;
2
+
3
+ namespace BotSharp . Core . Routing ;
4
+
5
+ public partial class RoutingService
6
+ {
7
+ public async Task < bool > InvokeFunction ( string name , RoleDialogModel message )
8
+ {
9
+ var function = _services . GetServices < IFunctionCallback > ( ) . FirstOrDefault ( x => x . Name == name ) ;
10
+ if ( function == null ) return false ;
11
+
12
+ return await function . Execute ( message ) ;
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments