Skip to main content

Class: TextGenerationToolCallsModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL>

Type parameters

NameType
SOURCE_PROMPTSOURCE_PROMPT
TARGET_PROMPTTARGET_PROMPT
MODELextends TextGenerationModel<TARGET_PROMPT, ToolCallsGenerationModelSettings>

Implements

Accessors

modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

Implementation of

ToolCallsGenerationModel.modelInformation

Defined in

packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:38


settings

get settings(): ToolCallsGenerationModelSettings

Returns

ToolCallsGenerationModelSettings

Implementation of

ToolCallsGenerationModel.settings

Defined in

packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:42


settingsForEvent

get settingsForEvent(): Partial<MODEL["settings"]>

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

Returns

Partial<MODEL["settings"]>

Implementation of

ToolCallsGenerationModel.settingsForEvent

Defined in

packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:46

Constructors

constructor

new TextGenerationToolCallsModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL>(«destructured»): TextGenerationToolCallsModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL>

Type parameters

NameType
SOURCE_PROMPTSOURCE_PROMPT
TARGET_PROMPTTARGET_PROMPT
MODELextends TextGenerationModel<TARGET_PROMPT, ToolCallsGenerationModelSettings>

Parameters

NameType
«destructured»Object
› modelMODEL
› templateToolCallsPromptTemplate<SOURCE_PROMPT, TARGET_PROMPT>

Returns

TextGenerationToolCallsModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL>

Defined in

packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:27

Methods

doGenerateToolCalls

doGenerateToolCalls(tools, prompt, options?): Promise<{ rawResponse: unknown ; text: null | string ; toolCalls: null | { args: unknown ; id: string ; name: string }[] ; usage: undefined | { completionTokens: number ; promptTokens: number ; totalTokens: number } }>

Parameters

NameType
toolsToolDefinition<string, unknown>[]
promptSOURCE_PROMPT
options?FunctionOptions

Returns

Promise<{ rawResponse: unknown ; text: null | string ; toolCalls: null | { args: unknown ; id: string ; name: string }[] ; usage: undefined | { completionTokens: number ; promptTokens: number ; totalTokens: number } }>

Implementation of

ToolCallsGenerationModel.doGenerateToolCalls

Defined in

packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:50


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<MODEL["settings"]>

Returns

this

Example

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

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

Implementation of

ToolCallsGenerationModel.withSettings

Defined in

packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:90