fivesobes
New Coder
A powerful library for interacting with the Herc.ai API.
NPM Link; https://www.npmjs.com/package/hercai
đź“‚ Installation
Example Interface And Usage For TypeScript;
NPM Link; https://www.npmjs.com/package/hercai
Installation
🔲 Installation For CLI
Bash:
npm i hercai -g
Bash:
npm i hercai
yarn add hercai
pnpm add hercai
bun add hercai
Quick Example
Example Question For CommonJS;
JavaScript:
/* Importing The Package */
const { Hercai } = require('hercai');
const herc = new Hercai(); //new Hercai("your api key"); => Optional
/* Available Models */
/* "v3" , "v3-32k" , "turbo" , "turbo-16k" , "gemini" */
/* Default Model; "v3" */
/* Premium Parameter; personality => Optional */
herc.question({model:"v3",content:"hi, how are you?"}).then(response => {
console.log(response.reply);
/* The module will reply based on the message! */
});
Example Draw Image For CommonJS;Text To Image API; https://hercai.onrender.com/v3/text2image?prompt=
JavaScript:
/* Importing The Package */
const { Hercai } = require('hercai');
const herc = new Hercai(); //new Hercai("your api key"); => Optional
/* Available Models */
/* "v1" , "v2" , "v2-beta" , "v3" (DALL-E) , "lexica" , "prodia", "simurg", "animefy", "raava", "shonin" */
/* Default Model; "v3" */
herc.drawImage({model:"v3",prompt:"anime girl",negative_prompt:""}).then(response => {
console.log(response.url);
/* The module will reply based on the prompt! */
});
Example Interface And Usage For TypeScript;
JavaScript:
import { Hercai, QuestionData, DrawImageData } from "hercai";
const herc = new Hercai(); //new Hercai("your api key"); => Optional
/* Question Example For TypeScript */
herc.question({model:"v3",content:"hi, how are you?"})
.then((response:QuestionData) => {
console.log(response.reply);
});
/* DrawImage Example For TypeScript */
herc.drawImage({model:"v3",prompt:"anime girl",negative_prompt:""})
.then((response:DrawImageData) => {
console.log(response.url);
});
Last edited by a moderator: