Skip to main content
An ASR Model converts speech audio into text. AgentScope exposes one interface for complete-file transcription and realtime audio input. The 2.0.11 development version includes the following built-in implementation:

Create an ASR Model

Create an OpenAIASRModel with an OpenAICredential. The default model is gpt-4o-mini-transcribe:
The OpenAI implementation supports two optional parameters:

Transcribe Audio

transcribe() accepts the complete audio as bytes. Pass the original filename so the provider can identify the in-memory audio format:
The bundled OpenAI model cards advertise FLAC, MP3/MPEG, MP4, OGG, WAV, and WebM input. An empty audio value or filename raises ValueError. Keyword arguments passed directly to transcribe() override values from the model’s Parameters object for that call.

Read the Response

transcribe() returns an ASRResponse: Batch models return a final response with is_last=True. Realtime models may return intermediate responses with is_last=False from push().

Discover Available Models

ASR model cards describe supported audio types, output types, realtime capability, and the provider parameter schema. Discover them from either the credential or the model class:

Implement a Custom ASR Model

Subclass ASRModelBase and implement transcribe() for a batch provider:
For realtime input, set realtime=True, implement connect(), push(), and close(), and use the model as an asynchronous context manager. Send audio chunks through push() and call transcribe() without audio to finalize the current transcript.
AgentScope 2.0.11dev currently ships only the batch OpenAI ASR implementation. The realtime lifecycle is available for custom and future providers.