Karthik Raja
commited on
Commit
•
490ea32
1
Parent(s):
7acf180
update prompt
Browse files
app.py
CHANGED
@@ -14,13 +14,16 @@ def load_cv():
|
|
14 |
cv_text = load_cv()
|
15 |
|
16 |
def chat_with_ai(user_input):
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
response = openai.ChatCompletion.create(
|
19 |
model="gpt-3.5-turbo",
|
20 |
-
messages=
|
21 |
-
{"role": "user", "content": prompt}
|
22 |
-
]
|
23 |
)
|
|
|
24 |
return response.choices[0].message['content']
|
25 |
|
26 |
def main(user_input):
|
|
|
14 |
cv_text = load_cv()
|
15 |
|
16 |
def chat_with_ai(user_input):
|
17 |
+
messages = [
|
18 |
+
{"role": "system", "content": "You are a helpful assistant that can only answer questions about Karthik Raja"},
|
19 |
+
{"role": "user", "content": f"{cv_text}\n\nUser: {user_input}"}
|
20 |
+
]
|
21 |
+
|
22 |
response = openai.ChatCompletion.create(
|
23 |
model="gpt-3.5-turbo",
|
24 |
+
messages=messages
|
|
|
|
|
25 |
)
|
26 |
+
|
27 |
return response.choices[0].message['content']
|
28 |
|
29 |
def main(user_input):
|