Skip to content

Instantly share code, notes, and snippets.

@swissspidy
Last active January 5, 2026 21:43
Show Gist options
  • Select an option

  • Save swissspidy/477df0a812ba68fada7ab54695eb7a78 to your computer and use it in GitHub Desktop.

Select an option

Save swissspidy/477df0a812ba68fada7ab54695eb7a78 to your computer and use it in GitHub Desktop.
TypeScript type definitions for Chrome's new built-in AI Prompt API and Writing Assistance APIs
/**
* DEPRECATED! PLEASE USE https://www.npmjs.com/package/@types/dom-chromium-ai
*/
@swissspidy
Copy link
Author

That's great feedback for https://github.com/explainers-by-googlers/prompt-api and https://github.com/explainers-by-googlers/writing-assistance-apis/ - that's where I got those names and values from :)

@christianliebel
Copy link

I have created a draft PR here: DefinitelyTyped/DefinitelyTyped#70426

  • I chose to use number for the temperature instead of a union type, as using discrete values would hinder the calculation of a temperature value. This approach aligns with the guidelines outlined in the Prompt API explainer.
  • I did not copy the enum descriptions from the Chromium source due to potential copyright concerns. We can include these descriptions if we confirm that they are safe to use.

@swissspidy
Copy link
Author

@christianliebel
Copy link

Thanks for making https://www.npmjs.com/package/@types/dom-chromium-ai happen! 🎉

🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment