Some more data. I was plinking around with DevTools in the Canary build, and despite the fact that 2 days after successfully downloading the optimization guide I still can't run the Summarization API Playground, the summarizer API does appear to be available. Below is a record of my plinking and as you can see, I
can call the summarizer API and execute a successful (albeit silly) summarization:
await summarizer.summarize('The great big house.');
`* The text describes a large, imposing house.\n* The house is described as "great big."\n* The text focuses on the house's size and scale. \n* The lack of further details suggests that the text might be a title or a brief description of the house's overall presence.`But as you can also see, "ai.assistant" is undefined:
const session = await ai.assistant.create();
VM61:1 Uncaught TypeError: Cannot read properties of undefined (reading 'create')
at <anonymous>:1:36
(anonymous) @ VM61:1Here is the full plinking session, in case it helps:
summarization-api-playground/:1 The model was available but there was not an execution config available for the feature.Understand this warningAI
/vite.svg:1
Failed to load resource: the server responded with a status of 404 ()Understand this errorAI
await window.ai.createTextSession()
VM13:1 Uncaught TypeError: window.ai.createTextSession is not a function
at <anonymous>:1:17
(anonymous) @ VM13:1Understand this errorAI
(await ai.languageModel.capabilities()).available;
'readily'
await ai.languageModel.create();
AILanguageModel {maxTokens: 4096, tokensSoFar: 0, tokensLeft: 4096, topK: 3, temperature: 1}maxTokens: 4096temperature: 1tokensLeft: 4096tokensSoFar: 0topK: 3[[Prototype]]: AILanguageModel
await window.ai.createTextSession()
VM29:1 Uncaught TypeError: window.ai.createTextSession is not a function
at <anonymous>:1:17
(anonymous) @ VM29:1Understand this errorAI
const session = await ai.assistant.create();
VM61:1 Uncaught TypeError: Cannot read properties of undefined (reading 'create')
at <anonymous>:1:36
(anonymous) @ VM61:1Understand this errorAI
await window.ai.summarizer
AISummarizerFactory {}[[Prototype]]: AISummarizerFactory
await window.ai.summarizer()
VM136:1 Uncaught TypeError: window.ai.summarizer is not a function
at <anonymous>:1:17
(anonymous) @ VM136:1Understand this errorAI
await window.ai.summarizer.create()
AISummarizer {sharedContext: '', type: 'key-points', format: 'markdown', length: 'medium'}format: "markdown"length: "medium"sharedContext: ""type: "key-points"[[Prototype]]: AISummarizer
const summarizer = await window.ai.summarizer.create()
undefined
summarizer
AISummarizer {sharedContext: '', type: 'key-points', format: 'markdown', length: 'medium'}
summarizer.summarize('The great big house.')
Promise {<pending>}
await summarizer.summarize('The great big house.')
`* The text describes a large, imposing house.\n* The house is described as "great big."\n* The text focuses on the house's size and scale. \n* The lack of further details suggests that the text might be a title or a brief description of the house's overall presence.`