From 929a15d598f65b87bd1ef07760fcb8bfd21422fa Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Tue, 15 Oct 2024 20:40:03 -0600 Subject: [PATCH] Ensure the AI method we need is available so an error isn't thrown --- src/js/helpers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/helpers.js b/src/js/helpers.js index e1e756b4f..3015db8b2 100644 --- a/src/js/helpers.js +++ b/src/js/helpers.js @@ -97,7 +97,8 @@ export const chromeAITextGeneration = async ( prompt = '', content = '' ) => { return result; } - const supportsTextGeneration = await window.ai.languageModel.capabilities(); + const supportsTextGeneration = + await window.ai.languageModel?.capabilities(); if ( supportsTextGeneration &&