From 10bba8e46a7e165a65be8fa110488b3d2aba3761 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Fri, 6 Dec 2024 14:16:15 +0000 Subject: [PATCH] Improve the chat input box (#23) * create an improved chatbox item with widgets * cleanup examples and example_card for use in chatbox_and_widget * hide chatbox on the home page * simplify the landing page with chat_box_and_widget * enhance ChatBoxAndWidget with search validation and additional text * allow overriding tools slot in chat_box_and_widget --- api/src/utils/chat_utils.py | 16 ++-- .../components/AutoDetectedCategory.svelte | 4 +- .../lib/components/ChatBoxAndWidget.svelte | 93 +++++++++++++++++++ app/src/lib/components/ChatContainer.svelte | 26 +++--- .../lib/components/ChatListActionItems.svelte | 2 +- app/src/lib/components/ExampleCard.svelte | 2 +- app/src/lib/components/RenderExamples.svelte | 28 +++--- app/src/routes/+page.svelte | 40 ++++---- 8 files changed, 153 insertions(+), 58 deletions(-) create mode 100644 app/src/lib/components/ChatBoxAndWidget.svelte diff --git a/api/src/utils/chat_utils.py b/api/src/utils/chat_utils.py index a7ca350..b3bf592 100644 --- a/api/src/utils/chat_utils.py +++ b/api/src/utils/chat_utils.py @@ -26,14 +26,14 @@ ] content_examples: Dict[ContentCategory, str] = { - "podcast": "Create a podcast exploring the intersection of ancient philosophy and artificial intelligence.", - "sermon": "Write a sermon connecting the teachings of Augustine with modern digital ethics.", - "audiodrama": "A reimagining of Homer's Odyssey set in a cyberpunk future.", - "lecture": "A lecture comparing Shakespeare's influence on modern social media communication.", - "commentary": "A commentary on how Classical music influences contemporary electronic genres.", - "voicenote": "A personal reflection on reading Plato's Republic in today's political climate.", - "interview": "An interview with an archaeologist using AI to uncover ancient Roman artifacts.", - "soundbite": "A quick take on how ancient Greek democracy shapes modern blockchain governance.", + "podcast": "Podcast exploring the intersection of ancient philosophy and AI", + "sermon": "Sermon connecting the teachings of Augustine with modern digital ethics", + "audiodrama": "Reimagining of Homer's Odyssey set in a cyberpunk future", + "lecture": "Lecture comparing Shakespeare's influence on modern social media", + "commentary": "Commentary on how Classical music influences contemporary electronic genres", + "voicenote": "Personal reflection on reading Plato's Republic in today's political climate", + "interview": "Interview with an archaeologist using AI to uncover ancient Roman artifacts", + "soundbite": "Quick take on how ancient Greek democracy shapes modern blockchain governance", } category_qualifiers: Dict[ContentCategory, str] = { diff --git a/app/src/lib/components/AutoDetectedCategory.svelte b/app/src/lib/components/AutoDetectedCategory.svelte index fdd899a..0f06f66 100644 --- a/app/src/lib/components/AutoDetectedCategory.svelte +++ b/app/src/lib/components/AutoDetectedCategory.svelte @@ -28,7 +28,7 @@ - + diff --git a/app/src/lib/components/ChatBoxAndWidget.svelte b/app/src/lib/components/ChatBoxAndWidget.svelte new file mode 100644 index 0000000..a55f936 --- /dev/null +++ b/app/src/lib/components/ChatBoxAndWidget.svelte @@ -0,0 +1,93 @@ + + + + +
+
+
+

What can I help with?

+

Listen to anything, anytime

+
+ + +
+
+