Question Answerer
2 min read
Functionality
This module is designed to load an Excel file containing questions and answer them based on a provided set of documents connected to a scope. It provides the answers in three formats:
in the chat interface with clickable references
an Excel file
a Word file
Sequence of Events within Module
Upload and Load Excel File:
Automatically detect and load the relevant Excel file (containing the questions) uploaded into the chat
Question Processing:
Sequentially process each question by querying the Knowledge Center for answers.
Provide answers with clickable references.
Output Generation:
Chat Output: Display answers in the chat interface, each accompanied by clickable references.
Excel Export: Generate an Excel file
Word Export: Generate a Word file containing a flow of text with questions, answers, and references.

Input
The input file is an Excel document uploaded by the user. The Excel file must contain a list of questions to be processed by the module. Columns where to find the questions can be configured.
Finma_questions_example_simple.xlsxExcel spreadsheetDownload
Output
The module produces as described above an output in the chat as well as Excel and Word files.
Reference in Code in AI Module Template
QuestionAnswerer
Configuration settings
This section contain all configurable parameters.
Default Configuration
Please adjust originalQuestionCol and ExtendedQuestionCol according to the columns of your excel file. The config below, expects an Excel file with a column named original_question, and a column named extended_question. The latter is ignored if it doesn’t exist, but original_question is mandatory!
{
"languageModel": "AZURE_GPT_4o_2024_1120",
"excelConfig": {
"uploadSuffix": "_answers.xlsx",
"sheetConfigs": null,
"sheetConfig": {
"name": "Sheet1",
"originalQuestionCol": "original_question",
"extendedQuestionCol": "extended_question"
},
"exportConfig": {
"uploadSuffix": "_answers.xlsx",
"uploadScopeId": null,
"uploadToChat": true,
"renameColMap": null,
"tableHeaderFormat": {
"bg_color": "#966919",
"bold": true,
"font_color": "white",
"text_wrap": true
},
"skipIngestion": true,
"tableDataFormat": {
"bg_color": "#FFFFFF",
"bold": false,
"font_color": "black",
"text_wrap": true,
"border": 1,
"valign": "top"
}
}
},
"docxGenerator": {
"uploadSuffix": "_report_output.docx",
"uploadScopeId": null,
"uploadToChat": true,
"templateContentId": null,
"templateName": "template.docx",
"templateScopeId": null,
"templateFields": {
"date": "07/07/2025",
"document_title": "Template Document"
},
"skipIngestion": true
},
"searchType": "COMBINED",
"chunkedSources": false,
"searchLanguage": "English",
"systemPromptSearch": "You are tasked with answering questions in a questionnaire. Below, you will find a question along with several information sources, each marked with XML tags.\n\nPlease respond to the 'Original Question' using ONLY the facts provided in these sources. We also provide the 'Extended Question', which is a reformulated question that carries the context when the 'Original Question' was asked.\n\nIf not specified, format the answer using an introduction followed by a list of bullet points.\n\nFirst, STRICTLY reference each fact you use. A fact is preferably referenced by ONLY ONE source e.g [sourceX].\n\nHere is an example on how to reference sources (referenced facts must STRICTLY match the source number):\n- Some information retrieved from source N°X.[sourceX]\n- Some information retrieved from source N°Y and some information retrieved from source N°Z.[sourceY][sourceZ]",
"triggerPromptSearch": "Sources:\n```\n$context\n```\n\nOriginal Question:\n```\n$original_question\n```\n\nExtended Question:\n```\n$extended_question\n```\n\nAnswer concisely in $language and ALWAYS reference each of your facts:",
"toRemoveFilesSuffixesFromSearchResults": [
"_answers.xlsx",
"_answers.docx",
"_question_extract.xlsx",
"_highlighted.docx",
"_report_output.docx"
],
"limit": 50,
"rerankerConfig": null,
"chunkRelevancySortConfig": {
"enabled": false,
"relevancyLevelsToConsider": [
"high",
"medium",
"low"
],
"relevancyLevelOrder": {
"high": 0,
"medium": 1,
"low": 2
},
"languageModel": "AZURE_GPT_4o_2024_1120",
"fallbackLanguageModel": "AZURE_GPT_4o_2024_1120",
"additionalLlmOptions": {},
"structuredOutputConfig": {
"enabled": false,
"extract_fact_list": false,
"reason_description": "A brief explanation justifying your evaluation decision.",
"value_description": "Assessment of how relevant the facts are to the query. Must be one of: ['low', 'medium', 'high'].",
"fact_description": "A fact is an information that is directly answers the user's query. Make sure to emphasize the important information from the fact with bold text.",
"fact_list_description": "A list of relevant facts extracted from the source that supports or answers the user's query."
},
"maxTasks": null
},
"hallucinationConfig": {
"enabled": false,
"name": "hallucination",
"languageModel": "AZURE_GPT_4o_2024_1120",
"additionalLlmOptions": {},
"customPrompts": {
"systemPrompt": "\nYou will receive a question, references, a conversation between a user and an agent, and an output. \nThe output is the answer to the question. \nYour task is to evaluate if the output is fully supported by the information provided in the references and conversation, and provide explanations on your judgement in 2 sentences.\n\nUse the following entailment scale to generate a score:\n[low] - All information in output is supported by the references/conversation, or extractions from the references/conversation.\n[medium] - The output is supported by the references/conversation to some extent, but there is at least some information in the output that is not discussed in the references/conversation. For example, if an instruction asks about two concepts and the references/conversation only discusses either of them, it should be considered a [medium] hallucination level.\n[high] - The output contains information that is not part of the references/conversation, is unrelated to the references/conversation, or contradicts the references/conversation.\n\nMake sure to not use any external information/knowledge to judge whether the output is true or not. Only check whether the output is supported by the references/conversation, and not whether the output is correct or not. Also do not evaluate if the references/conversation contain further information that is not part of the output but could be relevant to the question. If the output mentions a plot or chart, ignore this information in your evaluation.\n\nYour answer must be in JSON format:\n{\n \"reason\": Your explanation of your judgement of the evaluation,\n \"value\": decision, must be one of the following: [\"high\", \"medium\", \"low\"]\n} \n",
"userPrompt": "\nHere is the data:\n\nInput:\n'''\n$input_text\n'''\n\nReferences:\n'''\n$contexts_text\n'''\n\nConversation:\n'''\n$history_messages_text\n'''\n\nOutput:\n'''\n$output_text\n'''\n\nAnswer as JSON:\n",
"systemPromptDefault": "\nYou will receive a question and an output. \nThe output is the answer to the question. \nThe situation is that no references could be found to answer the question. Your task is to evaluate if the output contains any information to answer the question,\nand provide a short explanations of your reasoning in 2 sentences. Also mention in your explanation that no references were provided to answer the question.\n\nUse the following entailment scale to generate a score:\n[low] - The output does not contain any information to answer the question.\n[medium] - The output contains some information to answer the question, but does not answer the question entirely. \n[high] - The output answers the question.\n\nIt is not considered an answer when the output relates to the questions subject. Make sure to not use any external information/knowledge to judge whether the output is true or not. Only check that the output does not answer the question, and not whether the output is correct or not.\nYour answer must be in JSON format:\n{\n \"reason\": Your explanation of your reasoning of the evaluation,\n \"value\": decision, must be one of the following: [\"low\", \"medium\", \"high\"]\n}\n",
"userPromptDefault": " \nHere is the data:\n\nInput:\n'''\n$input_text\n'''\n\nOutput:\n'''\n$output_text\n'''\n\nAnswer as JSON:\n"
},
"scoreToLabel": {
"LOW": "GREEN",
"MEDIUM": "YELLOW",
"HIGH": "RED"
},
"scoreToTitle": {
"LOW": "No Hallucination Detected",
"MEDIUM": "Hallucination Warning",
"HIGH": "High Hallucination"
}
},
"language": "English",
"maxTokens": 5000,
"scopeIds": null,
"chatOnly": false,
"scopeToChatOnUpload": false,
"uploadScopeId": null,
"sourceFormatConfig": {
"sourceTemplate": "<source${index}>${document}${info}${text}</source${index}>",
"sections": {
"document": "<|document|>{}<|/document|>\n",
"info": "<|info|>{}<|/info|>\n"
}
}
}General parameters
Parameter | Description | Type | Default |
|---|---|---|---|
| used LLM model | string |
|
| See Excel Generator | object | |
| See Docx Generator | object | |
| See Reranker | object | |
| Defines the type of search to be performed ( | string |
|
| Indicates if chunks of the same document are appended as individual sources ( |
|
|
| Language to use for the full-text search | string |
|
| System prompt | string | See Default Configuration above |
| User prompt | string | See Default Configuration above |
| Files that should be ignored in the search | list[string] | json |
| Number of chunks returned by search type. |
|
|
| See Reranker | object | |
| object | ||
| object | ||
| Language in which the answers should be | string |
|
| Maximum number of tokens used by sources and previous conversation in the LLM call |
|
|
| Optional scope identifiers to limit the search |
| null |
| If true, restricts search to files uploaded to chat (Irrespective of whether a file was uploaded or not) |
|
|
| Indicates if the scope should be switched to the current chat upon file upload |
|
|
| Upload scope for generated word document. If null upload to the chat. | string | null |
| SourceFormatConfig allows you to include metadata into the chunk. This does not improve vector/combined search, but helps bring metadata into the LLM’s context at the chunk level. Note that the keywords “document” and “info” are not supported from the metadata. |
| json |