Skip to content

DeepgramProvider

Namespace: Vercel.AI.Deepgram

public sealed class DeepgramProvider : OpenAICompatibleProvider

Deepgram provider.

Inheritance: object → ProviderBase → OpenAICompatibleProvider

View source

DeepgramProvider(HttpClient, OpenAICompatibleOptions?)

Section titled “DeepgramProvider(HttpClient, OpenAICompatibleOptions?)”
public DeepgramProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)

Creates a provider.

Parameters

Name Type Description
httpClient HttpClient
options OpenAICompatibleOptions

View source

public const string DefaultBaseUrl = "https://api.deepgram.com"

Default API origin.

Value: string

View source

public const string ProviderId = "deepgram"

Provider id.

Value: string

View source

Create(OpenAICompatibleOptions?, HttpMessageHandler?)

Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”
public static DeepgramProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)

Creates a provider.

Parameters

Name Type Description
options OpenAICompatibleOptions
handler HttpMessageHandler

Returns: DeepgramProvider

View source

public override ILanguageModel LanguageModel(string modelId)

Returns a language model.

Parameters

Name Type Description
modelId string

Returns: ILanguageModel

View source

public override ISpeechModel SpeechModel(string modelId)

Returns a speech model.

Parameters

Name Type Description
modelId string

Returns: ISpeechModel

View source

TranscribeAsync(string, AudioInput, DeepgramTranscriptionRequest?, CancellationToken)

Section titled “TranscribeAsync(string, AudioInput, DeepgramTranscriptionRequest?, CancellationToken)”
public Task<DeepgramTranscriptionResult> TranscribeAsync(string modelId, AudioInput audio, DeepgramTranscriptionRequest? request, CancellationToken cancellationToken)

Posts raw audio to /v1/listen?model=.

Parameters

Name Type Description
modelId string
audio AudioInput
request DeepgramTranscriptionRequest
cancellationToken CancellationToken

Returns: Task<DeepgramTranscriptionResult>

View source

public override ITranscriptionModel TranscriptionModel(string modelId)

Returns a transcription model.

Parameters

Name Type Description
modelId string

Returns: ITranscriptionModel

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product