The simple API Wrapper for the
oobabooga/text-generation-webui
npm install booga.js # or yarn/pnpm whatever
You can find all parameters in here
You can get to easily get API endpoints use --public-api argument
import { Client } from "booga.js"
const client = new Client({
uri: "https://your-share-api-url.trycloudflare.com/api", // default by localhost:5000
})
client.getCurrentModel().then(model => {
console.log(model ?? "No model loaded! :(")
})
client.chat("Hello Assistant!", {
character: "Assistant"
}).then(res => {
console.log(`Assistant: ${res}`)
})