Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d846453090
|
|
@ -43,8 +43,8 @@
|
|||
<PackageVersion Include="Whisper.net" Version="1.8.1" />
|
||||
<PackageVersion Include="Whisper.net.Runtime" Version="1.8.1" />
|
||||
<PackageVersion Include="NCrontab" Version="3.3.3" />
|
||||
<PackageVersion Include="Azure.AI.OpenAI" Version="2.1.0" />
|
||||
<PackageVersion Include="OpenAI" Version="2.1.0" />
|
||||
<PackageVersion Include="Azure.AI.OpenAI" Version="2.2.0-beta.4" />
|
||||
<PackageVersion Include="OpenAI" Version="2.2.0-beta.4" />
|
||||
<PackageVersion Include="MailKit" Version="4.11.0" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.8" />
|
||||
<PackageVersion Include="MySql.Data" Version="9.0.0" />
|
||||
|
|
@ -145,4 +145,4 @@
|
|||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.25" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.26" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -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<FunctionCallFromLlm>(message.FunctionArgs, BotSharpOptions.defaultJsonOptions);
|
||||
await HookEmitter.Emit<IRoutingHook>(_services, async hook => await hook.OnRoutingInstructionReceived(instruction, message));
|
||||
}
|
||||
|
||||
await routing.InvokeFunction(message.FunctionName, message);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -163,8 +163,7 @@ public class RealTimeCompletionProvider : IRealTimeCompletion
|
|||
|
||||
if (response.Type == "error")
|
||||
{
|
||||
var error = JsonSerializer.Deserialize<ServerEventErrorResponse>(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
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue