---
title: "FAQ Enrichment use case"
method: POST
path: "/ai/prediction/faq-enrichment/{MODEL_ID}"
tags: ["Get predictions"]
---

# FAQ Enrichment use case

`POST /ai/prediction/faq-enrichment/{MODEL_ID}`

## Request

- Base URL: `https://commerce_studio_id.experiencemanager.lucidworks.com`
- URL: `https://commerce_studio_id.experiencemanager.lucidworks.com/ai/prediction/faq-enrichment/{MODEL_ID}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lucidworks/apis/rules-rewrites-api/docs/ai/prediction/faq-enrichment/:MODEL_ID/post.ts> (a function with typed inputs; its response is checked against the schema)

The FAQ enrichment use case uses a large language model (LLM) to ingest input text and return a JSON response that contains a list of question and answer pairs.

## Path parameters

- `MODEL_ID` string, required

## Headers

- `Authorization` string, required

## Request body

- FaqEnrichmentRequest
  - `batch` object[]: The text analyzed to predict possible frequently asked questions and corresponding answers.
    - `text` string: The content the model analyzes.
  - `useCaseConfig` UseCaseConfigFaqEnrichment
    - `maxPairs` integer: This parameter specifies the maximum number of questions and answer pairs that can be generated, though the model may not honor the number specified in this field.
    - `domain` 'retail' | 'finance' | 'tourism' | 'consulting' | 'healthcare' | 'hospitality' | 'manufacturing' | 'it (information technology)': This parameter specifies the domain specific for which the input FAQ documents would be considered. The domain specification helps the model generate more accurate and relevant questions for the content. The domains are listed here.
  - `modelConfig` ModelConfig: Provides fields and values that specify ranges for tokens.
    - `vectorQuantizationMethod` string: Vector quantization compresses data size, as well as reducing memory usage. The methods are: * `min-max` - Creates tensors of the text and converts it to uint8 by normalizing it to the range [0, 255]. * `max-scale` - Finds the maximum absolute value for the encoded text, normalizes it by scaling the text to a range of -127 to 127, and then returns the quantized text as an 8-bit integer tensor.
    - `dimReductionSize` integer: Used to reduce vector size while maintaining good quality. This field allows any integer above 0, but less than or equal to the vector dimension of the model. If you send a vector dimension larger than the model, a 400 Bad Request error is returned. Not every model is designed to support this parameter. In this scenario, a warning message is generated that indicates quality can decrease.

## Response `200`

OK

- FaqEnrichmentResponse
  - `predictions` FaqEnrichmentResponseTokens[]
    - `faqPairs` object[]: A list of question and answer pairs returned from the FAQ enrichment request.
      - `question` string, required: The frequently asked question.
      - `answer` string, required: The answer corresponding to the question.
    - `tokensUsed` Token
      - `promptTokens` integer: The number of tokens generated to prompt the model to continue generating results.
      - `completionTokens` integer: The number of tokens used until the model completes.
      - `totalTokens` integer: The sum of the prompt and completion tokens used in the model.

---

[API](https://skmtc.dev/lucidworks/apis/rules-rewrites-api.md) - [All operations](https://skmtc.dev/lucidworks/apis/rules-rewrites-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lucidworks/apis/rules-rewrites-api/revisions/f2d3747848e8?raw)
