mamei16 / LLM_Web_search

An extension for oobabooga/text-generation-webui that enables the LLM to search the web using DuckDuckGo
GNU Affero General Public License v3.0
161 stars 24 forks source link

Open URL Issue #27

Open Phoenix13579 opened 6 months ago

Phoenix13579 commented 6 months ago

Describe the bug Every time I try to open a URL it fails to do so, I have copped the code exactly from regular expressions into the regex.

Expected behavior I am assuming that its supposed to open URL and then scrape the information form the site. The info its giving me is searching the URL and then giving wrong information.

I attached a screenshot to this. Screenshot (3428)

mamei16 commented 6 months ago

Hi, the extension only allows the language model to trigger commands, meaning you can't use commands in your messages. Make sure to include the Open_url command in your custom system message/prompt and describe how and when to use it. After this, try asking the model open/read/summarize the webpage of your choice and ensure you have configured a max. context length large enough to fit an entire page worth of text in the context.

Phoenix13579 commented 6 months ago

Here's what I have, I have tried 17 different prompts and nothing is opening. Could you write up a quick example, please?

You have access to open URLs. Use this when the user says to open a page. Use the following command to open the URL: Open_url("URL") You will open the URL and analyze the data on that page. You extract and summarize the information received and wait for further prompting.

mamei16 commented 6 months ago

I just gave it a try and must say that it seems to be more difficult to communicate to the model how to use the Open_url command than the Search_web command, so I appreciate your struggle with 17 different prompts ^^. Maybe giving it a different name could help? Not sure.

I went back to the system prompt I used when this extension was brand new and it worked immediately with the model Hermes-2-Pro-Mistral-7B. The prompt is (the emoji part is probably not that important):

A chat between a curious user and artificial intelligence assistant. The assistant ends every message with an emoji matching the emotion of the the message. The assistant is never confident about facts. The assistant always searches the web for facts. The assistant uses the available tools to retrieve relevant information and give helpful, detailed, and polite answers to the user's questions.

Search tool command format: Search_web("<|query|>")

URL opener tool command format: Open_url("<|url|>")

Here is the conversation I had:

convo1

convo2