Microsoft.Extensions.AI Integration
Cross-SDK comparison
See the centralized MEAI documentation for feature matrices and comparisons across all tryAGI SDKs.
The RevAI SDK implements ISpeechToTextClient and provides AIFunction tool wrappers, all compatible with Microsoft.Extensions.AI.
Installation
1 | |
ISpeechToTextClient
The RevAIClient implements ISpeechToTextClient for speech-to-text transcription.
It supports both file upload and URL-based transcription, with automatic polling until the job completes.
File-Based Transcription
Transcribe an audio file to text. The client uploads the audio via multipart form data, submits a transcription job, and polls until completion:
1 2 3 4 5 6 7 8 9 10 11 12 | |
Transcription with Language Hint
Specify a language code for more accurate transcription (31 languages supported):
1 2 3 4 5 6 7 8 9 | |
URL-Based Transcription with RawRepresentationFactory
Use RawRepresentationFactory to transcribe audio from a URL instead of uploading a file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Streaming Behavior
GetStreamingTextAsync delegates to the non-streaming GetTextAsync method internally. The batch transcription job (submit + poll + get transcript) runs to completion first, and then the full result is yielded as a single TextUpdated update bracketed by SessionOpen and SessionClose events.
This means you will not receive incremental transcription updates as audio is processed. The entire transcript is returned at once after the job finishes. For most use cases, calling GetTextAsync directly is equivalent and simpler.
Note
Rev.ai does offer a real-time streaming WebSocket API, but it is not exposed through the MEAI ISpeechToTextClient interface. Use the RevAIClient directly for real-time streaming needs.
Accessing the Underlying Client
Retrieve the RevAIClient from the MEAI interface:
1 2 3 4 5 6 7 | |
Available Tools
| Method | Tool Name | Description |
|---|---|---|
AsTranscribeUrlTool() |
RevAI_TranscribeUrl |
Transcribe audio/video from URL |
AsGetJobStatusTool() |
RevAI_GetJobStatus |
Get transcription job status |
AsListJobsTool() |
RevAI_ListJobs |
List recent transcription jobs |
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |