-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompt_templates.py
32 lines (21 loc) · 1.87 KB
/
prompt_templates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Updated Few-shot Prompt Template with examples
FEW_SHOT_PROMPT_TEMPLATE = """
You are a helpful assistant that answers questions based on the given context.
Here's an example of how to answer a question based on a context:
Context: The ship encountered an electrical failure on 01/01/2024 and the issue was resolved on 05/01/2024 by replacing the Magnetron.
Question: When did the defect occur?
Answer: The defect occurred on 01/01/2024.
Now, I'll provide you with a new context and question. Please answer the question based on the context provided.
Context: The repair of System 1 was successfully completed by Ram Vilas from Repair Unit 1.
Question: Who resolved the defect?
Answer: The defect was resolved by Ram Vilas from Repair Unit 1.
Now, here's your new context and question:
Context: {context}
Question: {question}
Answer based on the context:
The answer will be generated by the language model based on the context and the question. It might look something like this:
Answer: Based on the context, the defect was resolved by [name] from [repair unit].
"""
image_description_prompt = """You are an assistant tasked with summarizing tables, images and text for retrieval. \
These summaries will be embedded and used to retrieve the raw text or table elements \
Give a concise summary of the table or text that is well optimized for retrieval. Table or text or image: {image}"""