Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -861,12 +861,14 @@ def chatbot_response(user_query):
|
|
861 |
desc = f"{i}. Title: {bm['title']}\n URL: {bm['url']}\n Category: {bm['category']}\n Summary: {bm['summary']}"
|
862 |
bookmark_descriptions.append(desc)
|
863 |
|
864 |
-
#
|
|
|
|
|
865 |
prompt = f"""
|
866 |
User Query: {user_query}
|
867 |
|
868 |
Relevant Bookmarks:
|
869 |
-
{
|
870 |
|
871 |
Please provide a helpful response that:
|
872 |
1. Identifies the most relevant bookmarks for the query
|
@@ -933,7 +935,7 @@ def build_app():
|
|
933 |
# Deleting Bookmarks
|
934 |
delete_button.click(
|
935 |
fn=delete_selected_bookmarks,
|
936 |
-
inputs=gr.CheckboxGroup(label="Select Bookmarks to Delete", choices=[
|
937 |
outputs=[process_message, gr.Dropdown.update(), bookmarks_display]
|
938 |
)
|
939 |
|
@@ -941,7 +943,7 @@ def build_app():
|
|
941 |
edit_button.click(
|
942 |
fn=edit_selected_bookmarks_category,
|
943 |
inputs=[
|
944 |
-
gr.CheckboxGroup(label="Select Bookmarks to Edit", choices=[
|
945 |
category_dropdown
|
946 |
],
|
947 |
outputs=[process_message, gr.Dropdown.update(), bookmarks_display]
|
|
|
861 |
desc = f"{i}. Title: {bm['title']}\n URL: {bm['url']}\n Category: {bm['category']}\n Summary: {bm['summary']}"
|
862 |
bookmark_descriptions.append(desc)
|
863 |
|
864 |
+
# Precompute the joined descriptions to avoid backslashes in f-string expressions
|
865 |
+
joined_bookmark_descriptions = '\\n\\n'.join(bookmark_descriptions)
|
866 |
+
|
867 |
prompt = f"""
|
868 |
User Query: {user_query}
|
869 |
|
870 |
Relevant Bookmarks:
|
871 |
+
{joined_bookmark_descriptions}
|
872 |
|
873 |
Please provide a helpful response that:
|
874 |
1. Identifies the most relevant bookmarks for the query
|
|
|
935 |
# Deleting Bookmarks
|
936 |
delete_button.click(
|
937 |
fn=delete_selected_bookmarks,
|
938 |
+
inputs=gr.CheckboxGroup(label="Select Bookmarks to Delete", choices=[]),
|
939 |
outputs=[process_message, gr.Dropdown.update(), bookmarks_display]
|
940 |
)
|
941 |
|
|
|
943 |
edit_button.click(
|
944 |
fn=edit_selected_bookmarks_category,
|
945 |
inputs=[
|
946 |
+
gr.CheckboxGroup(label="Select Bookmarks to Edit", choices=[]),
|
947 |
category_dropdown
|
948 |
],
|
949 |
outputs=[process_message, gr.Dropdown.update(), bookmarks_display]
|