Skip to main content

Class: PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>

Type parameters

NameType
PROMPTPROMPT
MODEL_PROMPTMODEL_PROMPT
SETTINGSextends ImageGenerationModelSettings
MODELextends ImageGenerationModel<MODEL_PROMPT, SETTINGS>

Implements

Accessors

modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

Implementation of

ImageGenerationModel.modelInformation

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:29


settings

get settings(): SETTINGS

Returns

SETTINGS

Implementation of

ImageGenerationModel.settings

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:33


settingsForEvent

get settingsForEvent(): Partial<SETTINGS>

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

Returns

Partial<SETTINGS>

Implementation of

ImageGenerationModel.settingsForEvent

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:42

Constructors

constructor

new PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>(«destructured»): PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>

Type parameters

NameType
PROMPTPROMPT
MODEL_PROMPTMODEL_PROMPT
SETTINGSextends ImageGenerationModelSettings
MODELextends ImageGenerationModel<MODEL_PROMPT, SETTINGS>

Parameters

NameType
«destructured»Object
› modelMODEL
› promptTemplatePromptTemplate<PROMPT, MODEL_PROMPT>

Returns

PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:18

Methods

doGenerateImages

doGenerateImages(prompt, options): PromiseLike<{ base64Images: string[] ; rawResponse: unknown }>

Parameters

NameType
promptPROMPT
optionsFunctionCallOptions

Returns

PromiseLike<{ base64Images: string[] ; rawResponse: unknown }>

Implementation of

ImageGenerationModel.doGenerateImages

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:37


withPromptTemplate

withPromptTemplate<INPUT_PROMPT>(promptTemplate): PromptTemplateImageGenerationModel<INPUT_PROMPT, PROMPT, SETTINGS, PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>>

Type parameters

Name
INPUT_PROMPT

Parameters

NameType
promptTemplatePromptTemplate<INPUT_PROMPT, PROMPT>

Returns

PromptTemplateImageGenerationModel<INPUT_PROMPT, PROMPT, SETTINGS, PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>>

Implementation of

ImageGenerationModel.withPromptTemplate

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:46


withSettings

withSettings(additionalSettings): this

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

Parameters

NameType
additionalSettingsPartial<SETTINGS>

Returns

this

Example

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

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

Implementation of

ImageGenerationModel.withSettings

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:57

Properties

model

Readonly model: MODEL

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:15


promptTemplate

Readonly promptTemplate: PromptTemplate<PROMPT, MODEL_PROMPT>

Defined in

packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:16