diff --git a/Directory.Packages.props b/Directory.Packages.props
index 88cbf622..28b63b2b 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -43,8 +43,8 @@
-
-
+
+
@@ -145,4 +145,4 @@
-
\ No newline at end of file
+
diff --git a/src/Infrastructure/BotSharp.Core.Realtime/Services/RealtimeHub.cs b/src/Infrastructure/BotSharp.Core.Realtime/Services/RealtimeHub.cs
index 49337253..bf813034 100644
--- a/src/Infrastructure/BotSharp.Core.Realtime/Services/RealtimeHub.cs
+++ b/src/Infrastructure/BotSharp.Core.Realtime/Services/RealtimeHub.cs
@@ -1,4 +1,6 @@
+using BotSharp.Abstraction.Functions.Models;
using BotSharp.Abstraction.MLTasks.Settings;
+using BotSharp.Abstraction.Options;
using BotSharp.Core.Infrastructures;
namespace BotSharp.Core.Realtime.Services;
@@ -144,6 +146,12 @@ public class RealtimeHub : IRealtimeHub
if (message.MessageType == MessageTypeName.FunctionCall &&
!string.IsNullOrEmpty(message.FunctionName))
{
+ if (message.FunctionName == "route_to_agent")
+ {
+ var instruction = JsonSerializer.Deserialize(message.FunctionArgs, BotSharpOptions.defaultJsonOptions);
+ await HookEmitter.Emit(_services, async hook => await hook.OnRoutingInstructionReceived(instruction, message));
+ }
+
await routing.InvokeFunction(message.FunctionName, message);
}
else
diff --git a/src/Plugins/BotSharp.Plugin.OpenAI/Providers/Realtime/RealTimeCompletionProvider.cs b/src/Plugins/BotSharp.Plugin.OpenAI/Providers/Realtime/RealTimeCompletionProvider.cs
index 4499f851..ba2dc522 100644
--- a/src/Plugins/BotSharp.Plugin.OpenAI/Providers/Realtime/RealTimeCompletionProvider.cs
+++ b/src/Plugins/BotSharp.Plugin.OpenAI/Providers/Realtime/RealTimeCompletionProvider.cs
@@ -163,8 +163,7 @@ public class RealTimeCompletionProvider : IRealTimeCompletion
if (response.Type == "error")
{
- var error = JsonSerializer.Deserialize(receivedText);
- _logger.LogError($"Error: {error.Body.Message}");
+ _logger.LogError($"{response.Type}: {receivedText}");
}
else if (response.Type == "session.created")
{
@@ -677,6 +676,7 @@ public class RealTimeCompletionProvider : IRealTimeCompletion
{
Provider = Provider,
Model = _model,
+ Prompt = "[hook.AfterGenerated] [UNCHANGED PROMPT]",
CompletionCount = data.Usage.OutputTokens,
PromptCount = data.Usage.InputTokens
});