Skip to main content

Class: OllamaTextEmbeddingModel

Hierarchy

Implements

Accessors

dimensions

get dimensions(): undefined | number

The size of the embedding vector.

Returns

undefined | number

Implementation of

EmbeddingModel.dimensions

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:44


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/ollama/OllamaTextEmbeddingModel.ts:40


modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

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/ollama/OllamaTextEmbeddingModel.ts:35


settingsForEvent

get settingsForEvent(): Partial<OllamaTextEmbeddingModelSettings>

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

Returns

Partial<OllamaTextEmbeddingModelSettings>

Implementation of

EmbeddingModel.settingsForEvent

Overrides

AbstractModel.settingsForEvent

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:86

Constructors

constructor

new OllamaTextEmbeddingModel(settings): OllamaTextEmbeddingModel

Parameters

NameType
settingsOllamaTextEmbeddingModelSettings

Returns

OllamaTextEmbeddingModel

Overrides

AbstractModel&lt;OllamaTextEmbeddingModelSettings&gt;.constructor

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:30

Methods

callAPI

callAPI(texts, callOptions): Promise<{ embedding: number[] }>

Parameters

NameType
textsstring[]
callOptionsFunctionCallOptions

Returns

Promise<{ embedding: number[] }>

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:48


doEmbedValues

doEmbedValues(texts, options): Promise<{ embeddings: number[][] ; rawResponse: { embedding: number[] } }>

Parameters

NameType
textsstring[]
optionsFunctionCallOptions

Returns

Promise<{ embeddings: number[][] ; rawResponse: { embedding: number[] } }>

Implementation of

EmbeddingModel.doEmbedValues

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:92


withSettings

withSettings(additionalSettings): OllamaTextEmbeddingModel

The withSettings method creates a new model with the same configuration as the original model, but with the specified settings changed.

Parameters

NameType
additionalSettingsPartial<OllamaTextEmbeddingModelSettings>

Returns

OllamaTextEmbeddingModel

Example

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

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

Implementation of

EmbeddingModel.withSettings

Overrides

AbstractModel.withSettings

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:101

Properties

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/ollama/OllamaTextEmbeddingModel.ts:39


provider

Readonly provider: "ollama"

Overrides

AbstractModel.provider

Defined in

packages/modelfusion/src/model-provider/ollama/OllamaTextEmbeddingModel.ts:34


settings

Readonly settings: OllamaTextEmbeddingModelSettings

Implementation of

EmbeddingModel.settings

Inherited from

AbstractModel.settings

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:7