Class: TextGenerationToolCallModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL>
Type parameters
Name | Type |
---|---|
SOURCE_PROMPT | SOURCE_PROMPT |
TARGET_PROMPT | TARGET_PROMPT |
MODEL | extends TextGenerationModel <TARGET_PROMPT , TextGenerationModelSettings > |
Implements
ToolCallGenerationModel
<SOURCE_PROMPT
,MODEL
["settings"
]>
Accessors
modelInformation
• get
modelInformation(): ModelInformation
Returns
Implementation of
ToolCallGenerationModel.modelInformation
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:37
settings
• get
settings(): TextGenerationModelSettings
Returns
Implementation of
ToolCallGenerationModel.settings
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:41
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
ToolCallGenerationModel.settingsForEvent
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:45
Constructors
constructor
• new TextGenerationToolCallModel<SOURCE_PROMPT
, TARGET_PROMPT
, MODEL
>(«destructured»
): TextGenerationToolCallModel
<SOURCE_PROMPT
, TARGET_PROMPT
, MODEL
>
Type parameters
Name | Type |
---|---|
SOURCE_PROMPT | SOURCE_PROMPT |
TARGET_PROMPT | TARGET_PROMPT |
MODEL | extends TextGenerationModel <TARGET_PROMPT , TextGenerationModelSettings > |
Parameters
Name | Type |
---|---|
«destructured» | Object |
› model | MODEL |
› template | ToolCallPromptTemplate <SOURCE_PROMPT , TARGET_PROMPT > |
Returns
TextGenerationToolCallModel
<SOURCE_PROMPT
, TARGET_PROMPT
, MODEL
>
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:26
Methods
doGenerateToolCall
▸ doGenerateToolCall(tool
, prompt
, options?
): Promise
<{ rawResponse
: unknown
; toolCall
: null
| { args
: unknown
; id
: string
} ; usage
: undefined
| { completionTokens
: number
; promptTokens
: number
; totalTokens
: number
} }>
Parameters
Name | Type |
---|---|
tool | ToolDefinition <string , unknown > |
prompt | SOURCE_PROMPT |
options? | FunctionOptions |
Returns
Promise
<{ rawResponse
: unknown
; toolCall
: null
| { args
: unknown
; id
: string
} ; usage
: undefined
| { completionTokens
: number
; promptTokens
: number
; totalTokens
: number
} }>
Implementation of
ToolCallGenerationModel.doGenerateToolCall
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:60
getModelWithJsonOutput
▸ getModelWithJsonOutput(schema
): MODEL
Parameters
Name | Type |
---|---|
schema | Schema <unknown > & JsonSchemaProducer |
Returns
MODEL
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:49
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 <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
ToolCallGenerationModel.withSettings
Defined in
packages/modelfusion/src/tool/generate-tool-call/TextGenerationToolCallModel.ts:93