Class: AbstractOpenAITextEmbeddingModel<SETTINGS>
Abstract text embedding model that calls an API that is compatible with the OpenAI embedding API.
See
https://platform.openai.com/docs/api-reference/embeddings
Type parameters
Name | Type |
---|---|
SETTINGS | extends AbstractOpenAITextEmbeddingModelSettings |
Hierarchy
-
AbstractModel
<SETTINGS
>↳
AbstractOpenAITextEmbeddingModel
Accessors
maxValuesPerCall
• get
maxValuesPerCall(): number
Returns
number
Defined in
packages/modelfusion/src/model-provider/openai/AbstractOpenAITextEmbeddingModel.ts:38
modelInformation
• get
modelInformation(): ModelInformation
Returns
Inherited from
AbstractModel.modelInformation
Defined in
packages/modelfusion/src/model-function/AbstractModel.ts:17
settingsForEvent
• get
settingsForEvent(): Partial
<SETTINGS
>
Returns
Partial
<SETTINGS
>
Inherited from
AbstractModel.settingsForEvent
Defined in
packages/modelfusion/src/model-function/AbstractModel.ts:24
Constructors
constructor
• new AbstractOpenAITextEmbeddingModel<SETTINGS
>(settings
): AbstractOpenAITextEmbeddingModel
<SETTINGS
>
Type parameters
Name | Type |
---|---|
SETTINGS | extends AbstractOpenAITextEmbeddingModelSettings |
Parameters
Name | Type |
---|---|
settings | SETTINGS |
Returns
AbstractOpenAITextEmbeddingModel
<SETTINGS
>
Overrides
AbstractModel<SETTINGS>.constructor
Defined in
packages/modelfusion/src/model-provider/openai/AbstractOpenAITextEmbeddingModel.ts:34
Methods
callAPI
▸ callAPI(texts
, callOptions
): Promise
<{ data
: { embedding
: number
[] ; index
: number
; object
: "embedding"
}[] ; model
: string
; object
: "list"
; usage?
: { prompt_tokens
: number
; total_tokens
: number
} }>
Parameters
Name | Type |
---|---|
texts | string [] |
callOptions | FunctionCallOptions |
Returns
Promise
<{ data
: { embedding
: number
[] ; index
: number
; object
: "embedding"
}[] ; model
: string
; object
: "list"
; usage?
: { prompt_tokens
: number
; total_tokens
: number
} }>
Defined in
packages/modelfusion/src/model-provider/openai/AbstractOpenAITextEmbeddingModel.ts:44
doEmbedValues
▸ doEmbedValues(texts
, callOptions
): Promise
<{ embeddings
: number
[][] ; rawResponse
: { data
: { embedding
: number
[] ; index
: number
; object
: "embedding"
}[] ; model
: string
; object
: "list"
; usage?
: { prompt_tokens
: number
; total_tokens
: number
} } }>
Parameters
Name | Type |
---|---|
texts | string [] |
callOptions | FunctionCallOptions |
Returns
Promise
<{ embeddings
: number
[][] ; rawResponse
: { data
: { embedding
: number
[] ; index
: number
; object
: "embedding"
}[] ; model
: string
; object
: "list"
; usage?
: { prompt_tokens
: number
; total_tokens
: number
} } }>
Defined in
packages/modelfusion/src/model-provider/openai/AbstractOpenAITextEmbeddingModel.ts:80
withSettings
▸ withSettings(additionalSettings
): this
Parameters
Name | Type |
---|---|
additionalSettings | Partial <SETTINGS > |
Returns
this
Inherited from
AbstractModel.withSettings
Defined in
packages/modelfusion/src/model-function/AbstractModel.ts:26
Properties
isParallelizable
• Readonly
isParallelizable: true
Defined in
packages/modelfusion/src/model-provider/openai/AbstractOpenAITextEmbeddingModel.ts:42
modelName
• Readonly
Abstract
modelName: null
| string
Inherited from
AbstractModel.modelName
Defined in
packages/modelfusion/src/model-function/AbstractModel.ts:14
provider
• Readonly
Abstract
provider: string
Inherited from
AbstractModel.provider
Defined in
packages/modelfusion/src/model-function/AbstractModel.ts:13
settings
• Readonly
settings: SETTINGS
Inherited from
AbstractModel.settings