You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/rfp-answer-generation/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ The project is powered by Large Language Models (LLM) available on Amazon Bedroc
14
14
15
15
The solution is divided into 2 stacks: Ingestion and Inference. Additionally, this project provides you with a sample front-end application that allows you to upload and process new RFPs, and interact with the answers provided by the LLM: you can edit, approve and download the answers as a new XLSX file.
16
16
17
+
You can also inspect the solution [data flow](docs/images/data-flow.png).
18
+
17
19
### Ingestion stack
18
20
19
21
The ingestion stack uses the [Generative AI CDK Constructs](https://github.com/awslabs/generative-ai-cdk-constructs) Knowledge Bases and OpenSearch Serverless L2 constructs to deploy a fully-managed data ingestion pipeline powered by Anthropic Claude LLMs.
Copy file name to clipboardExpand all lines: samples/rfp-answer-generation/backend/stack/lambdas/shared/processor.py
+24-11Lines changed: 24 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@
11
11
# and limitations under the License.
12
12
#
13
13
14
+
importlogging
14
15
importnumpyasnp
16
+
importos
15
17
importpandasaspd
16
18
17
19
frombotocore.configimportConfig
@@ -20,6 +22,9 @@
20
22
21
23
from .utilsimportextract_items_from_tagged_list, get_bedrock_runtime
22
24
25
+
logger=logging.getLogger()
26
+
logger.setLevel(os.getenv("LOG_LEVEL", "INFO"))
27
+
23
28
PROMPT_TEMPLATE="""
24
29
You have received a previously answered Request For Proposal (RFP) document. Your task is to extract, ipsis literis, ALL of the questions and answers from every sheet in the document. Provide your answer enclosed by <rfp></rfp> tags.
25
30
@@ -35,13 +40,13 @@
35
40
36
41
3. If the document contains instructions from the requester, do not extract them.
37
42
38
-
4. Identify each group of questions in the RFP and the topic name for the group. The document format can very, and the topic can be specified in a column beside the question or in a single cell before a group of questions. Identify the topic name with <topic_name></topic_name> tags.
43
+
4. Identify each group of questions in the RFP and the topic name for the group. The document format can very, and the topic can be specified in a column beside the question or in a single cell before a group of questions. If the topic name is specified in a column alongside the question and the answer, group questions with the same topics together. Identify the topic name with <topic_name></topic_name> tags.
39
44
40
45
5. Identify each question and its answer.
41
46
42
47
6. Under the <topic></topic> tags, enclose the question in <question></question> tags.
43
48
44
-
7. Under the <topic></topic> tags, enclose the answer in <answer></answer> tags.
49
+
7. Under the <topic></topic> tags, enclose the answer in <answer></answer> tags. If there is no answer to the question, add an empty <answer></answer> tag.
0 commit comments