In this example, a simple chat bot is implemented in one file, with no backend. Using the Chrome Extension ⚠️, you can choose which model to use with apps built on window.ai
// Get the active model from the window.ai API
await window.ai.getCurrentModel()
// Get completions from the window.ai API
await window.ai.getCompletion(
{
messages: [...last10messages],
},
{
onStreamResult: (result: any, error: any) => {
console.log(result.message.content)
},
})
Hi! I am a friendly AI assistant. Ask me anything!
The Window extension allows you to configure the models you use on the web. You can choose from OpenAI, Together, Cohere, or even an AI running on your computer if you need privacy.
The Window extension keeps a history of all the messages you send and receive. You can use this history to train your own AI models.
Read the announcement