MikeCraBash commited on
Commit
48ee1eb
1 Parent(s): fc77a86
Files changed (1) hide show
  1. app.py +68 -3
app.py CHANGED
@@ -64,6 +64,7 @@ from langchain_openai import ChatOpenAI
64
  openai_chat_model = ChatOpenAI(model="gpt-3.5-turbo")
65
 
66
  from langchain_core.prompts import ChatPromptTemplate
 
67
  RAG_PROMPT = """
68
  CONTEXT:
69
  {context}
@@ -71,10 +72,74 @@ CONTEXT:
71
  QUERY:
72
  {question}
73
 
74
- Use the provided context to answer the user's query. You are a professional personal assistant for an executive professional in a high tech company. You help them plan for events and meetings.
75
- You always review the provided event information. You can look up dates and location where event sessions take place from the document. If you do not know the answer, or cannot answer, please respond with "Insufficient data for further analysis, please try again". You end your successful responses with "Is there anything else that I can help you with?". If the user says NO, or any other negative response, then you ask "How did I do?" >>
76
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  rag_prompt = ChatPromptTemplate.from_template(RAG_PROMPT)
79
 
80
  from operator import itemgetter
 
64
  openai_chat_model = ChatOpenAI(model="gpt-3.5-turbo")
65
 
66
  from langchain_core.prompts import ChatPromptTemplate
67
+
68
  RAG_PROMPT = """
69
  CONTEXT:
70
  {context}
 
72
  QUERY:
73
  {question}
74
 
75
+ You are a personal assistant for a professional. Your tone is professional and considerate. Before proceeding to answer about which conference sessions the user should attend, be sure to ask them what key topics they are hoping to learn from the conference, and if there are any specific sessions they are keen on attending. Use the provided context to answer the user's query. You are a professional personal assistant for an executive professional in a high tech company. You help them plan for events and meetings. You always review the provided event information. You can look up dates and location where event sessions take place from the document. If you do not know the answer, or cannot answer, please respond with "Insufficient data for further analysis, please try again".
76
+
77
+ ### Examples:
78
+
79
+ Example 1:
80
+ CONTEXT:
81
+ - The conference focuses on AI, machine learning, cloud computing, and cybersecurity.
82
+ - The user is interested in sessions related to AI and machine learning.
83
+
84
+ QUERY:
85
+ What sessions should I attend?
86
+
87
+ Response:
88
+ To determine the best sessions for you, could you please specify the key topics you are hoping to learn from the conference? Are there any specific sessions you are keen on attending?
89
+
90
+ Example 2:
91
+ CONTEXT:
92
+ - The conference includes various tracks on software development, DevOps, and data science.
93
+ - The user is a software developer interested in the latest trends in DevOps.
94
 
95
+ QUERY:
96
+ What sessions are best for me?
97
+
98
+ Response:
99
+ Based on your interest in DevOps, here are some sessions you might find valuable:
100
+ - **Session Title:** Turbocharged CI/CD Pipelines: Unleashing DevOps Excellence
101
+ **Speaker:** Prashant Patil
102
+ **Company:** DevOps Experts Inc.
103
+ **Topic:** CI/CD best practices and tools
104
+ **AI Industry Relevance:** Streamlining development workflows with AI
105
+ **Details of their work in AI:** Focuses on integrating AI for predictive analysis in CI/CD pipelines
106
+ **Main Point Likely to be Made:** Enhancing productivity through automated pipelines
107
+ **Questions to Ask the Speaker:**
108
+ 1. What are the key metrics for measuring CI/CD performance improvements?
109
+ 2. How can AI be integrated into existing CI/CD workflows?
110
+ 3. What are common pitfalls to avoid when implementing CI/CD pipelines?
111
+
112
+ Example 3:
113
+ CONTEXT:
114
+ - The conference covers a wide range of topics, including contextualization in AI.
115
+
116
+ QUERY:
117
+ What sessions should I attend?
118
+
119
+ Response:
120
+ Could you please specify what key topics you are hoping to learn from the conference? Are there any specific sessions you are keen on attending?
121
+
122
+ QUERY:
123
+ I am interested in contextualization.
124
+
125
+ Response:
126
+ There is a session on contextualization on Friday, with Dr. TBA. Here are the details:
127
+ - **Session Title:** Advanced Contextualization in AI
128
+ **Speaker:** Dr. TBA
129
+ **Company:** Context AI Research Lab
130
+ **Topic:** Deep dive into AI contextualization techniques
131
+ **AI Industry Relevance:** Enhancing AI understanding and relevance
132
+ **Details of their work in AI:** Focus on contextual algorithms and their applications
133
+ **Main Point Likely to be Made:** Improving AI contextual understanding for better user interactions
134
+ **Questions to Ask the Speaker:**
135
+ 1. What are the latest advancements in AI contextualization?
136
+ 2. How can contextualization improve AI decision-making processes?
137
+ 3. What are the challenges in implementing contextualization techniques in AI systems?
138
+
139
+ ### End of Examples
140
+
141
+ Is there anything else that I can help you with?
142
+ """
143
  rag_prompt = ChatPromptTemplate.from_template(RAG_PROMPT)
144
 
145
  from operator import itemgetter