SillyTavern / SillyTavern

LLM Frontend for Power Users.

Home Page:https://sillytavern.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE_REQUEST] Help with Websearch follow up questions

iChristGit opened this issue · comments

Have you searched for similar requests?

Yes

Is your feature request related to a problem? If so, please describe.

/if left={{input}} right="" rule=eq "/echo severity=warning Empty search input. Please type a message first. \| /abort" | /setvar key=userInput {{input}} | /send {{getvar::userInput}} | /echo Processing user input... | /genraw instruct=off stop=["\nQuestion:","\n"] lock=on You are tasked with generating web search queries. Give me an appropriate query to answer my question for google search. Answer with only the query. Today is {{date}}.{{newline}}{{newline}}Question:{{newline}}Who is the president of France?{{newline}}Answer:{{newline}}president of france{{newline}}{{newline}}Question:{{newline}}What type of printhead does the Epson F2270 DTG printer use?{{newline}}Answer:{{newline}}Epson F2270 DTG printer printhead{{newline}}{{newline}}Question:{{newline}}What is the current weather in Paris?{{newline}}Answer:{{newline}}weather in Paris {{date}}{{newline}}{{newline}}Question: {{getvar::userInput}}{{newline}}Answer: | /setvar key=processedInput | /echo Performing web search... | /websearch links=off snippets=on {{getvar::processedInput}} | /setvar key=searchResult | /inject id=webSearchResults position=chat depth=1 ***{{newline}}Web search results for "{{getvar::processedInput}}":{{newline}}{{getvar::searchResult}}{{newline}}*** | /echo Sending message and results to AI... | /trigger | /flushvar userInput | /flushvar processedInput | /flushvar searchResult 

I use the above script created by ST devs, with the websearch extension (not extras), and It searches the web to give a more coherent answer, the issue I am facing is that on follow up questions, it mixes the subject.

For example I can ask a question about a person, then in the follow up question il ask "how old is he" and it will search for "Lionel Messi age" or other random celebrity instead of staying on topic with the correct person.

Anyone know how can the script be adjusted to also account for follow up questions?

Thanks!

Describe the solution you'd like

An improvemnt to the script, should be easy enough

Describe alternatives you've considered

No response

Additional context

No response

Priority

Medium (Would be very useful)

Are you willing to test this on staging/unstable branch if this is implemented?

Yes

Extension documentation details on this exact topic:
https://docs.sillytavern.app/extras/extensions/websearch/#search-activation

To exclude a specific message from processing, it must start with a period, e.g. .What do you think?.

You can add a similar logic to the STscript to skip messages on certain conditions without triggering the search.

Alternatively, if you disable the search trigger on keywords, it will never search on user input unless you use a QR script.

You can add a similar logic to the STscript to skip messages on certain conditions without triggering the search.

Alternatively, if you disable the search trigger on keywords, it will never search on user input unless you use a QR script.

Thanks for the reply, I meant something else.
I do a normal search for a subject, get results.
I want the bot to do a new search to gather new information about specifics, so I just ask "how old is he?" for example, and press the script button to run the search function, but It won't remember the topic (who am I referring to)
If I just want more information without any more searches added to context I don't press the script button, so its not an issue with search trigger.

@Cohee1207 Any idea about it? If that is something that can be done via a script

Web search is dumb, it doesn't have a context of your conversions. Queries for follow-up questions like these need to be done with LLM calls, no doubt. So it should be another script but that has access to the chat history (/gen command).

Web search is dumb, it doesn't have a context of your conversions. Queries for follow-up questions like these need to be done with LLM calls, no doubt. So it should be another script but that has access to the chat history (/gen command).

Oh okay, how can A script like that be created? one that would be used to search the web and also understand what to search for based on past massage?
I tried to mess around with it, but its really complex for me