Skip to content

Commit

Permalink
Ensure the AI method we need is available so an error isn't thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Oct 16, 2024
1 parent 9b97859 commit 929a15d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 929a15d

Please sign in to comment.