rename
This commit is contained in:
parent
d76fef38d0
commit
e48a55ba6f
|
|
@ -119,17 +119,18 @@ public class GoogleRealTimeProvider : IRealTimeCompletion
|
|||
{
|
||||
client.Connected += (sender, e) =>
|
||||
{
|
||||
_logger.LogInformation("Google Realtime Client connected");
|
||||
_logger.LogInformation("Google Realtime Client connected.");
|
||||
onModelReady();
|
||||
};
|
||||
|
||||
client.Disconnected += (sender, e) =>
|
||||
{
|
||||
_logger.LogInformation("Google Realtime Client disconnected");
|
||||
_logger.LogInformation("Google Realtime Client disconnected.");
|
||||
};
|
||||
|
||||
client.MessageReceived += async (sender, e) =>
|
||||
{
|
||||
_logger.LogInformation("User message received.");
|
||||
if (e.Payload.SetupComplete != null)
|
||||
{
|
||||
onConversationItemCreated(_client.ConnectionId.ToString());
|
||||
|
|
@ -156,12 +157,14 @@ public class GoogleRealTimeProvider : IRealTimeCompletion
|
|||
};
|
||||
|
||||
client.GenerationInterrupted += (sender, e) =>
|
||||
{
|
||||
{
|
||||
_logger.LogInformation("Audio generation interrupted.");
|
||||
onUserInterrupted();
|
||||
};
|
||||
|
||||
client.AudioReceiveCompleted += (sender, e) =>
|
||||
{
|
||||
{
|
||||
_logger.LogInformation("Audio receive completed.");
|
||||
onModelAudioResponseDone();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class AiWebsocketPipelineResponse : PipelineResponse
|
|||
public bool IsComplete { get; private set; } = false;
|
||||
|
||||
|
||||
public void HandleReceivedResult(WebSocketReceiveResult receivedResult, BinaryData receivedBytes)
|
||||
public void CollectReceivedResult(WebSocketReceiveResult receivedResult, BinaryData receivedBytes)
|
||||
{
|
||||
if (ContentStream.Length == 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class AsyncWebsocketDataResultEnumerator : IAsyncEnumerator<ClientResult>
|
|||
|
||||
var receivedBytes = _buffer.AsMemory(0, receivedResult.Count);
|
||||
var receivedData = BinaryData.FromBytes(receivedBytes);
|
||||
response.HandleReceivedResult(receivedResult, receivedData);
|
||||
response.CollectReceivedResult(receivedResult, receivedData);
|
||||
}
|
||||
|
||||
Current = ClientResult.FromResponse(response);
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@ conn.OnModelUserInterrupted = () =>
|
|||
conn.OnUserSpeechDetected = () =>
|
||||
JsonSerializer.Serialize(new
|
||||
{
|
||||
@event = "speech-detected"
|
||||
@event = "speech_detected"
|
||||
});
|
||||
|
||||
|
||||
await hub.ConnectToModel(async data =>
|
||||
{
|
||||
var response = JsonSerializer.Deserialize<ModelResponseEvent>(data);
|
||||
if (response.Event == "speech-detected")
|
||||
if (response.Event == "speech_detected")
|
||||
{
|
||||
channel.ClearBuffer();
|
||||
}
|
||||
|
|
@ -131,5 +131,5 @@ void DisplayAudioLevel(int level)
|
|||
// Display audio level as a bar
|
||||
Console.Write("\rMicrophone: [");
|
||||
Console.Write(new string('#', displayLevel).PadRight(sep, ' '));
|
||||
Console.Write("]");
|
||||
Console.Write("]\r");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue