herc.ai
herc.ai copied to clipboard
Resuming conversation
Hello, how can I able to resume the conversation.
How so, can you give an example?
you can add memory to the personality section as -{previous 2 messages in the database}
example with axios
var api = await axios.get(`https://hercai.onrender.com/v3/hercai?question=hi`,{
headers: {
"content-type": "application/json",
"Authorization": "apiKey",
},
data:{
personality: "Personality"
}
})
Memory Feature Will Be Added Between 2-5 Days.
It is currently available as a beta model, its memory is currently 20 minutes, we will increase this further to 3-4 days. Example;
import { Hercai } from "hercai";
const herc = new Hercai(); //new Hercai("your api key"); => Optional
herc.betaQuestion({content:"hi, how are you?",user:'chat-id'})
.then((response) => {
console.log(response.reply);
});
/* DrawImage Example */
herc.betaDrawImage({
prompt:"anime girl",
negative_prompt:"",
sampler:"DPM-Solver", /* Default => DPM-Solver */
image_style:"Null", /* Default => Null */
width:1024, /* Default => 1024 */
height:1024, /* Default => 1024 */
steps:20, /* Default => 20 */
scale:5 /* Default => 5 */
}).then((response) => {
console.log(response.url);
});
Or
/**
* This Model Is Still In Development And Beta Stage.
* The Question You Want to Ask Artificial Intelligence.
* @param {string} content The Question You Want to Ask Artificial Intelligence.
* @param {string} user It includes the features that you want to be included in the output you want from artificial intelligence.
* @example client.betaQuestion({content:"how are you?"})
* @type {string} The Question You Want to Ask Artificial Intelligence.
* @returns {Hercai}
* @async
*/
async betaQuestion({content,personality="",user=""}){
if(!content || content == undefined || content == null)throw new Error("Please specify a question!");
try{
var api = await axios.get(`https://hercai.onrender.com/beta/hercai?question=`+encodeURI(content)+`&user=`+encodeURI(user),{
headers: {
"content-type": "application/json",
"Authorization": this.apiKey,
},
data:{
personality: personality
}
})
return api.data;
}catch(err){
throw new Error("Error: "+ err.message)
}
}