Class: PromptTemplateImageGenerationModel<PROMPT, MODEL_PROMPT, SETTINGS, MODEL>
Type parameters
Name | Type |
---|---|
PROMPT | PROMPT |
MODEL_PROMPT | MODEL_PROMPT |
SETTINGS | extends ImageGenerationModelSettings |
MODEL | extends ImageGenerationModel <MODEL_PROMPT , SETTINGS > |
Implements
ImageGenerationModel
<PROMPT
,SETTINGS
>
Accessors
modelInformation
• get
modelInformation(): ModelInformation
Returns
Implementation of
ImageGenerationModel.modelInformation
Defined in
packages/modelfusion/src/model-function/generate-image/PromptTemplateImageGenerationModel.ts:29
settings
• get
settings(): SETTINGS
Returns
SETTINGS
Implementation of
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
Name | Type |
---|---|
PROMPT | PROMPT |
MODEL_PROMPT | MODEL_PROMPT |
SETTINGS | extends ImageGenerationModelSettings |
MODEL | extends ImageGenerationModel <MODEL_PROMPT , SETTINGS > |
Parameters
Name | Type |
---|---|
«destructured» | Object |
› model | MODEL |
› promptTemplate | PromptTemplate <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
Name | Type |
---|---|
prompt | PROMPT |
options | FunctionCallOptions |
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
Name | Type |
---|---|
promptTemplate | PromptTemplate <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
Name | Type |
---|---|
additionalSettings | Partial <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