Feature/chat history - #4
Merged
Merged
Conversation
Implements a configurable maxHistory limit for chat and story context in both frontend and backend. Frontend now sends only the last X(5) pairs of user/assistant messages, and backend enforces the limit per game config. Config files updated to include maxHistory, and API responses now return this value for frontend use.
Introduces a scrollable chat history for chapters and user choices in story-game.html, improving user experience and context retention. Adds 'yourChoice' translation key to all supported locales for proper labeling of user actions in the chat history.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to both the roleplay and story game experiences by adding chat history management, limiting context sent to the backend, and enhancing the user interface for story exploration. It also updates language files and configuration to support these changes. The main themes are chat history context, UI enhancements for story games, and internationalization.
Chat history context and backend integration:
maxHistoryconfiguration to bothroleplay.jsonandstory.json, allowing the backend to specify how many message pairs are kept in context for AI responses. The frontend now receives this value and uses it to limit the message history sent with each request. (server/config/games/roleplay.json[1]server/config/games/story.json[2]server/src/routes/api.js[3] [4]frontend/public/game/roleplay-game.html[1] [2] [3] [4] [5] [6];frontend/public/game/story-game.html[7] [8] [9]UI enhancements for story game:
frontend/public/game/story-game.html[1] [2] [3] [4] [5] [6] [7]frontend/public/game/story-game.htmlfrontend/public/game/story-game.htmlR241-R283)Internationalization improvements:
frontend/public/assets/locales/en.json[1]frontend/public/assets/locales/ja.json[2]frontend/public/assets/locales/ko.json[3]frontend/public/assets/locales/zh-Hans.json[4]frontend/public/assets/locales/zh.json[5]Other updates:
package.jsonfor release tracking. (package.jsonpackage.jsonL3-R5)