-
Notifications
You must be signed in to change notification settings - Fork 921
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
Fix ParseSSE function causing Leo to get cut off #21018
Conversation
Verification PASSED on
Basically used the STR/guidance from #21018 (comment) and went through the following:
|
Example |
Example |
Example |
Example |
Example |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
llama-2-70b-chat
- ensured that you can ask the
llama
a question and get an answer that isn't cut off - ensured that you can summarize a page/ask follow up questions without the answers being cut off
Example |
Example |
Example |
Example |
Example |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
claude-instant-v1
- ensured that you can ask the
claude
a question and get an answer that isn't cut off - ensured that you can summarize a page/ask follow up questions without the answers being cut off
Example |
Example |
Example |
Example |
Example |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
@@ -453,7 +453,7 @@ void APIRequestHelper::URLLoaderHandler::ParseSSE( | |||
}; | |||
|
|||
DVLOG(2) << "Going to call ParseJson"; | |||
GetDataDecoder()->ParseJson(std::move(json.data()), |
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'm curious how this behaved/s before and after.
std::move(json.data())
is unusual, doesn't make sense and behaved sporadically odd.
for a moment, let's examine this: json.data() returns a const char*
, the consumer of this pointer reads char up to the null terminator string.
how did this end up with sentence cut-offs?
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.
Resolves brave/brave-browser#34321
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 lint
,npm 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:
This one is hard to reproduce without setting up the AI chat server. For now, I think it is sufficient to just make sure that you can send a chat (with any model) and you do get a response, and it's not cut off.