Skip to content

Commit 205a25b

Browse files
committed
Use standalone guard for undefined mode for consistency
1 parent 65de23c commit 205a25b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/ai/src/methods/chrome-adapter.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ export class ChromeAdapter {
6868
* separation of concerns.</p>
6969
*/
7070
async isAvailable(request: GenerateContentRequest): Promise<boolean> {
71-
if (!this.mode || this.mode === 'only_in_cloud') {
71+
if (!this.mode) {
72+
logger.debug(
73+
`On-device inference unavailable because mode is undefined.`
74+
);
75+
return false;
76+
}
77+
if (this.mode === 'only_in_cloud') {
7278
logger.debug(
7379
`On-device inference unavailable because mode is "only_in_cloud".`
7480
);

0 commit comments

Comments
 (0)