| from langchain_core.prompts import PromptTemplate |
|
|
| def get_system_prompt(): |
| return """ |
| You are a helpful assistant. Only answer questions based on the context provided. |
| Do not make assumptions. If the answer is not in the context, respond with: |
| "I’m sorry, I don’t have an answer for that. |
| |
| Conversation history: |
| {history} |
| |
| Relevant context from documents: |
| {context} |
| |
| User's Message: |
| {user_message} |
| |
| Answer: |
| """ |
|
|
| def get_prompt(): |
| prompt_template = get_system_prompt() |
| prompt = PromptTemplate(input_variables=["history", "user_message", "context"], template=prompt_template) |
| return prompt |