leumas-embeddings
v0.1.0
Published
Leumas Tech LLC adapter toolkit for converting text, JSON, code, documents, folders, CSV, and time-series data into embeddings with one call.
Maintainers
Readme
leumas-embeddings
High-trust adapter runner for generating embeddings from text, code, folders, PDFs, CSVs, and more. This package wraps the Leumas adapter collection behind a simple runAdapter helper so you can convert diverse assets into vector representations with just a few lines of code.
Quickstart
npm install leumas-embeddingsconst { runAdapter, listAdapters } = require('leumas-embeddings');
// Inspect the available adapters and their metadata
console.log(listAdapters());
// Generate an embedding from raw text
(async () => {
const embedding = await runAdapter('text', 'Launch sequence initiated.');
console.log(embedding); // → [0.01, 0.23, ...]
})();Adapters are referenced by their slug (e.g. text, json, code, folder). File-based adapters accept either absolute file paths or additional options depending on their modality. Refer to the metadata returned by listAdapters() or to the examples below.
Examples
// JSON payloads
await runAdapter('json', JSON.stringify({ mission: 'Atlas', status: 'green' }));
// CSV content
await runAdapter('csv', 'name,power\nSentinel,9000');
// Code repositories with filter support
await runAdapter('code', '/path/to/repo', { filters: ['js', 'ts'] });
// Time-series data
await runAdapter('time-series', '1,2,3,5,8,13');API
runAdapter(adapterType, input, [options])
Runs the underlying adapter and returns a promise that resolves to the generated embedding (an array of numbers).
listAdapters()
Returns an array describing the available adapters, including any metadata bundled with the adapter definitions.
getAdapterMetadata(adapterType)
Retrieves the metadata object for a specific adapter, or null if none is available.
License
MIT
