@pairsystems/goodmem-client v1.0.0-beta.1
goodmem-client
GoodmemClient - JavaScript client for goodmem-client API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval. This SDK is automatically generated by the OpenAPI Generator project:
- API version: v1
- Package version: v1
- Generator version: 7.13.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://goodmem.io/support
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install goodmem-client --saveFinally, you need to build the module:
npm run buildLocal development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:
npm installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkTo use the link you just defined in your project, switch to the directory you want to use your goodmem-client from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>Finally, you need to build the module:
npm run buildgit
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --saveFor browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.jsThen include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}Getting Started
Please follow the installation instruction and execute the following JS code:
var GoodmemClient = require('goodmem-client');
var api = new GoodmemClient.APIKeysApi()
var createApiKeyRequest = {
"labels": {
"environment": "development",
"service": "chat-ui"
},
"expiresAt": 1735689600000
}
; // {CreateApiKeyRequest} API key configuration
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createApiKey(createApiKeyRequest, callback);Documentation for API Endpoints
All URIs are relative to http://localhost:8080/v1/default
| Class | Method | HTTP request | Description |
|---|---|---|---|
| GoodmemClient.APIKeysApi | createApiKey | POST /v1/apikeys | Create a new API key |
| GoodmemClient.APIKeysApi | deleteApiKey | DELETE /v1/apikeys/{id} | Delete an API key |
| GoodmemClient.APIKeysApi | listApiKeys | GET /v1/apikeys | List API keys |
| GoodmemClient.APIKeysApi | updateApiKey | PUT /v1/apikeys/{id} | Update an API key |
| GoodmemClient.EmbeddersApi | createEmbedder | POST /v1/embedders | Create a new embedder |
| GoodmemClient.EmbeddersApi | deleteEmbedder | DELETE /v1/embedders/{id} | Delete an embedder |
| GoodmemClient.EmbeddersApi | getEmbedder | GET /v1/embedders/{id} | Get an embedder by ID |
| GoodmemClient.EmbeddersApi | listEmbedders | GET /v1/embedders | List embedders |
| GoodmemClient.EmbeddersApi | updateEmbedder | PUT /v1/embedders/{id} | Update an embedder |
| GoodmemClient.MemoriesApi | batchCreateMemory | POST /v1/memories/batch | Create multiple memories in a batch |
| GoodmemClient.MemoriesApi | batchDeleteMemory | POST /v1/memories/batch/delete | Delete multiple memories by ID |
| GoodmemClient.MemoriesApi | batchGetMemory | POST /v1/memories/batch/get | Get multiple memories by ID |
| GoodmemClient.MemoriesApi | createMemory | POST /v1/memories | Create a new memory |
| GoodmemClient.MemoriesApi | deleteMemory | DELETE /v1/memories/{id} | Delete a memory |
| GoodmemClient.MemoriesApi | getMemory | GET /v1/memories/{id} | Get a memory by ID |
| GoodmemClient.MemoriesApi | listMemories | GET /v1/spaces/{spaceId}/memories | List memories in a space |
| GoodmemClient.SpacesApi | createSpace | POST /v1/spaces | Create a new Space |
| GoodmemClient.SpacesApi | deleteSpace | DELETE /v1/spaces/{id} | Delete a space |
| GoodmemClient.SpacesApi | getSpace | GET /v1/spaces/{id} | Get a space by ID |
| GoodmemClient.SpacesApi | listSpaces | GET /v1/spaces | List spaces |
| GoodmemClient.SpacesApi | updateSpace | PUT /v1/spaces/{id} | Update a space |
| GoodmemClient.SystemApi | initializeSystem | POST /v1/system/init | Initialize the system |
| GoodmemClient.UsersApi | getUser | GET /v1/users/{id} | Get a user by ID |
Documentation for Models
- GoodmemClient.ApiKeyResponse
- GoodmemClient.BatchMemoryCreationRequest
- GoodmemClient.BatchMemoryDeletionRequest
- GoodmemClient.BatchMemoryRetrievalRequest
- GoodmemClient.CreateApiKeyRequest
- GoodmemClient.CreateApiKeyResponse
- GoodmemClient.EmbedderCreationRequest
- GoodmemClient.EmbedderResponse
- GoodmemClient.ListApiKeysResponse
- GoodmemClient.ListEmbeddersResponse
- GoodmemClient.ListSpacesResponse
- GoodmemClient.Memory
- GoodmemClient.MemoryCreationRequest
- GoodmemClient.MemoryListResponse
- GoodmemClient.Modality
- GoodmemClient.ProviderType
- GoodmemClient.Space
- GoodmemClient.SpaceCreationRequest
- GoodmemClient.SpaceEmbedder
- GoodmemClient.SpaceEmbedderConfig
- GoodmemClient.SystemInitResponse
- GoodmemClient.UpdateApiKeyRequest
- GoodmemClient.UpdateEmbedderRequest
- GoodmemClient.UpdateSpaceRequest
- GoodmemClient.UserResponse
Documentation for Authorization
Authentication schemes defined for the API:
BearerAuth
- Type: Bearer authentication
ApiKeyAuth
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
6 months ago