Repository navigation
fix(ai-adapter): send catch up summaries as a one-shot prompt - #1423
Open
MuhammadFaizan-prog wants to merge 1 commit into
Open
MuhammadFaizan-prog wants to merge 1 commit into
MuhammadFaizan-prog wants to merge 1 commit into
Conversation
summarize() put the transcript in the prompt and also passed the same messages as context.history, so every adapter sent the latest messages twice and appended the instruction to the conversation. Send empty history like getSuggestions(), keep roomId/userId/metadata, and mark the transcript as chat data.
This branch has not been deployed
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.
fix(ai-adapter): send catch up summaries as a one-shot prompt
Acceptance Criteria fulfillment
BaseAIAdapter.summarize()sends the transcript once instead of also sending the last 10 messages as chat turns.history, likegetSuggestions()already does, and keeps the caller'sroomId,userIdandmetadata.IAIAdapterinterface or the adapters.Fixes #1422
Video/Screenshots
No UI change. With
buildChatMessagescapturing the request forsummarize(messages, { roomId, userId, history: messages })on 20 messages (the Catch up call): Before: last message appears 2 times. After: 1 time; the full transcript and the summary instruction are still in the prompt.PR Test Details
prettier --check 'src/'andtsc --noEmitpass for packages/ai-adapter.Prepared with AI assistance (Hark); I reviewed and own the final diff.
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace
<pr_number>with the actual PR number.