diff --git a/docs/applicable_recipes.md b/docs/applicable_recipes.md
index 1ee4710..3888be0 100644
--- a/docs/applicable_recipes.md
+++ b/docs/applicable_recipes.md
@@ -146,6 +146,7 @@ We use [OpenAI *Function Calling*](https://platform.openai.com/docs/guides/funct
We use [OpenAI *Function Calling*](https://platform.openai.com/docs/guides/function-calling) and
[hvPlot](https://hvplot.holoviz.org/) to create an **advanced chatbot** that can create plots.
"""
+
import json
from pathlib import Path
diff --git a/docs/assets/thumbnails/llama_cpp_python.png b/docs/assets/thumbnails/llama_cpp_python.png
new file mode 100644
index 0000000..178fcb8
Binary files /dev/null and b/docs/assets/thumbnails/llama_cpp_python.png differ
diff --git a/docs/assets/thumbnails/llama_index.mp4 b/docs/assets/thumbnails/llama_index.mp4
new file mode 100644
index 0000000..7dc1182
Binary files /dev/null and b/docs/assets/thumbnails/llama_index.mp4 differ
diff --git a/docs/assets/thumbnails/llama_index.png b/docs/assets/thumbnails/llama_index.png
new file mode 100644
index 0000000..178fcb8
Binary files /dev/null and b/docs/assets/thumbnails/llama_index.png differ
diff --git a/docs/assets/videos/llama_cpp_python.mp4 b/docs/assets/videos/llama_cpp_python.mp4
new file mode 100644
index 0000000..7dc1182
Binary files /dev/null and b/docs/assets/videos/llama_cpp_python.mp4 differ
diff --git a/docs/assets/videos/llama_index.mp4 b/docs/assets/videos/llama_index.mp4
new file mode 100644
index 0000000..7dc1182
Binary files /dev/null and b/docs/assets/videos/llama_index.mp4 differ
diff --git a/docs/chat_features.md b/docs/chat_features.md
index be7a83b..7d901c3 100644
--- a/docs/chat_features.md
+++ b/docs/chat_features.md
@@ -95,7 +95,6 @@ Highlights:
without it, only one letter would be displayed at a time.
"""
-
from asyncio import sleep
import panel as pn
@@ -321,7 +320,7 @@ async def callback(contents: str, user: str, instance: pn.chat.ChatInterface):
instance.respond()
elif user == PERSON_2:
instance.send(
- f"Yup, I heard!",
+ "Yup, I heard!",
user=PERSON_3,
avatar="😆",
respond=False,
@@ -387,7 +386,10 @@ async def callback(contents: str, user: str, instance: pn.chat.ChatInterface):
# use send instead of stream/yield/return to keep the placeholder text
# while still sending a message; ensure respond=False to avoid a recursive loop
instance.send(
- "Let me flip the coin for you...", user="Game Master", avatar="🎲", respond=False
+ "Let me flip the coin for you...",
+ user="Game Master",
+ avatar="🎲",
+ respond=False,
)
await sleep(1)
@@ -405,7 +407,11 @@ async def callback(contents: str, user: str, instance: pn.chat.ChatInterface):
# equivalently, use a dict instead of a pn.chat.ChatMessage
yield {"object": f"Woohoo, {result}! You win!", "user": "Coin", "avatar": "🎲"}
else:
- yield {"object": f"Aw, got {result}. Try again!", "user": "Coin", "avatar": "🎲"}
+ yield {
+ "object": f"Aw, got {result}. Try again!",
+ "user": "Coin",
+ "avatar": "🎲",
+ }
chat_interface = pn.chat.ChatInterface(
@@ -457,6 +463,7 @@ Highlights:
- Set `show_*` parameters to `False` to hide the respective buttons.
- Use `message_params` to customize the appearance of each chat messages.
"""
+
import panel as pn
pn.extension()
diff --git a/docs/kickstart_snippets.md b/docs/kickstart_snippets.md
index 434b1ea..aa4fbdb 100644
--- a/docs/kickstart_snippets.md
+++ b/docs/kickstart_snippets.md
@@ -18,6 +18,14 @@ Highlights:
- Uses `serialize` to get chat history from the `ChatInterface`.
- Uses `yield` to continuously concatenate the parts of the response.
+
+
+
+
Source code for llama_cpp_python_.py
diff --git a/tests/test_all.py b/tests/test_all.py
index 08b4e52..eba10b5 100644
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -13,9 +13,11 @@ def test_app(app_path):
def test_has_thumbnail(app_path):
name = Path(app_path).name
- assert (THUMBNAILS_PATH / name.replace(".py", ".png")).exists()
+ assert (
+ THUMBNAILS_PATH / name.replace(".py", ".png").replace("_.png", ".png")
+ ).exists()
def test_has_video(app_path):
name = Path(app_path).name
- assert (VIDEOS_PATH / name.replace(".py", ".mp4")).exists()
+ assert (VIDEOS_PATH / name.replace(".py", ".mp4").replace("_.mp4", ".mp4")).exists()