Overview of the Node Metal SDK.
Param | Type | Description |
---|---|---|
apiKey | string | The API Key for your Org. Learn more. |
clientId | string | The Client ID for your Org. Learn more. |
indexId | string | The ID of the index you want to connect with. Learn more. |
addApp()
Param | Type | Description |
---|---|---|
name | string | Name of the app. |
getApp()
Param | Type | Description |
---|---|---|
appId | string | Identifier for the app. |
getApps()
updateApp()
Param | Type | Description | |
---|---|---|---|
appId | string | The unique identifier of the app you want to update. | |
name | string (optional) | The updated name for the App. | |
indexes | array (optional) | An updated array of the index connected to the app. |
addIndex()
Param | Type | Description |
---|---|---|
model | string | Identifier for the model being used, e.g., βtext-embedding-ada-002β. |
name | string | Name of the index. |
datasource | string | Unique identifier for the Datasource. |
indexType | string | Type of index structure, e.g., βFLATβ, βHNSWβ. |
dimensions | number | Number of dimensions for the index. e.g.1536 |
filters | array | An array of filters specifying fields for advanced searching. |
Param | Type | Description |
---|---|---|
field | string | Name of the attribute you wish to filter by. |
type | string | Type of the attribute (e.g., βstringβ, βnumberβ). |
getIndex()
Param | Type | Description |
---|---|---|
indexId | string | Identifier for the index. |
index()
text
, imageUrl
, or
embedding
. We only embed one field in a single request.id
and metadata
object to be stored with the embedding. Eg.
Param | Type | Description |
---|---|---|
Embed - embedding | number[] | Raw embedding to be indexed. |
Embed - imageUrl | string | A URL for an image to be embedded and indexed. |
Embed - text | string | The text to be embedded and indexed. |
id | string | Optional. Identifier for your embedding. |
metadata | object | Optional. A flexible metdata object to be stored w/ the embedding. |
indexMany()
text
, imageUrl
, or
embedding
. We only embed one field in a single request.Param | Type | Description |
---|---|---|
index | string | Required. Index id. |
embedding | number[] | Raw embeddings to be indexed. |
imageUrl | string | A URL for an image to be vectorized and indexed. |
text | string | The text to be vectorized and indexed. |
id | string | Optional. identifier for your embedding. |
metadata | object | Optional. A flexible metdata object to be stored w/ the embedding. |
search()
Param | Type | Description |
---|---|---|
embedding | number[] | Raw embeddings to be searched. |
imageUrl | string | A URL for an image to be vectorized and searched. |
text | string | The text to be vectorized and searched. |
filters | Filter | Filters included for filtered search. |
indexId | string | Optional index id where record will get indexed. |
idsOnly | boolean | Return only the ids of the documents. |
limit | number | Number of documents returned by the API |
Param | Type | Description |
---|---|---|
and | FilterItem[] | And clause, all members have to be satisfied. |
or | FilterItem[] | Or clause, at least one member has to be satisfied. |
Param | Type | Description |
---|---|---|
field | string | Name of the field to filter |
value | string | number | Value to match the filter |
operator | string | One of: eq , gt , gte , lt , lte . |
getOne()
Param | Type | Description |
---|---|---|
id | string | The ID of the document to retrieve. |
indexId | string | Optional. index id where record will get indexed. |
getMany()
Name | Type | Description |
---|---|---|
ids | Array of str | An array of document IDs to retrieve. |
indexId | str, optional | The ID of the index from which to retrieve documents. If not provided, the default index ID will be used. |
getQueries()
Name | Type | Description |
---|---|---|
indexId | str | The ID of the index from which to retrieve documents. |
deleteOne()
Param | Type | Description |
---|---|---|
id | string | The ID of the document to delte. |
indexId | string | Optional. The ID of the index containing the document. |
deleteMany()
Param | Type | Description |
---|---|---|
id | string[] | The IDs of the documents to delete. |
indexId | string | Optional. The ID of the index containing the document. |
Param | Type | Description |
---|---|---|
apiKey | string | For Managed. The API Key for your Org. [details](- Create an API Key for Authentication. |
clientId | string | For Managed.The Client ID for your Org. [details](- Create an API Key for Authentication. |
baseUrl | string | For Self-hosted. The URL path to your motorhead instance |
addMemory()
Param | Type | Description |
---|---|---|
sessionId | string | The ID of the session. If the session does not exist, it will create one |
memory | Memory[] | A memory payload to update the session memory |
getMemory()
Param | Type | Description |
---|---|---|
sessionId | string | The ID of the session to retrieve memory for |
deleteMemory()
Param | Type | Description |
---|---|---|
sessionId | string | The ID of the session to delete memory for |
addDatasource()
Name | Type | Description |
---|---|---|
name | string | Name of the Datasource. |
sourcetype | string | Type of the source. It can either be βFileβ or βTextβ. |
autoExtract | boolean | Flag indicating whether auto-extraction is enabled. |
metadataFields | array | An array of fields specifying which attributes you wish to extract. Each object should have name , type , and description properties. |
Name | Type | Description |
---|---|---|
name | string | Name of the attribute you wish to extract. |
type | string | Type of the attribute (e.g., βStringβ, βNumberβ). |
description | string | Brief description or example of the attribute. |
autoExtract | boolean | Determines if attribute will be auto extracted from content or not. |
updateDatasource()
Name | Type | Description |
---|---|---|
datasourceId | string | Identifier of the Datasource you want to update. |
name | string | Updated name of the Datasource. |
sourcetype | string | Updated type of the source. Either βFileβ or βTextβ. |
autoExtract | boolean | Updated flag indicating whether auto-extraction is enabled. |
metadataFields | array | Updated fields specifying which attributes you wish to extract. |
getDatasource()
Name | Type | Description |
---|---|---|
dataSourceId | string | Identifier of the Datasource you want to retrieve information about. |
getAllDatasources()
Name | Type | Description |
---|---|---|
limit | number | (Optional) The maximum number of Datasources to return. Default is 10, with a maximum of 100. |
page | number | (Optional) The page number for pagination. Should be a positive integer up to 100. |
deleteDatasource()
Name | Type | Description |
---|---|---|
datasourceId | string | The ID of the Datasource you want to delete. |
addDataEntity()
Name | Type | Description |
---|---|---|
datasourceId | string | The ID of the datasource where the file belongs. |
filepath | string | The local file path of the file to upload. |
metadata | object | Additional Metadata that isnβt extracted. |
getDataEntity()
Name | Type | Description |
---|---|---|
id | string | The ID of the data entity you want to retrieve. |
getAllDataEntities()
Name | Type | Description |
---|---|---|
datasourceID | string | The ID of the datasource for which you want to list the data entities. |
limit | number | (Optional) The maximum number of data entities to return. Default is 10, with a maximum of 100. |
page | number | (Optional) The page number for pagination. Should be a positive integer up to 100. |
deleteDataEntity()
Name | Type | Description |
---|---|---|
id | string | The ID of the data entity you want to delete. |