Conversation
Implements ISpeechToTextClient for xAI's Grok models, including: - GrokSpeechToTextClient: unary transcription via POST /v1/stt and streaming transcription via wss://.../v1/stt WebSocket protocol. Handles session handshake, chunked audio upload, interim/final transcript events, word-level timing, and language detection. - GrokSpeechToTextOptions: Grok-specific options for audio format, sample rate, multichannel, diarization, interim results, and endpointing timeout. - AsISpeechToTextClient() extension on GrokClient wires up the client with the correct HTTP handler and WebSocket factory. Fix: voice REST clients (TTS and STT) were accidentally reusing the gRPC channel's BalancerHttpHandler, which throws for plain HTTP/1.1 requests. Added GrokClient.HttpHandler, backed by a separate httpHandlers cache using the same Polly retry pipeline but independent of the gRPC channel. AsITextToSpeechClient and AsISpeechToTextClient now use client.HttpHandler instead of client.ChannelHandler.Handler. The channels dictionary now holds ChannelBase directly rather than a tuple, since the HttpMessageHandler is no longer needed from it. Add TextToSpeech_SpeechToText integration test that streams TTS audio to a temp file and transcribes it back with STT, asserting the roundtrip text matches (punctuation-insensitive via NormalizeTranscription). Update readme with ISpeechToTextClient usage examples alongside the existing TTS documentation.
Member
Author
🧪 Details on Ubuntu 24.04.4 LTSfrom retest v1.1.0 on .NET 10.0.7 with 💜 by @devlooped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ISpeechToTextClient for xAI's Grok models, including:
GrokSpeechToTextClient: unary transcription via POST /v1/stt and streaming transcription via wss://.../v1/stt WebSocket protocol. Handles session handshake, chunked audio upload, interim/final transcript events, word-level timing, and language detection.
GrokSpeechToTextOptions: Grok-specific options for audio format, sample rate, multichannel, diarization, interim results, and endpointing timeout.
AsISpeechToTextClient() extension on GrokClient wires up the client with the correct HTTP handler and WebSocket factory.
Fix: voice REST clients (TTS and STT) were accidentally reusing the gRPC channel's BalancerHttpHandler, which throws for plain HTTP/1.1 requests. Added GrokClient.HttpHandler, backed by a separate httpHandlers cache using the same Polly retry pipeline but independent of the gRPC channel. AsITextToSpeechClient and AsISpeechToTextClient now use client.HttpHandler instead of client.ChannelHandler.Handler. The channels dictionary now holds ChannelBase directly rather than a tuple, since the HttpMessageHandler is no longer needed from it.
Add TextToSpeech_SpeechToText integration test that streams TTS audio to a temp file and transcribes it back with STT, asserting the roundtrip text matches (punctuation-insensitive via NormalizeTranscription).
Update readme with ISpeechToTextClient usage examples alongside the existing TTS documentation.