| | from dotenv import load_dotenv |
| | import os |
| |
|
| | load_dotenv() |
| |
|
| | |
| |
|
| | OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") |
| |
|
| |
|
| | |
| |
|
| | prompt_template = """Use the following pieces of information to answer the user's question. |
| | If you don't know the answer, just say that you don't know, don't try to make up an answer. |
| | |
| | Context: {context} |
| | Question: {question} |
| | |
| | Only return the helpful answer below and nothing else. |
| | Helpful answer: |
| | """ |
| |
|
| | prompt_template_with_history = """Use the following pieces of information to answer the user's question. |
| | If you don't know the answer, just say that you don't know, don't try to make up an answer. |
| | Use the history to answer the question if you can. |
| | Chat History: |
| | {chat_history} |
| | Context: {context} |
| | Question: {question} |
| | |
| | Only return the helpful answer below and nothing else. |
| | Helpful answer: |
| | """ |
| |
|