llamabot
llamabot copied to clipboard
QueryBot: Text retrieval is incomplete
Some responses from QueryBot
sound like it hasn't retrieved all the relevant chunks for answering the prompt.
According to debugging, it retrieved only 4 RetrievedMessage
instances instead of the configured 20.
Test Case: What is the relation between the classes SimpleBot, ChatBot, and QueryBot?
Steps to reproduce:
- Create the
QueryBot
instance.
from llamabot import QueryBot
from pathlib import Path
bot = QueryBot(
system_prompt="You are an expert Python developer explaining the llamabot repository to an expert Python dev, who isn't familiar with the codebase.",
collection_name="llamabot_bot_classes",
document_paths=[
Path("/home/user/llamabot/llamabot/bot/simplebot.py"),
Path("/home/user/llamabot/llamabot/bot/chatbot.py"),
Path("/home/user/llamabot/llamabot/bot/querybot.py"),
],
model_name="ollama/mistral"
) # This creates a new embedding
- Ask a question about the relationship between the
Bot
classes.
q1 = """
What is the relation between the classes SimpleBot, ChatBot, and QueryBot?
"""
r1 = bot(q1)
r1
The responses in 2 test runs both sounded like QueryBot
didn't retrieve some relevant parts of the text:
- Response 1: "
SimpleBot
is not explicitly defined in this code snippet," - Response 2: "Although there are no classes named ChatBot or QueryBot in this code snippet,"