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

// Initialize the ChatChromeAI model.
const model = new ChatChromeAI({
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." }),
]);

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

temperature: number = 0.5
topK: number = 40
session?: AITextSession

Methods

  • Call .destroy() to free resources if you no longer need a session. When a session is destroyed, it can no longer be used, and any ongoing execution will be aborted. You may want to keep the session around if you intend to prompt the model often since creating a session can take some time.

    Returns void

Generated using TypeDoc