Open barbarian23 opened 2 months ago
This repository is currently optimized for RAG on documents with fairly unstructured queries, like the example ones. It looks like you are hoping to be able to ask very structured queries, with strict constraints like comparisons and numeric quantities. In that case, I think you'll want to use a different approach, such as:
1) Asking the LLM to generate Python code (like pandas code) and executing that. You'd need to be careful about executing arbitrary code however. 2) Asking the LLM to generate search queries with filters, and store that data in an Azure AI search index with additional fields or a database table with columns. You could even try storing in a local read-only SQLite database for small amounts of data. That's similar to option 1, generating pandas code, but more secure since you can limit how much a SQL query can do.
For both those options, you'd likely want to use OpenAI function calling, which we already use to some extent for query rewriting. I have more details on how to use function calling in this blog post: https://blog.pamelafox.org/2024/03/rag-techniques-using-function-calling.html
Hello, I would like to thank you for your suggestion. It help me to under stand more about LLM Could you help me to ask LLM to generate Python code (like pandas code) for me? I really need an example to follow
Thank you.
Hello, I would like to thank you for your suggestion. It help me to under stand more about LLM Could you help me to ask LLM to generate Python code (like pandas code) for me? I really need an example to follow
Thank you.
Dig into https://github.com/Sinaptik-AI/pandas-ai. It's one of the best Question-to-Py/Pandas solution out there. Specifically, it builds a local .log file of all the data + question -> llm <- return for you to see exactly what's happening.
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
I need ChatApp give answer correctly
OS and Version?
azd version?
Versions
Mention any other details that might be useful