1.4.0 • Published 6 months ago

alephalphajs v1.4.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
6 months ago

alephalphajs - JS Wrapper for the REST API of Aleph Alpha

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.

Installation

npm install alephalphajs

Initialization

import { AlephAlpha } from 'alephalphajs'

const aleph = new AlephAlpha({
	API_TOKEN: 'your-api-key'
});

Usage

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);

Usage Multimodal

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);

Get All Available Models

async aleph.getAvailableModels();

Get Tokens

async aleph.tokens()

Create Token

async aleph.createToken({ description: string}}

Delete Token

async aleph.deleteToken({ token_id: string}}
1.4.0

6 months ago

1.3.1

6 months ago

1.3.0

6 months ago

1.2.0

1 year ago

1.1.1

1 year ago

1.0.2

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago