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

35 lines
1.2 KiB
C#
Raw Normal View History

2025-03-05 18:29:28 +00:00
using System.Collections.Concurrent;
2025-02-07 22:40:57 +00:00
namespace BotSharp.Abstraction.Realtime.Models;
public class RealtimeHubConnection
{
public string Event { get; set; } = null!;
public string StreamId { 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 09:03:30 +00:00
public long? ResponseStartTimestampTwilio { get; set; }
2025-03-05 22:57:34 +00:00
public string KeypadInputBuffer { get; set; } = string.Empty;
2025-03-05 18:29:28 +00:00
public ConcurrentQueue<string> MarkQueue { get; set; } = new();
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!;
public string Data { get; set; } = string.Empty;
2025-02-09 23:31:46 +00:00
public string Model { get; set; } = null!;
2025-02-07 22:40:57 +00:00
public Func<string, object> OnModelMessageReceived { get; set; } = null!;
public Func<object> OnModelAudioResponseDone { get; set; } = null!;
public Func<object> OnModelUserInterrupted { get; set; } = null!;
2025-03-06 09:03:30 +00:00
public void ResetResponseState()
{
MarkQueue.Clear();
LastAssistantItemId = null;
ResponseStartTimestampTwilio = null;
}
public void ResetStreamState()
{
ResponseStartTimestampTwilio = null;
LatestMediaTimestamp = 0;
}
2025-02-07 22:40:57 +00:00
}