andrewnguonly / Lumos

A RAG LLM co-pilot for browsing the web, powered by local LLMs
MIT License
1.42k stars 102 forks source link

Text templating each query selector #192

Open roskee opened 2 months ago

roskee commented 2 months ago

Can it be possible to customize the result of each query selector? For example, if I had 2 selectors for a question and its answer, I would like to label the resulting two contents as 'Question' and 'Answer'. That way the model knows they are two different context strings. Without this they are sent as one long text. My proposal is to make it possible to template the results as follows

Selector1 Result = 'How is your day?'

Selector2 Result = 'It was good'

template for Selector1 = 'Question: {{result}}\n'

template for Selector2 = 'Answer: {{result}}'

the final string going to the model will be

Question: How was your day?
Answer: It was good