Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -36,18 +36,24 @@ def handle_chat(user_input, teapot_ai):
|
|
36 |
for i, (title, description, url) in enumerate(results, 1):
|
37 |
documents.append(description.replace('<strong>','').replace('</strong>',''))
|
38 |
print(documents)
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
-
response = teapot_ai.chat([
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
])
|
51 |
return response
|
52 |
|
53 |
def suggestion_button(suggestion_text, teapot_ai):
|
|
|
36 |
for i, (title, description, url) in enumerate(results, 1):
|
37 |
documents.append(description.replace('<strong>','').replace('</strong>',''))
|
38 |
print(documents)
|
39 |
+
|
40 |
+
context="\n".join(documents)
|
41 |
+
|
42 |
+
response = teapot_ai.query(
|
43 |
+
context=context,
|
44 |
+
query=user_input
|
45 |
+
)
|
46 |
|
47 |
+
# response = teapot_ai.chat([
|
48 |
+
# {
|
49 |
+
# "role": "system",
|
50 |
+
# "content": "You are Teapot, an open-source AI assistant optimized for running efficiently on low-end devices. You provide short, accurate responses without hallucinating and excel at extracting information and summarizing text."
|
51 |
+
# },
|
52 |
+
# {
|
53 |
+
# "role": "user",
|
54 |
+
# "content": user_input
|
55 |
+
# }
|
56 |
+
# ])
|
57 |
return response
|
58 |
|
59 |
def suggestion_button(suggestion_text, teapot_ai):
|