Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public interface IRoutingHook : IHookBase
Task OnRoutingInstructionReceived(FunctionCallFromLlm instruct, RoleDialogModel message)
=> Task.CompletedTask;

/// <summary>
/// Routing instruction execution is completed
/// </summary>
/// <param name="instruct"></param>
/// <param name="message"></param>
/// <returns></returns>
Task OnRoutingInstructionCompleted(FunctionCallFromLlm instruct, RoleDialogModel message)
=> Task.CompletedTask;

Task OnRoutingInstructionRevised(FunctionCallFromLlm instruct, RoleDialogModel message)
=> Task.CompletedTask;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ await HookEmitter.Emit<IRoutingHook>(_services, async hook => await hook.OnRouti
var agent = await agentService.GetAgent(agentId);
inst.AgentName = agent.Name;

await HookEmitter.Emit<IRoutingHook>(_services, async hook => await hook.OnRoutingInstructionCompleted(inst, message),
agent.Id);
if (message.StopCompletion)
{
return message;
}

if (inst.ExecutingDirectly)
{
message.Content = inst.Question;
Expand Down
Loading