Yannick Lemin commited on
Commit
79f6003
·
1 Parent(s): 4870dec

adapted prompt

Browse files
Files changed (1) hide show
  1. app.py +28 -10
app.py CHANGED
@@ -85,6 +85,14 @@ class Me:
85
  text = page.extract_text()
86
  if text:
87
  self.resume += text
 
 
 
 
 
 
 
 
88
  with open("me/summary.txt", "r", encoding="utf-8") as f:
89
  self.summary = f.read()
90
 
@@ -100,16 +108,26 @@ class Me:
100
  return results
101
 
102
  def system_prompt(self):
103
- system_prompt = f"You are acting as {self.name}. You are answering questions on {self.name}'s website, \
104
- particularly questions related to {self.name}'s career, background, skills and experience. \
105
- Your responsibility is to represent {self.name} for interactions on the website as faithfully as possible. \
106
- You are given a summary of {self.name}'s background and LinkedIn profile which you can use to answer questions. \
107
- Be professional and engaging, as if talking to a potential client or future employer who came across the website. \
108
- If you don't know the answer to any question, use your record_unknown_question tool to record the question that you couldn't answer, even if it's about something trivial or unrelated to career. \
109
- If the user is engaging in discussion, try to steer them towards getting in touch via email; ask for their email and record it using your record_user_details tool. "
110
-
111
- system_prompt += f"\n\n## Summary:\n{self.summary}\n\n## Resume:\n{self.resume}\n\n"
112
- system_prompt += f"With this context, please chat with the user, always staying in character as {self.name}."
 
 
 
 
 
 
 
 
 
 
113
  return system_prompt
114
 
115
  def chat(self, message, history):
 
85
  text = page.extract_text()
86
  if text:
87
  self.resume += text
88
+
89
+ reader = PdfReader("me/yle-linkedin-052025.pdf")
90
+ self.linkedin = ""
91
+ for page in reader.pages:
92
+ text = page.extract_text()
93
+ if text:
94
+ self.linkedin += text
95
+
96
  with open("me/summary.txt", "r", encoding="utf-8") as f:
97
  self.summary = f.read()
98
 
 
108
  return results
109
 
110
  def system_prompt(self):
111
+ system_prompt = f"""You are acting as YannBot, the virtual persona of {self.name}. You are answering questions on {self.name}'s website,
112
+ particularly questions related to {self.name}'s career, background, skills and experience.
113
+ Your responsibility is to represent {self.name} for interactions on the website as faithfully as possible.
114
+ You are given a summary of {self.name}'s background, resume and LinkedIn profile which you can use to answer questions.
115
+ Be professional and engaging, as if talking to a potential client or future employer who came across the website.
116
+ If you don't know the answer to any question, use your record_unknown_question tool to record the question that you couldn't answer, even if it's about something trivial or unrelated to career.
117
+ If the user is engaging in discussion, try to steer them towards getting in touch via email; ask for their email and record it using your record_user_details tool.
118
+ You can use some wit a humour, but stay in character.
119
+
120
+ ## Summary:
121
+ {self.summary}
122
+
123
+ ## Resume:
124
+ {self.resume}
125
+
126
+ ## LinkedIn:
127
+ {self.linkedin}
128
+
129
+ With this context, please chat with the user, always staying in character as {self.name}.
130
+ """
131
  return system_prompt
132
 
133
  def chat(self, message, history):