I've got the following simple function to detect if the browser can do multimodal prompting:
async function canDoIt() {
if(!window.LanguageModel) return false;
// to do, support downloadable
return (await LanguageModel.availability({expectedInputs:[{type:'image'}]})) === 'available';
}
On my Chrome browser, this returned available, but got an error when I tried to make a session. Turns out, I had enabled the main flag for prompting, but NOT the one for multimodal. So it makes sense, but is it a bug that the availability() call returned available even though it wasn't?