[Local AI] [WebSpeech] Serve Web Speech sessions from Brave's own model - #39398
[Local AI] [WebSpeech] Serve Web Speech sessions from Brave's own model#39398yrliou wants to merge 1 commit into
Conversation
|
|
||
| if (enable_local_ai) { | ||
| brave_content_browser_sources += [ | ||
| "//brave/content/browser/speech/brave_on_device_speech_recognition_engine.cc", |
There was a problem hiding this comment.
reported by reviewdog 🐶
[opengrep] New source files should not be added to sources.gni. Please see https://github.com/brave/brave-core/blob/master/docs/gni_sources.md for details
Source: https://github.com/brave/security-action/blob/main/assets/opengrep_rules/client/sources_gni.yaml
Cc @brave/sources-gni-reviewers
| if (enable_local_ai) { | ||
| brave_content_browser_sources += [ | ||
| "//brave/content/browser/speech/brave_on_device_speech_recognition_engine.cc", | ||
| "//brave/content/browser/speech/brave_on_device_speech_recognition_engine.h", |
There was a problem hiding this comment.
reported by reviewdog 🐶
[opengrep] New source files should not be added to sources.gni. Please see https://github.com/brave/brave-core/blob/master/docs/gni_sources.md for details
Source: https://github.com/brave/security-action/blob/main/assets/opengrep_rules/client/sources_gni.yaml
Cc @brave/sources-gni-reviewers
1a21c45 to
212a87c
Compare
Upstream decides a session is on-device in two places, and failing either sends it to SODA or to the speech recognition service, bypassing the browser. Both now accept the qualities Brave's model serves, and that path builds a subclass taking its stream from Brave's worker rather than a ModelBroker session. `AudioChunksEnded` closes the input stream but keeps the responder bound, since the worker emits its final result on that close and upstream's immediate empty result would end recognition first. No UI thread Core is built, because it would ask the optimization guide broker for assets nothing here uses. `ContentBrowserClient` gains `GetAsrSession` so content can reach the embedder without depending on Brave. The controller refuses a session when no model is installed, surfacing as a recognition failure rather than a worker that cannot load.
|
Warning You have got a presubmit warning. Please address it if possible. |
|
Warning You have got a presubmit warning. Please address it if possible. |
Upstream decides a session is on-device in two places, and failing either sends it to SODA or to the speech recognition service, bypassing the browser. Both now accept the qualities Brave's model serves, and that path builds a subclass taking its stream from Brave's worker rather than a ModelBroker session.
AudioChunksEndedcloses the input stream but keeps the responder bound, since the worker emits its final result on that close and upstream's immediate empty result would end recognition first. No UI thread Core is built, because it would ask the optimization guide broker for assets nothing here uses.ContentBrowserClientgainsGetAsrSessionso content can reach the embedder without depending on Brave. The controller refuses a session when no model is installed, surfacing as a recognition failure rather than a worker that cannot load.