WebGAL_Terre
WebGAL_Terre copied to clipboard
Added Chat Functionality using ChatGPT API
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?
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 What kind of API does bing ai have? I looked into it, but I couldn't really understand it.
@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 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.
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
@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.
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 (
If the data is saved in /public/games/${gameName}/game/
, it will be exported with the game.
Due to a long period of inactivity, this PR has been closed