Comparing version 9.0.3 to 10.0.0
@@ -8,3 +8,3 @@ #!/usr/bin/env node | ||
if(!content || content == undefined || content == null)return console.error("\x1b[38;5;160mPlease specify a question!\x1B[0m ") | ||
try{var api = await axios.get("https://herc-ai.onrender.com/v1/hercai?question="+encodeURI(content),{headers: {"content-type": "application/json"}}) | ||
try{var api = await axios.get("https://hercai.onrender.com/v2/hercai?question="+encodeURI(content),{headers: {"content-type": "application/json"}}) | ||
var data = api.data; | ||
@@ -11,0 +11,0 @@ return console.log("\x1b[38;5;46mHerc.ai:\x1b[33m "+data.reply+"\x1B[0m") |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const axios = require('axios'); | ||
const baseurl = "https://herc-ai.onrender.com/v1/hercai"; | ||
const baseurl = "https://hercai.onrender.com/v1/hercai"; | ||
/** | ||
* @typedef {Class} Hercai | ||
* @see {Hercai} | ||
* @example const {Hercai} = require("hercai"); | ||
* @type {Class} | ||
* @class | ||
*/ | ||
class Hercai { | ||
@@ -11,14 +19,17 @@ constructor() { | ||
/** | ||
* question | ||
* The Question You Want to Ask Artificial Intelligence. | ||
* @param {string} model "v1" | ||
* @param {string} model "v2" | ||
* @param {string} model "v2-beta" | ||
* @param {string} content The Question You Want to Ask Artificial Intelligence. | ||
* @example question({model:"v1",content:"how are you?"}) | ||
* @example client.question({model:"v2",content:"how are you?"}) | ||
* @type {string} The Question You Want to Ask Artificial Intelligence. | ||
* @returns {Hercai} | ||
* @async | ||
*/ | ||
async question({model = "v1",content}){ | ||
if(!["v1"].some(ind => model == ind)) model = "v1"; | ||
async question({model = "v2",content}){ | ||
if(!["v1","v2","v2-beta"].some(ind => model == ind)) model = "v2"; | ||
if(!content || content == undefined || content == null)throw new Error("Please specify a question!"); | ||
try{ | ||
var api = await axios.get(`https://herc-ai.onrender.com/${model}/hercai?question=`+encodeURI(content),{ | ||
var api = await axios.get(`https://hercai.onrender.com/${model}/hercai?question=`+encodeURI(content),{ | ||
headers: { | ||
@@ -35,8 +46,9 @@ "content-type": "application/json", | ||
/** | ||
* drawImage | ||
* Tell Artificial Intelligence What You Want to Draw. | ||
* @param {string} model "v1" , "v2" , "v2-beta" | ||
* @param {string} prompt Tell Artificial Intelligence What You Want to Draw. | ||
* @example drawImage({model:"v1",prompt:"anime girl"}) | ||
* @example client.drawImage({model:"v1",prompt:"anime girl"}) | ||
* @type {string} Tell Artificial Intelligence What You Want to Draw. | ||
* @returns {Hercai} | ||
* @async | ||
*/ | ||
@@ -47,3 +59,3 @@ async drawImage({model = "v1",prompt}){ | ||
try{ | ||
var api = await axios.get(`https://herc-ai.onrender.com/${model}/text2image`+"?prompt="+encodeURI(prompt),{ | ||
var api = await axios.get(`https://hercai.onrender.com/${model}/text2image`+"?prompt="+encodeURI(prompt),{ | ||
headers: { | ||
@@ -50,0 +62,0 @@ "content-type": "application/json", |
{ | ||
"name": "hercai", | ||
"version": "9.0.3", | ||
"version": "10.0.0", | ||
"description": "A powerful library for interacting with the Herc.ai API", | ||
"main": "index.js", | ||
"main": "router.js", | ||
"types": "index.d.ts", | ||
@@ -17,2 +17,6 @@ "scripts": { | ||
}, | ||
"funding":{ | ||
"type": "buymeacoffee", | ||
"url": "https://www.buymeacoffee.com/beykant" | ||
}, | ||
"license": "GPL-3.0", | ||
@@ -77,3 +81,8 @@ "keywords": [ | ||
"discord-ai", | ||
"discordai" | ||
"discordai", | ||
"free", | ||
"lodash", | ||
"react", | ||
"next", | ||
"chalk" | ||
], | ||
@@ -80,0 +89,0 @@ "repository": { |
@@ -9,8 +9,8 @@ <p align="center"> <a href="#"> <img width=500 src="https://raw.githubusercontent.com/Bes-js/herc.ai/main/hercai-logo.png"></a></p> | ||
> **We Use GPT-4 as Artificial Intelligence Engine, And We Offer It To You For Free.** | ||
> **We Use GPT-3.5 / GPT-4 as Artificial Intelligence Engine, And We Offer It To You For Free.** | ||
> **[Herc.ai](https://discord.gg/luppux) Answers Your Question According To The Language, And It Supports All Languages.** | ||
> **Question API; [https://herc-ai.onrender.com/v1/hercai?question=](https://herc-ai.onrender.com/v1/hercai?question=)** | ||
> **Question API; [https://hercai.onrender.com/v2/hercai?question=](https://herc-ai.onrender.com/v1/hercai?question=)** | ||
> **Text To Image API; [https://herc-ai.onrender.com/v2/text2image?prompt=](https://herc-ai.onrender.com/v2/hercai?prompt=)** | ||
> **Text To Image API; [https://hercai.onrender.com/v2/text2image?prompt=](https://herc-ai.onrender.com/v2/hercai?prompt=)** | ||
@@ -44,3 +44,3 @@ # | ||
```js | ||
// Importing The Package | ||
/* Importing The Package */ | ||
const { Hercai } = require('hercai'); | ||
@@ -50,6 +50,6 @@ | ||
// Available Models "v1" | Default Model;"v1" | ||
client.question({content:"hi, how are you?"}).then(response => { | ||
/* Available Models "v1","v2","beta" | Default Model; "v2" */ | ||
client.question({model:"v2",content:"hi, how are you?"}).then(response => { | ||
console.log(response.reply); | ||
// The module will reply based on the message! | ||
/* The module will reply based on the message! */ | ||
@@ -61,3 +61,3 @@ }); | ||
```js | ||
// Importing The Package | ||
/* Importing The Package */ | ||
const { Hercai } = require('hercai'); | ||
@@ -67,6 +67,6 @@ | ||
// Available Models "v1" , "v2" , "v2-beta" | Default Model; "v2" | ||
/* Available Models "v1" , "v2" , "v2-beta" | Default Model; "v2" */ | ||
client.drawImage({model:"v2",prompt:"anime girl"}).then(response => { | ||
console.log(response.url); | ||
// The module will reply based on the prompt! | ||
/* The module will reply based on the prompt! */ | ||
@@ -73,0 +73,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45784
9
130