|
from langchain_core.prompts import PromptTemplate
|
|
|
|
router_instruction_prompt_1="""
|
|
You are tasked with analyzing user input to identify the most relevant keys from a dataset of user information.
|
|
Each key provides specific details about the user.
|
|
Your goal is to understand the query and conversation context to select the appropriate keys from which the user's data can help in providing accurate, personalised and actionable solutions.
|
|
|
|
1. name: The user's full name.
|
|
2. age: The user's age.
|
|
3. gender: The user's gender.
|
|
4. preferences: These are user's preferences.
|
|
5. personalInformation: These are user's personal information details.
|
|
6. relatedDemographics: Information pertaining to the user's geographic location and other demographic factors.
|
|
7. history: A record of the user's recent activities, including search history, recent purchases, places visited, and other relevant actions or events.
|
|
8. painPoints: The user's complaints, challenges, or issues they face.
|
|
9. inefficienciesOrQualityOfLifeImprovements: Areas where the user seeks improvement, along with potential solutions to increase efficiency or enhance their quality of life.
|
|
10. additionalNotes: Any extra information that might be relevant or helpful about the user.
|
|
|
|
Instructions:
|
|
- Analyze the user’s query and previous message to understand its purpose, context, and specific needs.
|
|
- Determine which keys (one or multiple) are most relevant to extract the required information to provide a comprehensive and actionable response.
|
|
- If no additional information is needed or no relevant details are found, route to None.
|
|
- Pay special attention to personalInformation if the user's financial situation or budget is relevant to the decision-making process.
|
|
|
|
Query:
|
|
{query}
|
|
|
|
Previous Messages:
|
|
{previous_messages}
|
|
|
|
Format Instructions:
|
|
{format_instructions}
|
|
"""
|
|
|
|
summary_prompt_instructions_1="""
|
|
Given the following JSON data,query and previous messages condense all the information into a summary that captures all the details that may be relevant to providing solutions for the user query.
|
|
Include in the summary only those points that are relevant to the query or conversation context. If nothing was found, return ""
|
|
Query:
|
|
{query}
|
|
|
|
Previous Messages:
|
|
{previous_messages}
|
|
|
|
Json Data:
|
|
{data}
|
|
|
|
Format Instructions:
|
|
{format_instructions}
|
|
"""
|
|
|
|
router_instruction_prompt_2=PromptTemplate.from_template("""
|
|
You are tasked with analyzing user input to identify the most relevant keys from a dataset of user information.
|
|
Each key provides specific details about the user.
|
|
Your goal is to understand the query and conversation context to select the appropriate keys from which the user's data can help in providing accurate, personalised and actionable solutions.
|
|
|
|
1. name: The user's full name.
|
|
2. age: The user's age.
|
|
3. gender: The user's gender.
|
|
4. preferences: These are user's preferences.
|
|
5. personalInformation: These are user's personal information details.
|
|
6. relatedDemographics: Information pertaining to the user's geographic location and other demographic factors.
|
|
7. history: A record of the user's recent activities, including search history, recent purchases, places visited, and other relevant actions or events.
|
|
8. painPoints: The user's complaints, challenges, or issues they face.
|
|
9. inefficienciesOrQualityOfLifeImprovements: Areas where the user seeks improvement, along with potential solutions to increase efficiency or enhance their quality of life.
|
|
10. additionalNotes: Any extra information that might be relevant or helpful about the user.
|
|
|
|
Instructions:
|
|
- Analyze the user’s query and previous message to understand its purpose, context, and specific needs.
|
|
- Determine which keys (one or multiple) are most relevant to extract the required information to provide a comprehensive, personalised and actionable response.
|
|
- If no additional information is needed or no relevant details are found, route to None.
|
|
- Pay special attention to personalInformation if the user's financial situation or budget is relevant to the decision-making process.
|
|
|
|
Query:
|
|
{query}
|
|
|
|
Previous Messages:
|
|
{previous_messages}
|
|
""")
|
|
|
|
extract_prompt_instructions_2=PromptTemplate.from_template("""
|
|
Given the following JSON data,query and previous messages extract the information that may be relevant to providing solutions for the user query.
|
|
|
|
Instructions:
|
|
- Include in the summary only those points that are relevant to the query or conversation context.
|
|
- If nothing relevant was found, return "".
|
|
- Do not provide anything in your own words.
|
|
|
|
Query:
|
|
{query}
|
|
|
|
Previous Messages:
|
|
{previous_messages}
|
|
|
|
Json Data:
|
|
{data}
|
|
|
|
""")
|
|
|
|
RESPONSE_PROMPT="""You are helpful assistant, Based on the User information and the query provide a response accordingly.
|
|
Do not Fabricate or provide false details
|
|
User information:
|
|
{user_information}
|
|
|
|
Query:
|
|
{query}
|
|
""" |