Repository
Current version released
3 years ago
Dependencies
std
Versions
- v3.0.4Latest
- v3.0.3
- v3.0.1
- v3.0.1
- v3.0.0
- v3.0.0-beta.6
- v3.0.0-beta.2
- v3.0.0-beta.2
- v3.0.0-beta.1
- v3.0.0-beta.0
- v3.0.0-alpha.6
- v3.0.0-alpha.5
- v3.0.0-alpha.4
- v3.0.0-alpha.2
- v3.0.0-alpha.1
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v2.0.0-alpha.7
- v2.0.0-alpha.6
- v2.0.0-alpha.4
- v2.0.0-alpha.3
- v2.0.0-alpha.2
- v2.0.0-alpha.1
- v2.0.0-alpha.1
- v0.1.22
- v2.0.0-alpha.0
- v1.0.0-alpha.0
- v0.1.21
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.2
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- v0.0.1
- v0.0.0
AIWrapper
A Universal AI Wrapper for JavaScript & TypeScript
Generate text, images, and voice from anywhere—servers, browsers and apps. It works in anything that runs JavaScript.
Features
- Generate text, images, and voice with a simple API
- Easily calculate cost of usage
- Output valid JSON & Schemas from LLMs
- Swap models quickly or chain different models together
- Use it with JavaScript or TypeScript from anywhere
Installation
Install with npm, import in Deno by URL or download and use directly.
NPM
npm install aiwrapperDeno
import * as aiwrapper from "https://deno.land/x/aiwrapper/mod.ts";Quick Start
Generate Text
import { Lang } from "aiwrapper";
const lang = Lang.openai({ apiKey: "YOUR KEY" });
const answer = await lang.ask("Say hi!");
console.log(answer);Generate Image
import { Img } from "aiwrapper";
const img = Img.openai({ apiKey: "YOUR KEY" });
const image = await img.ask('A portrait of a cute cat');
console.log(image);Generate Voice
import { Voice } from "aiwrapper";
const voice = Voice.google({ apiKey: "YOUR KEY" });
const audio = voice.ask('Hello, world!');
console.log(audio.length);