To use the Conversations API, install the @wix/ai-site-chat
package.
To install the package, follow the instructions below based on your development environment.
When developing with:
or
When developing CLI or self-hosted Wix apps, as well as headless apps or sites, run the following command:
or
To import the package in your code:
This article shares a possible use case your app or site could support, as well as a sample flow. This can be a helpful jumping-off point.
To reduce the AI assistant's active hours if the quota has nearly been reached:
current
is greater than 80% of quota
, call Set Widget Settings to reduce the AI assistant's active hours.This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves the conversation for the site visitor calling this method.
This method must be called using the site visitor or site member identity (SDK | REST) to identify the site visitor that is requesting the conversation.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
This method is deprecated and was replaced with CheckQuota.
Retrives the conversation usage and quota for the site.
function getConversationsUsage(): Promise<GetConversationsUsageResponse>;
import { conversations } from "@wix/ai-site-chat";
async function getConversationsUsage() {
const response = await conversations.getConversationsUsage();
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.