Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resuming conversation #8

Open
maminiainalaic opened this issue Jan 23, 2024 · 9 comments
Open

Resuming conversation #8

maminiainalaic opened this issue Jan 23, 2024 · 9 comments

Comments

@maminiainalaic
Copy link

Hello, how can I able to resume the conversation.

@maminiainalaic maminiainalaic changed the title Resuming converstion Resuming conversation Jan 23, 2024
@Bes-js
Copy link
Owner

Bes-js commented Jan 26, 2024

How so, can you give an example?

@maminiainalaic
Copy link
Author

How so, can you give an example?

like the chatgpt site that can resume and remember the previous messages on the conversation.

@Bes-js
Copy link
Owner

Bes-js commented Feb 1, 2024

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

@maminiainalaic
Copy link
Author

maminiainalaic commented Feb 1, 2024

can you gimme a format example with the curl get method
cause mine doesn't work :

curl --request GET
--url 'https://hercai.onrender.com/v3/hercai?question=hi%20give%20me%20the%20previous%20message&memory=previous%20message%201%20previous%20message%202'
--header 'authorization: apikey'
--header 'content-type: application/json'

@Bes-js
Copy link
Owner

Bes-js commented Feb 2, 2024

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

@maminiainalaic
Copy link
Author

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

not working.

curl --request GET
--url 'https://hercai.onrender.com/v3/hercai?question=hi%20give%20me%20the%20previous%20message'
--header 'authorization: apiKey'
--header 'content-type: application/json'
--data '{"personality": "This is the previous message."}'

{"content":"hi give me the previous message","reply":"I apologize, but as an AI model, I don't have access to the previous messages of this conversation. Is there anything specific you would like to discuss or ask about? I'm here to help with any information or assistance you need."}

@Bes-js
Copy link
Owner

Bes-js commented Feb 10, 2024

Memory Feature Will Be Added Between 2-5 Days.

@maminiainalaic
Copy link
Author

maminiainalaic commented Feb 15, 2024

Memory Feature Will Be Added Between 2-5 Days.

Thank you.
I see the update. So should it always be added on the personality section ?

@Bes-js
Copy link
Owner

Bes-js commented Feb 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants