-
Notifications
You must be signed in to change notification settings - Fork 905
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
[AI Chat] cleanup suggestion action types #27077
Conversation
90b79eb
to
55df777
Compare
bool MigrateFrom1To2(sql::Database* db) { | ||
// Add a new column to the associated_content table to store the content type. | ||
static constexpr char kAddPromptColumnQuery[] = | ||
"ALTER TABLE conversation_entry ADD COLUMN prompt BLOB " | ||
"0"; | ||
sql::Statement statement(db->GetUniqueStatement(kAddPromptColumnQuery)); | ||
|
||
return statement.is_valid() && statement.Run(); | ||
} | ||
|
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.
Database migration and tests
55df777
to
baabfdb
Compare
A Storybook has been deployed to preview UI for the latest push |
1cd6ada
to
8878883
Compare
@@ -149,6 +148,8 @@ enum ActionType { | |||
// Change length | |||
SHORTEN, | |||
EXPAND, | |||
CONVERSATION_STARTER, | |||
SUGGESTION, |
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.
could you clarify what the difference is between a starter and a suggestion? are starters only be used when making the first prompt in the chat, and suggestions used for follow-ups?
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.
A suggestion is generated by the LLM and is about the specific page content. A conversation starter is static and yes, only for the first message
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.
chromium_src lgtm
8878883
to
ecf087d
Compare
A Storybook has been deployed to preview UI for the latest push |
0160e6d
to
44fa26e
Compare
[puLL-Merge] - brave/brave-core@27077 DescriptionThis PR makes significant changes to the AI chat functionality in Brave, primarily focusing on conversation turn handling and database structure. The main changes include:
The motivation appears to be improving the conversation model by separating displayed text from actual prompts sent to the AI, while also improving the handling of suggested questions. ChangesChangesCore Changes:
Engine Changes:
UI Changes:
sequenceDiagram
participant UI
participant ConversationHandler
participant EngineConsumer
participant Database
UI->>ConversationHandler: submitSuggestion(text)
ConversationHandler->>ConversationHandler: CreateConversationTurn
Note over ConversationHandler: Add prompt & text fields
ConversationHandler->>EngineConsumer: GenerateAssistantResponse
EngineConsumer->>EngineConsumer: GetPromptForEntry
EngineConsumer-->>ConversationHandler: Response
ConversationHandler->>Database: AddConversationEntry
Database->>Database: EncryptAndStore
Database-->>ConversationHandler: Success
ConversationHandler-->>UI: Update
Security Hotspots
|
…n prompt differs from user-visible conversation entry text - ActionType::CONVERSATION_STARTER - ActionType::SUGGESTION - ActionType::SUMMARIZE_{PAGE,VIDEO}
44fa26e
to
07de4a4
Compare
Released in v1.76.36 |
…and persist to database when prompt differs from user-visible conversation entry text
ActionType::CONVERSATION_STARTER
ActionType::SUGGESTION
ActionType::SUMMARIZE_{PAGE,VIDEO}
I believe this unblocks the following to be able to get the source of each user submission more easily:
Issues:
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: