Interface: EmbeddingModel<VALUE, SETTINGS>
Type parameters
Name | Type |
---|---|
VALUE | VALUE |
SETTINGS | extends EmbeddingModelSettings = EmbeddingModelSettings |
Hierarchy
-
Model
<SETTINGS
>↳
EmbeddingModel
Implemented by
CohereTextEmbeddingModel
HuggingFaceTextEmbeddingModel
LlamaCppTextEmbeddingModel
MistralTextEmbeddingModel
OllamaTextEmbeddingModel
OpenAICompatibleTextEmbeddingModel
OpenAITextEmbeddingModel
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
doEmbedValues
▸ doEmbedValues(values
, options
): PromiseLike
<{ embeddings
: Vector
[] ; rawResponse
: unknown
}>
Parameters
Name | Type |
---|---|
values | VALUE [] |
options | FunctionCallOptions |
Returns
PromiseLike
<{ embeddings
: Vector
[] ; rawResponse
: unknown
}>
Defined in
packages/modelfusion/src/model-function/embed/EmbeddingModel.ts:26
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
dimensions
• Readonly
dimensions: undefined
| number
The size of the embedding vector.
Defined in
packages/modelfusion/src/model-function/embed/EmbeddingModel.ts:14
isParallelizable
• Readonly
isParallelizable: boolean
True if the model can handle multiple embedding calls in parallel.
Defined in
packages/modelfusion/src/model-function/embed/EmbeddingModel.ts:24
maxValuesPerCall
• Readonly
maxValuesPerCall: undefined
| number
Limit of how many values can be sent in a single API call.
Defined in
packages/modelfusion/src/model-function/embed/EmbeddingModel.ts:19
modelInformation
• modelInformation: ModelInformation
Inherited from
Defined in
packages/modelfusion/src/model-function/Model.ts:12
settings
• Readonly
settings: SETTINGS