Skip to content

Output input audio transcript. #911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2025
Merged
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
21 changes: 13 additions & 8 deletions src/Infrastructure/BotSharp.Core/Realtime/RealtimeHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ await completer.Connect(conn,

await completer.UpdateSession(conn);
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")
{
Expand All @@ -147,7 +147,7 @@ await completer.Connect(conn,

await completer.UpdateSession(conn);
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
{
Expand All @@ -157,7 +157,7 @@ await completer.Connect(conn,
}
else
{
// append transcript to conversation
// append output audio transcript to conversation
storage.Append(conn.ConversationId, message);
dialogs.Add(message);

Expand All @@ -166,10 +166,7 @@ await completer.Connect(conn,
hook.SetAgent(agent)
.SetConversation(conversation);

if (!string.IsNullOrEmpty(message.Content))
{
await hook.OnResponseGenerated(message);
}
await hook.OnResponseGenerated(message);
}
}
}
Expand All @@ -180,9 +177,17 @@ await completer.Connect(conn,
},
onInputAudioTranscriptionCompleted: async message =>
{
// append transcript to conversation
// append input audio transcript to conversation
storage.Append(conn.ConversationId, message);
dialogs.Add(message);

foreach (var hook in hookProvider.HooksOrderByPriority)
{
hook.SetAgent(agent)
.SetConversation(conversation);

await hook.OnMessageReceived(message);
}
},
onUserInterrupted: async () =>
{
Expand Down
Loading