fix: Fix response extraction logic to avoid always picking up welcome…#17
Open
qscde45 wants to merge 1 commit intoPleasePrompto:masterfrom
Open
fix: Fix response extraction logic to avoid always picking up welcome…#17qscde45 wants to merge 1 commit intoPleasePrompto:masterfrom
qscde45 wants to merge 1 commit intoPleasePrompto:masterfrom
Conversation
… message NotebookLM's welcome message always appears at the end of the response element list, causing elements[-1] to return the welcome message instead of the actual AI answer. Changed to snapshot existing texts before submission, then find the truly new response by text comparison. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Title:
fix: Fix response extraction logic to avoid always picking up welcome message
Body:
Summary
response elements after submission, preventing the welcome message or stale answers from
being returned
last element
Problem
The previous logic took
elements[-1](the last response element), but in some cases thelast element was the welcome message or a stale answer, causing incorrect results to be
returned.
Solution
(
pre_texts)pre_textsresponse_selectorfor more efficient lookups