The LWAI Prediction query stage is an integration between Fusion and Lucidworks AI and invokes the following APIs: The stage enriches search results using Generative AI such as OpenAI, Google Vertex, and Anthropic models. In addition, the stage can use pre-trained embedding models. Your organization needs to choose the models that best suit your goals. Configuration using the Fusion UI is detailed in the Configure the LWAI Prediction query stage topic.
You can also configure the stage using the parameters listed in this topic.
To use this stage, non-admin Fusion users must be granted the PUT,POST,GET:/LWAI-ACCOUNT-NAME/** permission in Fusion, which is the Lucidworks AI API Account Name defined in Lucidworks AI Gateway when this stage is configured.

Query pipeline stage condition examples

Stages can be triggered conditionally when a script in the Condition field evaluates to true. Some examples are shown below. Run this stage only for mobile clients:
params.deviceType === "mobile"
Run this stage when debugging is enabled:
params.debug === "true"
Run this stage when the query includes a specific term:
params.q && params.q.includes("sale")
Run this stage when multiple conditions are met:
request.hasParam("fusion-user-name") && request.getFirstParam("fusion-user-name").equals("SuperUser");
!request.hasParam("isFusionPluginQuery")
The first condition checks that the request parameter “fusion-user-name” is present and has the value “SuperUser”. The second condition checks that the request parameter “isFusionPluginQuery” is not present.

Configuration

When entering configuration values in the UI, use unescaped characters, such as \t for the tab character. When entering configuration values in the API, use escaped characters, such as \\t for the tab character.