This is a JS wrapper for the REST API of Aleph Alpha. It is a work in progress and not all endpoints are implemented yet.
npm install alephalphajs
import { AlephAlpha } from 'alephalphajs'
const aleph = new AlephAlpha({
API_TOKEN: 'your-api-key'
});
const response = await aleph.completion({
prompt: "Q: What is the capital of France? A:",
model: "luminous-base",
maximum_tokens: 128,
stop_sequences: ["\n"],
});
console.log(response);
const response = await aleph.completion({
prompt: [
{
type: "image",
data: "/9j/4AAQSkZJRgABAQEASABIAAD/4QCgRXhpZgAATU0AKgAAAAg...", //base64 encoded image
},
{
type: "text",
data: "when you see this image you wonder",
},
],
model: "luminous-base",
maximum_tokens: 128,
stop_sequences: ["\n"],
});
console.log(response);
async aleph.getAvailableModels();
async aleph.tokens()
async aleph.createToken({ description: string}}
async aleph.deleteToken({ token_id: string}}