Merge pull request #372 from hchen2020/master
Save function result to Storage
This commit is contained in:
commit
198ceb409b
|
|
@ -12,7 +12,7 @@ public class HumanInterventionNeededHandler : RoutingHandlerBase, IRoutingHandle
|
|||
{
|
||||
new ParameterPropertyDef("reason", "why need customer service"),
|
||||
new ParameterPropertyDef("summary", "the whole conversation summary with important information"),
|
||||
new ParameterPropertyDef("response", "tell the user that you are being transferred to customer service")
|
||||
new ParameterPropertyDef("response", "confirm with user that whether to connect with customer service")
|
||||
};
|
||||
|
||||
public HumanInterventionNeededHandler(IServiceProvider services, ILogger<HumanInterventionNeededHandler> logger, RoutingSettings settings)
|
||||
|
|
|
|||
|
|
@ -74,9 +74,11 @@ public partial class RoutingService
|
|||
else
|
||||
{
|
||||
// Save to memory dialogs
|
||||
dialogs.Add(RoleDialogModel.From(message,
|
||||
var msg = RoleDialogModel.From(message,
|
||||
role: AgentRole.Function,
|
||||
content: message.Content));
|
||||
content: message.Content);
|
||||
|
||||
dialogs.Add(msg);
|
||||
|
||||
// Send to Next LLM
|
||||
var agentId = routing.Context.GetCurrentAgentId();
|
||||
|
|
|
|||
|
|
@ -68,6 +68,10 @@ public partial class RoutingService
|
|||
message.FunctionName = originalFunctionName;
|
||||
}
|
||||
|
||||
// Save to Storage as well
|
||||
var storage = _services.GetRequiredService<IConversationStorage>();
|
||||
storage.Append(Context.ConversationId, message);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ Route to the last handling agent in priority.
|
|||
{% if expected_next_action_agent != empty -%}
|
||||
Expected next action agent is {{ expected_next_action_agent }}.
|
||||
{%- endif %}
|
||||
If user wants to speak to customer service, use function human_intervention_needed.
|
||||
If user wants to speak to customer service, use function human_intervention_needed.
|
||||
If user wants to or is processing with a specific task that can be handled by agents, respond with appropriate agents.
|
||||
Loading…
Reference in a new issue