-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aichat: prevent page from being summarized multiple times #23647
Conversation
if (!has_summarized_) { | ||
suggestions_.emplace_back( | ||
is_video_ ? l10n_util::GetStringUTF8(IDS_CHAT_UI_SUMMARIZE_VIDEO) | ||
: l10n_util::GetStringUTF8(IDS_CHAT_UI_SUMMARIZE_PAGE)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another possible solution is to infer whether it's an initial conversation and add summary-related suggestions only then. this can avoid us maintaining an internal state. cc @petemill
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial conversation? Not sure what that means exactly. In any case it seems ok to keep internal state about has_summarized
if it's a requirement of the UI to only show the summarize button if it hasn't been clicked yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the alternative (perhaps better?) is to check if any history items have action_type == mojom::ActionType::SUMMARIZE_PAGE
(or ..._VIDEO
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking history now. updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's better to check the history?
@@ -10,6 +10,7 @@ | |||
#include <optional> | |||
#include <string> | |||
#include <string_view> | |||
#include <utility> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this addition doesn't seem related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was left out in one of your PRs (conversation api one?) which resulted in the following format issue
../components/ai_chat/core/browser/conversation_driver.h:147: (cpplint) Add #include for move [build/include_what_you_use] [4]
Resolves brave/brave-browser#36541
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: