Merge pull request #911 from hchen2020/master
Output input audio transcript.
This commit is contained in:
commit
ded711d164
|
|
@ -137,7 +137,7 @@ public class RealtimeHub : IRealtimeHub
|
||||||
|
|
||||||
await completer.UpdateSession(conn);
|
await completer.UpdateSession(conn);
|
||||||
await completer.InsertConversationItem(message);
|
await completer.InsertConversationItem(message);
|
||||||
await completer.TriggerModelInference($"Continue to proceed user request in {inst.AgentName}.");
|
await completer.TriggerModelInference($"Guide the user through the next steps of the process as this Agent ({inst.AgentName}), following its instructions and operational procedures.");
|
||||||
}
|
}
|
||||||
else if (message.FunctionName == "util-routing-fallback_to_router")
|
else if (message.FunctionName == "util-routing-fallback_to_router")
|
||||||
{
|
{
|
||||||
|
|
@ -147,7 +147,7 @@ public class RealtimeHub : IRealtimeHub
|
||||||
|
|
||||||
await completer.UpdateSession(conn);
|
await completer.UpdateSession(conn);
|
||||||
await completer.InsertConversationItem(message);
|
await completer.InsertConversationItem(message);
|
||||||
await completer.TriggerModelInference("Reply user request.");
|
await completer.TriggerModelInference($"Check with user whether to proceed the new request: {inst.Reason}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -157,7 +157,7 @@ public class RealtimeHub : IRealtimeHub
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// append transcript to conversation
|
// append output audio transcript to conversation
|
||||||
storage.Append(conn.ConversationId, message);
|
storage.Append(conn.ConversationId, message);
|
||||||
dialogs.Add(message);
|
dialogs.Add(message);
|
||||||
|
|
||||||
|
|
@ -166,10 +166,7 @@ public class RealtimeHub : IRealtimeHub
|
||||||
hook.SetAgent(agent)
|
hook.SetAgent(agent)
|
||||||
.SetConversation(conversation);
|
.SetConversation(conversation);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(message.Content))
|
await hook.OnResponseGenerated(message);
|
||||||
{
|
|
||||||
await hook.OnResponseGenerated(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -180,9 +177,17 @@ public class RealtimeHub : IRealtimeHub
|
||||||
},
|
},
|
||||||
onInputAudioTranscriptionCompleted: async message =>
|
onInputAudioTranscriptionCompleted: async message =>
|
||||||
{
|
{
|
||||||
// append transcript to conversation
|
// append input audio transcript to conversation
|
||||||
storage.Append(conn.ConversationId, message);
|
storage.Append(conn.ConversationId, message);
|
||||||
dialogs.Add(message);
|
dialogs.Add(message);
|
||||||
|
|
||||||
|
foreach (var hook in hookProvider.HooksOrderByPriority)
|
||||||
|
{
|
||||||
|
hook.SetAgent(agent)
|
||||||
|
.SetConversation(conversation);
|
||||||
|
|
||||||
|
await hook.OnMessageReceived(message);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onUserInterrupted: async () =>
|
onUserInterrupted: async () =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue