Class: LlamaCppTextEmbeddingModel
Hierarchy
-
AbstractModel
<LlamaCppTextEmbeddingModelSettings
>↳
LlamaCppTextEmbeddingModel
Implements
Accessors
dimensions
• get
dimensions(): undefined
| number
The size of the embedding vector.
Returns
undefined
| number
Implementation of
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:47
isParallelizable
• get
isParallelizable(): boolean
True if the model can handle multiple embedding calls in parallel.
Returns
boolean
Implementation of
EmbeddingModel.isParallelizable
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:42
modelInformation
• get
modelInformation(): ModelInformation
Returns
Implementation of
EmbeddingModel.modelInformation
Inherited from
AbstractModel.modelInformation
Defined in
packages/modelfusion/src/model-function/AbstractModel.ts:17
modelName
• get
modelName(): null
Returns
null
Overrides
AbstractModel.modelName
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:37
settingsForEvent
• get
settingsForEvent(): Partial
<LlamaCppTextEmbeddingModelSettings
>
Returns settings that should be recorded in observability events. Security-related settings (e.g. API keys) should not be included here.
Returns
Partial
<LlamaCppTextEmbeddingModelSettings
>
Implementation of
EmbeddingModel.settingsForEvent
Overrides
AbstractModel.settingsForEvent
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:92
Constructors
constructor
• new LlamaCppTextEmbeddingModel(settings?
): LlamaCppTextEmbeddingModel
Parameters
Name | Type |
---|---|
settings | LlamaCppTextEmbeddingModelSettings |
Returns
Overrides
AbstractModel<LlamaCppTextEmbeddingModelSettings>.constructor
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:30
Methods
callAPI
▸ callAPI(texts
, callOptions
): Promise
<{ embedding
: number
[] }>
Parameters
Name | Type |
---|---|
texts | string [] |
callOptions | FunctionCallOptions |
Returns
Promise
<{ embedding
: number
[] }>
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:57
doEmbedValues
▸ doEmbedValues(texts
, options
): Promise
<{ embeddings
: number
[][] ; rawResponse
: { embedding
: number
[] } }>
Parameters
Name | Type |
---|---|
texts | string [] |
options | FunctionCallOptions |
Returns
Promise
<{ embeddings
: number
[][] ; rawResponse
: { embedding
: number
[] } }>
Implementation of
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:98
tokenize
▸ tokenize(text
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
text | string |
Returns
Promise
<number
[]>
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:53
withSettings
▸ withSettings(additionalSettings
): LlamaCppTextEmbeddingModel
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 <LlamaCppTextEmbeddingModelSettings > |
Returns
Example
const model = new OpenAICompletionModel({
model: "gpt-3.5-turbo-instruct",
maxGenerationTokens: 500,
});
const modelWithMoreTokens = model.withSettings({
maxGenerationTokens: 1000,
});
Implementation of
Overrides
AbstractModel.withSettings
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:107
Properties
contextWindowSize
• Readonly
contextWindowSize: undefined
= undefined
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:46
maxValuesPerCall
• Readonly
maxValuesPerCall: 1
Limit of how many values can be sent in a single API call.
Implementation of
EmbeddingModel.maxValuesPerCall
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:41
provider
• Readonly
provider: "llamacpp"
Overrides
AbstractModel.provider
Defined in
packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:36
settings
• Readonly
settings: LlamaCppTextEmbeddingModelSettings
Implementation of
Inherited from
AbstractModel.settings