Created
July 20, 2024 07:17
-
-
Save Nithur-M/3516a6bb8310e6c983d37f79f4c168fd to your computer and use it in GitHub Desktop.
Check if Gemini Nano is supported in user browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
async function checkCanShow() { | |
const canCreate = await window.ai?.canCreateTextSession(); | |
console.log(canCreate) | |
if (canCreate == "readily") { | |
setCanShow(true) | |
} | |
} | |
checkCanShow(); | |
}, []) | |
if(!canShow) { | |
return null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment