minor change
This commit is contained in:
parent
bc40deed54
commit
4c4dce852d
|
|
@ -1,25 +0,0 @@
|
|||
using BotSharp.Abstraction.Functions;
|
||||
using BotSharp.Abstraction.Options;
|
||||
|
||||
namespace BotSharp.Core.Functions;
|
||||
|
||||
public class GetLocationFn : IFunctionCallback
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
|
||||
public GetLocationFn(IServiceProvider services)
|
||||
{
|
||||
_services = services;
|
||||
}
|
||||
|
||||
public string Name => "get_location";
|
||||
public string Indication => "Finding location";
|
||||
|
||||
public async Task<bool> Execute(RoleDialogModel message)
|
||||
{
|
||||
var args = JsonSerializer.Deserialize<Location>(message.FunctionArgs, BotSharpOptions.defaultJsonOptions);
|
||||
|
||||
message.Content = $"There are a lot of fun events here in {args.City}";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
using BotSharp.Abstraction.Functions;
|
||||
using BotSharp.Abstraction.Models;
|
||||
using BotSharp.Abstraction.Options;
|
||||
using BotSharp.Abstraction.SideCar;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace BotSharp.Core.Functions;
|
||||
|
|
@ -21,24 +18,9 @@ public class GetWeatherFn : IFunctionCallback
|
|||
public async Task<bool> Execute(RoleDialogModel message)
|
||||
{
|
||||
//var args = JsonSerializer.Deserialize<Location>(message.FunctionArgs, BotSharpOptions.defaultJsonOptions);
|
||||
|
||||
//var sidecar = _services.GetService<IConversationSideCar>();
|
||||
//var states = GetSideCarStates();
|
||||
|
||||
//var userMessage = $"Please find the information at location {args.City}, {args.State}";
|
||||
//var response = await sidecar.SendMessage(BuiltInAgentId.Chatbot, userMessage, states: states);
|
||||
message.Content = $"It is a sunny day.";
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<MessageState> GetSideCarStates()
|
||||
{
|
||||
var sideCarStates = new List<MessageState>()
|
||||
{
|
||||
new("channel", "email")
|
||||
};
|
||||
return sideCarStates;
|
||||
}
|
||||
}
|
||||
|
||||
class Location
|
||||
|
|
|
|||
|
|
@ -273,13 +273,10 @@ public class GoogleRealTimeProvider : IRealTimeCompletion
|
|||
|
||||
public async Task<string> UpdateSession(RealtimeHubConnection conn, bool isInit = false)
|
||||
{
|
||||
var convService = _services.GetRequiredService<IConversationService>();
|
||||
var agentService = _services.GetRequiredService<IAgentService>();
|
||||
var realtimeSetting = _services.GetRequiredService<RealtimeModelSettings>();
|
||||
|
||||
var conv = await convService.GetConversation(conn.ConversationId);
|
||||
var agent = await agentService.LoadAgent(conn.CurrentAgentId);
|
||||
|
||||
var (prompt, request) = PrepareOptions(agent, []);
|
||||
|
||||
var config = request.GenerationConfig;
|
||||
|
|
|
|||
Loading…
Reference in a new issue