To use this model you need to have the Built-in AI Early Preview Program for Chrome. You can find more information about the program here:
Built-in AI Early Preview Program
https://developer.chrome.com/docs/ai/built-in
// Initialize the ChromeAI model.const model = new ChromeAI({ temperature: 0.5, // Optional. Default is 0.5. topK: 40, // Optional. Default is 40.});// Call the model with a message and await the response.const response = await model.invoke([ new HumanMessage({ content: "My name is John." }),]); Copy
// Initialize the ChromeAI model.const model = new ChromeAI({ temperature: 0.5, // Optional. Default is 0.5. topK: 40, // Optional. Default is 40.});// Call the model with a message and await the response.const response = await model.invoke([ new HumanMessage({ content: "My name is John." }),]);
Optional
Protected
Initialize the model. This method may be called before invoking the model to set up a chat session in advance.
Static
To use this model you need to have the
Built-in AI Early Preview Program
for Chrome. You can find more information about the program here:Link
https://developer.chrome.com/docs/ai/built-in
Example