Product Selector

Fusion 5.9
    Fusion 5.9

    Standalone query rewriter use caseLucidworks AI Prediction API

    The Standalone query rewriter use case of the LWAI Prediction API rewrites the text in reference to the context based on the memoryUuid into a standalone query.

    This use case can only use the memoryUuid from a previous RAG query or standalone interaction.

    To view the full configuration specification for an API, click the View API specification button.

    view api spec

    Prerequisites

    To use this API, you need:

    • The unique APPLICATION_ID for your Lucidworks AI application. For more information, see credentials to use APIs.

    • A bearer token generated with a scope value of machinelearning.predict. For more information, see Authentication API.

    • The USE_CASE and MODEL_ID fields for the use case request. The path is: /ai/prediction/USE_CASE/MODEL_ID. A list of supported models is returned in the Lucidworks AI Use Case API. For more information about supported models, see Generative AI models.

    Common parameters and fields

    Some parameters in the /ai/async-prediction/USE_CASE/MODEL_ID request are common to all of the generative AI (GenAI) use cases, such as the modelConfig parameter. Also referred to as hyperparameters, these fields set certain controls on the response. Refer to the API spec for more information.

    Unique values for the standalone query rewriter use case

    Some parameter values available in the standalone query rewriter use case are unique to this use case, including values for the useCaseConfig parameter. Refer to the API spec for more information.

    Example request

    This example does not include modelConfig parameters, but you can submit requests that include parameters described in Common parameters and fields.

    curl --request POST \
      --url https://APPLICATION_ID.applications.lucidworks.com/ai/prediction/standalone_query_rewriter/MODEL_ID \
      --header 'Authorization: Bearer ACCESS_TOKEN' \
      --header 'Content-type: application/json' \
      --data '{
      "batch": [
        {
          "text": "Is it a framework?"
          },
      ],
        "useCaseConfig": {
          "memoryUuid": "27a887fe-3d7c-4ef0-9597-e2dfc054c20e"
        }
    }'

    The following is an example response:

    {
      "predictions": [
        {
          "response": "Is RAG a framework?",
          "tokensUsed": {
           "promptTokens": 245,
           "completionTokens": 6,
           "totalTokens": 251
           },
        }
      ]
    }