Skip to main content

Class: LmntSpeechModel

Synthesize speech using the LMNT API.

See

https://docs.lmnt.com/api-reference/speech/synthesize-speech-1

Hierarchy

Implements

Accessors

modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

Implementation of

SpeechGenerationModel.modelInformation

Inherited from

AbstractModel.modelInformation

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:17


modelName

get modelName(): string

Returns

string

Overrides

AbstractModel.modelName

Defined in

packages/modelfusion/src/model-provider/lmnt/LmntSpeechModel.ts:58


settingsForEvent

get settingsForEvent(): Partial<LmntSpeechModelSettings>

Returns settings that should be recorded in observability events. Security-related settings (e.g. API keys) should not be included here.

Returns

Partial<LmntSpeechModelSettings>

Implementation of

SpeechGenerationModel.settingsForEvent

Overrides

AbstractModel.settingsForEvent

Defined in

packages/modelfusion/src/model-provider/lmnt/LmntSpeechModel.ts:117

Constructors

constructor

new LmntSpeechModel(settings): LmntSpeechModel

Parameters

NameType
settingsLmntSpeechModelSettings

Returns

LmntSpeechModel

Overrides

AbstractModel&lt;LmntSpeechModelSettings&gt;.constructor

Defined in

packages/modelfusion/src/model-provider/lmnt/LmntSpeechModel.ts:52

Methods

doGenerateSpeechStandard

doGenerateSpeechStandard(text, options): Promise<Uint8Array>

Generates an mp3 audio Uint8Array that contains the speech for the given text.

Parameters

NameType
textstring
optionsFunctionCallOptions

Returns

Promise<Uint8Array>

Implementation of

SpeechGenerationModel.doGenerateSpeechStandard

Defined in

packages/modelfusion/src/model-provider/lmnt/LmntSpeechModel.ts:126


withSettings

withSettings(additionalSettings): LmntSpeechModel

The withSettings method creates a new model with the same configuration as the original model, but with the specified settings changed.

Parameters

NameType
additionalSettingsPartial<LmntSpeechModelSettings>

Returns

LmntSpeechModel

Example

const model = new OpenAICompletionModel({
model: "gpt-3.5-turbo-instruct",
maxGenerationTokens: 500,
});

const modelWithMoreTokens = model.withSettings({
maxGenerationTokens: 1000,
});

Implementation of

SpeechGenerationModel.withSettings

Overrides

AbstractModel.withSettings

Defined in

packages/modelfusion/src/model-provider/lmnt/LmntSpeechModel.ts:131

Properties

provider

Readonly provider: "lmnt"

Overrides

AbstractModel.provider

Defined in

packages/modelfusion/src/model-provider/lmnt/LmntSpeechModel.ts:56


settings

Readonly settings: LmntSpeechModelSettings

Implementation of

SpeechGenerationModel.settings

Inherited from

AbstractModel.settings

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:7