Interface: ImageGenerationModel<PROMPT, SETTINGS>
Type parameters
Name | Type |
---|---|
PROMPT | PROMPT |
SETTINGS | extends ImageGenerationModelSettings = ImageGenerationModelSettings |
Hierarchy
-
Model
<SETTINGS
>↳
ImageGenerationModel
Implemented by
Automatic1111ImageGenerationModel
OpenAIImageGenerationModel
PromptTemplateImageGenerationModel
StabilityImageGenerationModel
Accessors
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
>
Inherited from
Model.settingsForEvent
Defined in
packages/modelfusion/src/model-function/Model.ts:19
Methods
doGenerateImages
▸ doGenerateImages(prompt
, options
): PromiseLike
<{ base64Images
: string
[] ; rawResponse
: unknown
}>
Parameters
Name | Type |
---|---|
prompt | PROMPT |
options | FunctionCallOptions |
Returns
PromiseLike
<{ base64Images
: string
[] ; rawResponse
: unknown
}>
Defined in
packages/modelfusion/src/model-function/generate-image/ImageGenerationModel.ts:22
withPromptTemplate
▸ withPromptTemplate<INPUT_PROMPT
>(promptTemplate
): ImageGenerationModel
<INPUT_PROMPT
, SETTINGS
>
Type parameters
Name |
---|
INPUT_PROMPT |
Parameters
Name | Type |
---|---|
promptTemplate | PromptTemplate <INPUT_PROMPT , PROMPT > |
Returns
ImageGenerationModel
<INPUT_PROMPT
, SETTINGS
>
Defined in
packages/modelfusion/src/model-function/generate-image/ImageGenerationModel.ts:30
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,
});
Inherited from
Defined in
packages/modelfusion/src/model-function/Model.ts:34
Properties
modelInformation
• modelInformation: ModelInformation
Inherited from
Defined in
packages/modelfusion/src/model-function/Model.ts:12
settings
• Readonly
settings: SETTINGS