Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Multilingual Support.
Added code which detects language from user questions and translates response in same language in order to get more deterministic language translation.
Language translation using prompt engineering was not giving concrete results. We also have query language which is default index/prompt language so we dont want to complicate prompt with many language parameters.
Used deep_translator python library for translation and used langdetect for language detection for user question and response translation.deep_translator allows to perform language detection, but it does not work out of the box. you have to register and get the api key so that is why I used langdetect.
with these approach it only sometimes misses translation but otherwise definitely an improvement over existing implementation. Translation is not 100% with LLM so this is acceptable.
SS below Albanian and French question/response while in bg prompt and index is in english