LLocalSearch
LLocalSearch copied to clipboard
Modify system prompt to follow the language of the search query
First of all, thanks @nilsherzig for getting this wonderful project together!
When searching in other non English languages, LlocalSearch responds in English by default.
Prompt engineering in the search string doesn't work properly. Things like:
- Describe in Spanish topic 1, messes the topic 1 with how to describe something in spanish
- Topic 1 main ideas in Spanish, produces similar effects.
This happens as the search query is passed to the llm as the string to work upon, not the instructions to produce the output.
To fix this behavior, the language "selection" should be outside of search query. I suspect you have a base template for the system role. So, the way to fix this would be to add a sentence like: "Create your reply in the same language as the search string. When you are not able to determine the search string input, default to English."
Some additional variations could be crafted and tested to make sure that output is produced in the same language as input.
I am happy to support testing these changes