herc.ai icon indicating copy to clipboard operation
herc.ai copied to clipboard

Resuming conversation

Open maminiainalaic opened this issue 1 year ago • 9 comments

Hello, how can I able to resume the conversation.

maminiainalaic avatar Jan 23 '24 19:01 maminiainalaic

How so, can you give an example?

Bes-js avatar Jan 26 '24 20:01 Bes-js

you can add memory to the personality section as -{previous 2 messages in the database}

Bes-js avatar Feb 01 '24 13:02 Bes-js

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"
    }
})

Bes-js avatar Feb 02 '24 10:02 Bes-js

Memory Feature Will Be Added Between 2-5 Days.

Bes-js avatar Feb 10 '24 11:02 Bes-js

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)   
    }
    }

Bes-js avatar Feb 16 '24 00:02 Bes-js