koishijs / chatgpt-bot

AI conversation based on ChatGPT | 基于 ChatGPT 的 AI 对话机器人
https://chatgpt.koishi.chat
MIT License
70 stars 13 forks source link

Feat : two new configure items (prependPrompt,apiServer) #8

Open TimeBather opened 1 year ago

TimeBather commented 1 year ago

For prepend prompt configure item:

For apiServer configure item:

MaikoTan commented 1 year ago

The second one looks makes sense, I would add it later. Merci beaucoup.

But I didn't see the necessity of the first one, also I don't know how to achieve this, can you provide some examples and the detail of the implementation?

TimeBather commented 1 year ago

The example of the first configure item:

prependPrompt: 假设你是四季酱(一个机器人,父亲和创造者是梦梦),请你以四季酱的身份回答下列问题:

Then when we ask questions to the ChatBot API,it will reply:

> 假设你是四季酱(一个机器人,父亲和创造者是梦梦),请你以四季酱的身份回答下列问题:
> 你好!

你好! 我是四季酱,一个机器人。我的父亲和创造者是梦梦。我很高兴为您提供帮助。
TimeBather commented 1 year ago

And I'm considering include a command flag -i to ignore the prepend prompt and send the raw conversation to the ChatBot API

TimeBather commented 1 year ago

I

And I'm considering include a command flag -i to ignore the prepend prompt and send the raw conversation to the ChatBot API

I have a new idea that using the -p flag rather than the -i flag

-p flag specificate the bot will using the prompt(not ignore the prompt). When we using the bot with prefix mode , it will add the -p flag automaticlly. It's seems better than the -i . Because when we using the chatbot command , we are commanding the bots instead of chatting with them , so no flag should be addition to the parameter list .

MaikoTan commented 1 year ago

So my understanding is that you want to maintain the bot as a consistent character design in every thread, is it right? Currently, we maintain the conversations for every user, if we change the mechanism here to maintain the conversations per channel, would make more sense to your expectation?

TimeBather commented 1 year ago

Yes. But I think it's not a good idea that maintenance the conversation context in each channel instead of each user. It will cause the mess of the context of the bot. And when sometimes it will cause some problems in chatting

TimeBather commented 1 year ago

I think there is an another solution for the context : using the configuration file.

Then we can decide which factor we need for judging that when we should isolate the context.

Besides, I have a new idea with event system. I will talk about it in the new issue later.

MaikoTan commented 1 year ago

I will consider the feature as soon as possible. If you would like to implement it immediately, I recommend you just produce a PR for it. Also, it would be better to talk about just one thing in one issue. If you have multiple features, you can open multiple issue individually.

TimeBather commented 1 year ago

I will consider the feature as soon as possible. If you would like to implement it immediately, I recommend you just produce a PR for it. Also, it would be better to talk about just one thing in one issue. If you have multiple features, you can open multiple issue individually.

OK. I will try to implement it this afternoon.