The FAQ enrichment use case of the LWAI 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:Documentation Index
Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
Use this file to discover all available pages before exploring further.
- Populate a Frequently Asked Questions page
- Support a search of similar questions
- Prepare test data for Smart Answers
Prerequisites
To use this API, you need:- The unique
APPLICATION_IDfor 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_CASEandMODEL_IDfields for the use case request. The path is:/ai/prediction/USE_CASE/MODEL_ID. A list of supported models is returned in the link:/lw-platform/ai/0stpyb/use-case-api[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 parameters and fields
Some parameters in the/ai/prediction/USE_CASE/MODEL_ID 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 thefaq-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 request
This example does not includemodelConfig parameters, but you can submit requests that include parameters described in Common parameters and fields.