Huh, looking at the code, it's simpler than I thought, basically these are the 2 lines that enable the request-response functionality:
const session = await window.ai.createTextSession();
const response = await session.prompt(prompt);