2025-02-03 04:02:36 +00:00
|
|
|
using BotSharp.Abstraction.Realtime.Models;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Abstraction.MLTasks;
|
|
|
|
|
|
|
|
|
|
public interface IRealTimeCompletion
|
|
|
|
|
{
|
|
|
|
|
string Provider { get; }
|
2025-02-07 22:40:57 +00:00
|
|
|
string Model { get; }
|
2025-02-03 04:02:36 +00:00
|
|
|
|
|
|
|
|
void SetModelName(string model);
|
2025-02-09 23:31:46 +00:00
|
|
|
|
|
|
|
|
Task Connect(RealtimeHubConnection conn,
|
|
|
|
|
Action onModelReady,
|
|
|
|
|
Action<string> onModelAudioDeltaReceived,
|
|
|
|
|
Action onModelAudioResponseDone,
|
|
|
|
|
Action<string> onAudioTranscriptDone,
|
|
|
|
|
Action<string> onModelResponseDone,
|
|
|
|
|
Action onUserInterrupted);
|
|
|
|
|
Task AppenAudioBuffer(string message);
|
|
|
|
|
|
|
|
|
|
Task SendEventToModel(object message);
|
|
|
|
|
Task Disconnect();
|
|
|
|
|
|
2025-02-03 04:02:36 +00:00
|
|
|
Task<RealtimeSession> CreateSession(Agent agent, List<RoleDialogModel> conversations);
|
2025-02-09 23:31:46 +00:00
|
|
|
Task<string> UpdateInitialSession(RealtimeHubConnection conn);
|
2025-02-10 21:52:10 +00:00
|
|
|
Task<string> InsertConversationItem(RoleDialogModel message);
|
|
|
|
|
Task TriggerModelInference(string? instructions = null);
|
2025-02-09 23:31:46 +00:00
|
|
|
Task<List<RoleDialogModel>> OnResponsedDone(RealtimeHubConnection conn, string response);
|
2025-02-03 04:02:36 +00:00
|
|
|
}
|