Class: OpenAIEmbedding
Hierarchy
-
↳
OpenAIEmbedding
Constructors
constructor
• new OpenAIEmbedding(init?
)
Parameters
Name | Type |
---|---|
init? | Partial <OpenAIEmbedding > & { azure? : AzureOpenAIConfig } |
Overrides
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:30
Properties
additionalSessionOptions
• Optional
additionalSessionOptions: Omit
<Partial
<ClientOptions
>, "apiKey"
| "timeout"
| "maxRetries"
>
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:23
apiKey
• Optional
apiKey: string
= undefined
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:20
maxRetries
• maxRetries: number
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:21
model
• model: TEXT_EMBED_ADA_002
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:17
session
• session: OpenAISession
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:28
timeout
• Optional
timeout: number
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:22
Methods
getOpenAIEmbedding
▸ Private
getOpenAIEmbedding(input
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
input | string |
Returns
Promise
<number
[]>
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:76
getQueryEmbedding
▸ getQueryEmbedding(query
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
query | string |
Returns
Promise
<number
[]>
Overrides
BaseEmbedding.getQueryEmbedding
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:89
getTextEmbedding
▸ getTextEmbedding(text
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
text | string |
Returns
Promise
<number
[]>
Overrides
BaseEmbedding.getTextEmbedding
Defined in
packages/core/src/embeddings/OpenAIEmbedding.ts:85
similarity
▸ similarity(embedding1
, embedding2
, mode?
): number
Parameters
Name | Type | Default value |
---|---|---|
embedding1 | number [] | undefined |
embedding2 | number [] | undefined |
mode | SimilarityType | SimilarityType.DEFAULT |