new BaseEmbeddingProvider(identifieropt)
Base class for all embedding providers.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
identifier |
string | undefined |
<optional> |
- Source:
Methods
__call__(text) → {Array.<number>}
Alias for the get
method.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Text to retrieve embedding for |
- Source:
Returns:
- Embedding array
- Type
- Array.<number>
config() → {Object}
Returns the configuration of the embedding provider as an object.
- Source:
Returns:
- Configuration object
- Type
- Object
get(text) → {Array.<number>}
Retrieves the embedding for the given text.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | Text to retrieve embedding for |
- Source:
Returns:
- Embedding array
- Type
- Array.<number>
(static) fromConfig(config) → {BaseEmbeddingProvider}
Creates an instance of the embedding provider from a configuration object.
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | Configuration object |
- Source:
Returns:
- Embedding provider instance