Skip to main content
The FAQ enrichment use case of the Lucidworks AI Async Prediction API uses a large language model (LLM) to ingest input text and return a JSON response that contains a list of question and answer pairs. The questions are what the LLM believes are, or could be, frequently asked questions. The answers are generated based on the content of the text. This use case can be used to generate questions and answers from each document that can be used for the following purposes:
  • Populate a Frequently Asked Questions page
  • Support a search of similar questions
  • Prepare test data for Smart Answers
The FAQ enrichment use case contains two requests:
  • POST request - submits a prediction task for a specific useCase and modelId. The API responds with the following information:
  • predictionId. A unique UUID for the submitted prediction task that can be used later to retrieve the results.
  • status. The current state of the prediction task.
    • GET request - uses the predictionId you submit from a previously-submitted POST request and returns the results associated with that previous request.

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 in the /async-prediction for the POST request. The path is /ai/async-prediction/USE_CASE/MODEL_ID. A list of supported modes is returned in the Lucidworks AI Use Case API. For more information about supported models, see Generative AI models.
  • Other required fields specified in each individual use case.

Common POST request parameters and fields

Some parameters in the /ai/async-prediction/USE_CASE/MODEL_ID POST request are common to all of the generative AI (Gen-AI) 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 FAQ enrichment use case

Some parameter values in the faq-enrichment use case are unique and may not be available in other use cases, including values for the text and useCaseConfig parameters. Refer to the API spec for more information.

Example POST 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/async-prediction/faq-enrichment/MODEL_ID \
 --header 'Authorization: Bearer ACCESS_TOKEN' \
 --header 'Content-type: application/json' \
 --data '{
 "batch": [
   {
     "text": "Global Travel Spending and Payment Trends in 2024\n\nGlobal tourism spending is expected to return to pre-pandemic levels in 2024. However, with inflation still affecting consumers, finding convenient and cost-effective payment methods remains a top priority for travelers. To understand payment preferences and behaviors, our Bank surveyed 1,800 consumers worldwide about their travel financing experiences and future spending plans. The findings highlight six key trends shaping how merchants can cater to global travelers.\n1. Cash Remains Essential\n\nWhile cash usage declined during the pandemic, it remains an important travel resource. Half of respondents use cash for purchases, while the other half carry it for emergencies. Asian travelers rely on cash the most—99% reported carrying it, compared to just 6% of total respondents who travel without it.\n2. Payment Choices Prioritize Ease, Deals, and Security\n\nTravelers select payment methods based on convenience, the best available deals, and security. Many prefer using cash-on-hand (e.g., debit) over credit or financing options like buy now, pay later.\n3. Travelers Plan Around Payment Acceptance\n\nAlthough credit cards are widely used, 73% of respondents have faced acceptance issues while traveling, with 42% choosing not to make a purchase as a result. To avoid complications, 72% plan ahead to ensure their preferred payment method is accepted, and 80% check for acceptance signage before spending.\n4. North American Travelers Favor Credit Cards\n\nWhile most global travelers prefer debit cards, North Americans rely heavily on credit—58% of respondents favor credit cards over debit (43%) or cash (40%).\n5. Airline-Branded Credit Cards Are Popular\n\nAmong travel-specific credit cards, airline-branded options are the most widely used, with 15% of cardholders relying on them. These cards are particularly popular in Asia and North America.\n6. Many Travelers Don't Maximize Their Rewards\n\nAlthough 43% of respondents have a travel rewards credit card, many don't use their points. Millennials are the most likely to leverage travel rewards, and international travelers are more likely to own a rewards card than domestic travelers. However, only 54% of rewards cardholders use their points for personal travel.\nBy understanding these trends, merchants can optimize payment options to attract and accommodate travelers worldwide."
     }
   ],
   "useCaseConfig": {
     "maxPairs": 10,
     "domain": "finance"
   }
 }'
The following is an example response:
{
 "predictionId": "fd110486-f168-47c0-a419-1518a4840589",
 "status": "SUBMITTED"
}

Example GET request

curl --request GET \
  --url https://APPLICATION_ID.applications.lucidworks.com/ai/async-prediction/fd110486-f168-47c0-a419-1518a4840589 \
  --header 'Authorization: Bearer ACCESS_TOKEN'