WebGAL_Terre icon indicating copy to clipboard operation
WebGAL_Terre copied to clipboard

Added Chat Functionality using ChatGPT API

Open generalfreed opened this issue 1 year ago • 8 comments

Details:

Integrated ChatGPT API to enable chat functionality within the application.

Note: Please be aware that using the ChatGPT API will incur costs from OpenAI.

Extended the GameConfig settings to allow users to specify their API key.

Open Issues:

We have an existing issue where the chat history in ChatGPT is reset when changing the icon in the edit slider. To work around this, we've implemented save/load features using text files. However, it might be better to auto-save the chat into /public/games/${gameName}/game/chat_history.txt and auto-load it when necessary.

What are your thoughts on this?

generalfreed avatar Sep 10 '23 13:09 generalfreed

We have an existing issue where the chat history in ChatGPT is reset when changing the icon in the edit slider. To work around this, we've implemented save/load features using text files. However, it might be better to auto-save the chat into /public/games/${gameName}/game/chat_history.txt and auto-load it when necessary.

What about bing ai? In addition, I think it might be better to store the chat records with AI in the tmp directory?

dabao1955 avatar Sep 10 '23 14:09 dabao1955

@dabao1955 What kind of API does bing ai have? I looked into it, but I couldn't really understand it.

generalfreed avatar Sep 12 '23 12:09 generalfreed

@dabao1955 What kind of API does bing ai have? I looked into it, but I couldn't really understand it.

I'm learning about it for the first time too, you can try the following: https://blogs.bing.com/webmaster/may-2021/Easy-set-up-guide-for-Bing%E2%80%99s-Content-Submission-API-(Beta)

https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.submitcontent?view=bing-webmaster-dotnet

https://www.bing.com/webmasters/about?setlang=zh-cn

dabao1955 avatar Sep 12 '23 12:09 dabao1955

@dabao1955 Bing AI's API appears to be a search engine-based conversational AI. Therefore, their ability to respond to complex conversations and abstract questions is limited.

generalfreed avatar Sep 14 '23 12:09 generalfreed

Putting the API KEY configuration in the game settings seems a bit odd. I believe it should be stored in the browser's local storage, just like some third-party ChatGPT WebUIs do. I don't know if you're aware of a particularly popular project called chatgpt-next-web, but that's how they do it

MakinoharaShoko avatar Sep 14 '23 13:09 MakinoharaShoko

@dabao1955 Bing AI's API appears to be a search engine-based conversational AI. Therefore, their ability to respond to complex conversations and abstract questions is limited.

maybe? But sometimes using bing ai may be a good choice.

dabao1955 avatar Sep 14 '23 15:09 dabao1955

I think should can save some settings such as the api key to a config file. Read by software. But I don’t understand front-end technology (

dabao1955 avatar Sep 14 '23 15:09 dabao1955

If the data is saved in /public/games/${gameName}/game/, it will be exported with the game.

nini22P avatar Sep 15 '23 13:09 nini22P

Due to a long period of inactivity, this PR has been closed

MakinoharaShoko avatar Aug 21 '24 13:08 MakinoharaShoko