Class: TextGenerationToolCallsModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL>
Type parameters
Name | Type |
---|---|
SOURCE_PROMPT | SOURCE_PROMPT |
TARGET_PROMPT | TARGET_PROMPT |
MODEL | extends TextGenerationModel <TARGET_PROMPT , ToolCallsGenerationModelSettings > |
Implements
ToolCallsGenerationModel
<SOURCE_PROMPT
,MODEL
["settings"
]>
Accessors
modelInformation
• get
modelInformation(): ModelInformation
Returns
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
Name | Type |
---|---|
SOURCE_PROMPT | SOURCE_PROMPT |
TARGET_PROMPT | TARGET_PROMPT |
MODEL | extends TextGenerationModel <TARGET_PROMPT , ToolCallsGenerationModelSettings > |
Parameters
Name | Type |
---|---|
«destructured» | Object |
› model | MODEL |
› template | ToolCallsPromptTemplate <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
Name | Type |
---|---|
tools | ToolDefinition <string , unknown >[] |
prompt | SOURCE_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
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
ToolCallsGenerationModel.withSettings
Defined in
packages/modelfusion/src/tool/generate-tool-calls/TextGenerationToolCallsModel.ts:90