Product Selector

Fusion 5.9
    Fusion 5.9

    Lucidworks AI Prediction query stageLucidworks AI

    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.

    General purpose integration between Fusion and Lucidworks AI.

    skip - boolean

    Set to true to skip this stage.

    Default: false

    label - string

    A unique label for this stage.

    <= 255 characters

    condition - string

    Define a conditional script that must result in true or false. This can be used to determine if the stage should process or not.

    asyncConfig - Asynchronous Execution Config

    enabled - boolean

    Run the expensive data loading or processing part of this stage in a separate thread allowing the pipeline to continue executing. The results of this asynchronous execution can be merged into the pipeline request using a downstream "Merge Async Results" stage.

    Default: false

    asyncId - string

    A unique value to use as reference in downstream "Merge Async Results" stages.

    accountName - stringrequired

    Lucidworks AI integration name as defined by your Fusion Administrator. This entry should match the account name set in the LWAI Gateway.

    useCase - stringrequired

    Lucidworks AI Use Case as defined in documentation

    useCaseConfig - array[object]

    Additional Use Case keys and values to be sent to Lucidworks AI

    object attributes:{key required : {
     display name: Parameter Name
     type: string
    }
    value : {
     display name: Parameter Value
     type: string
    }
    }

    modelName - stringrequired

    Lucidworks AI Model as defined in documentation

    modelConfig - array[object]

    Additional Model configuration parameters to be sent to Lucidworks AI

    object attributes:{key required : {
     display name: Parameter Name
     type: string
    }
    value : {
     display name: Parameter Value
     type: string
    }
    }

    inputContextVariable - stringrequired

    Name of the variable in context to be used as input. Supports template expressions.

    outputContextVariable - stringrequired

    The name here is used to populate two things with the prediction results: 1) A query response header with this name, and 2) A context variable with this name that will contain the prediction.

    groundingOptions - Grounding Options

    Options for grounding the RAG use case.

    groundingDocsSource - string

    For use cases that support grounding via attached documents, this is the location. For example, if the response documents are stored in a context variable named 'responseDocs', then this value should be set to 'responseDocs'.

    Default: Solr Response

    Allowed values: Solr ResponseContext Variable

    groundingDocsKey - string

    The key in the context variable that contains the grounding documents. For example, if the grounding documents are stored in a context variable named 'responseDocs', then this value should be set to 'responseDocs'. Note: When the Grounding Documents Location is set to 'Solr Response', this value is ignored and the response documents are used.

    Default: responseDocs

    numberOfGroundingDocs - integer

    How many grounding documents should be included with the RAG request?

    Default: 3

    fieldMappings - array[object]

    Only needed/used for 'rag' use case. Maps fields from the input documents to the fields expected by the Lucidworks AI RAG use case. Required LW AI fields are: body and source. Optional fields are title and date. If not provided, the default field mappings will be used.

    Default: {"key":"title","value":"title_t"}{"key":"body","value":"description_t"}{"key":"source","value":"link_t"}{"key":"date","value":"_lw_file_modified_tdt"}

    object attributes:{key required : {
     display name: LW AI Document Field Name
     type: string
    }
    value required : {
     display name: Response Document Field Name
     type: string
    }
    }

    failOnError - boolean

    Flag to indicate if this stage should throw an exception if an error occurs.

    Default: false

    apiKey - string

    Secret associated with the model. For example, for OpenAI models, the value would start with 'sk-'.