Hacker News new | ask | show | jobs
by dchest 721 days ago
That's just some supplemental code. The actual API is:

    const session = await window.ai.createTextSession()
    const outputText = await session.prompt(inputText)
That's all there is for now (createGenericSession does the same at this time, and there are canCreateTextSession/canCreateGenericSession).
1 comments

Update: there's actually quite a lot more: https://github.com/explainers-by-googlers/prompt-api