Find answers from the community

Home
Members
Bonadio
B
Bonadio
Offline, last seen 3 months ago
Joined September 25, 2024
B
Bonadio
·

Context

Hi everybody,
First congrats, this is a fantastic project.

How can I customize the context_str variable?

My docs have a metadata with filename and page, when I send a query, the prompt
injects the context_str as

filename: contract2.txt\npage_number: 2\n\n< text >\n
filename: contract3.txt\npage_number: 3\n\n< text >\n

The problem is that the LLM sometimes get confused and don't answer correct, if I send the context as a string formatted as JSON it always works

{ context: [
{ content: "<text>", filename:"contract2.txt", page_number: 1 },
{ content: "<text>", filename:"contract3.txt", page_number: 3 }
]
}

Thanks for any help
3 comments
B
L