-
Notifications
You must be signed in to change notification settings - Fork 872
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AIChat refactor to support standalone and persistent conversations (#…
…24921) * AI Chat: Introduce AIChatService, ConversationHandler, and direct bindings from UI Modified AIChat WebUI to directly bind to both AIChatService and ConversationHandler for most operations. Lays the groundwork for conversations to be independent of web content. In fact, most of this functionality is also within this PR. Conversation persistance (in-memory) is guarded behind a feature flag. Refactor print preview extractor to be passed to AIChatTabHelper directly Also removed max page content consideration since: 1) Model can be changed after fetching the content 2) Multiple callbacks could occur with different page content limits from different conversations 3) We need to know the (reasonable) total content length to report the percentage of content that Leo has been sent. I did consider sending the requested page content maximum length for each GetContent call, but that does not solve all the issues. Since there is a maximum limit of 20 print preview pages, it seems it's ok. kAIChatHistory flag -> AIChatHistory * ConversationHandler doesn't need to deal with navigation ID * test fix * AIChatTabHelper params instead of multiple test. Always trim content. * test and review feedback - comments, id->uuid, page-navigation-tests * fix for android build * fix same-document back/forward navigation by considering page title changes during navigation * ios refactor * Fix compiling on iOS. Fix Service registration crash. * Fix crashes on iOS. Fix logic so AIChat on iOS works correctly. Fix models list conversion to iOS. * fix ConversationHandler::GenerateQuestions, refactor non-conversation rewriting out of ConversationHandler, test ConversationHandler::GetState * feedback * fix AIChatRenderViewContextMenuBrowserTest * don't wait for client connection before submitting human message * AIChatService::MaybeAssociateContentWithConversation * feedback * android HandleVoiceRecognition now optionally passes ConversationId to target a specific conversation * feedback * fix ModelService migrating from chat-claude-instant default model pref value * feedback * format * rebase fixes * AIChatTabHelper refine and test retry logic * fix android compile * fix android again * no channel_info new string * associatedcontentdriver - remove is_page_text_fetch_in_progress_ * ConversationHandler::HasAnyHistory ignores staged entries * AIChatService: erase from content_conversation map, and test it * MaybeUnlink should check if client is connected * fix android again? * ChromeAutocompleteProviderClient should check AIChatService exists --------- Co-authored-by: Brandon T <JustBrandonT@gmail.com>
- Loading branch information
Showing
125 changed files
with
9,302 additions
and
6,634 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.