BotSharp/src/Infrastructure/BotSharp.Abstraction/Realtime/Models/RealtimeHubConnection.cs

31 lines
1.1 KiB
C#
Raw Normal View History

2025-02-07 22:40:57 +00:00
namespace BotSharp.Abstraction.Realtime.Models;
public class RealtimeHubConnection
{
public string StreamId { get; set; } = null!;
2025-04-23 20:39:42 +00:00
public string UserSessionId {get;set;} = null!;
2025-03-06 09:03:30 +00:00
public string? LastAssistantItemId { get; set; } = null!;
2025-03-05 18:29:28 +00:00
public long LatestMediaTimestamp { get; set; }
2025-03-06 18:01:43 +00:00
public long? ResponseStartTimestamp { get; set; }
2025-03-05 22:57:34 +00:00
public string KeypadInputBuffer { get; set; } = string.Empty;
2025-02-28 18:44:59 +00:00
public string CurrentAgentId { get; set; } = null!;
2025-02-07 22:40:57 +00:00
public string ConversationId { get; set; } = null!;
2025-04-11 21:29:44 +00:00
public Func<string> OnModelReady { get; set; } = () => string.Empty;
2025-04-07 04:15:27 +00:00
public Func<string, string> OnModelMessageReceived { get; set; } = null!;
public Func<string> OnModelAudioResponseDone { get; set; } = null!;
public Func<string> OnModelUserInterrupted { get; set; } = null!;
2025-04-14 15:45:28 +00:00
public Func<string> OnUserSpeechDetected { get; set; } = () => string.Empty;
2025-03-06 09:03:30 +00:00
public void ResetResponseState()
{
LastAssistantItemId = null;
2025-03-06 18:01:43 +00:00
ResponseStartTimestamp = null;
2025-03-06 09:03:30 +00:00
}
public void ResetStreamState()
{
2025-03-06 18:01:43 +00:00
ResponseStartTimestamp = null;
2025-03-06 09:03:30 +00:00
LatestMediaTimestamp = 0;
}
2025-02-07 22:40:57 +00:00
}