Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.86k stars 4k forks source link

handling csv files #305

Open MazenSiraj opened 1 year ago

MazenSiraj commented 1 year ago

did anyone used the rrr model in the ask a question mode to deal with csv file? if yes I am facing an issue that the code is passing a fixed value and am not so sure who to make it dynamic based on the input prompt as well as it needs a key field to retrieve data and I need it to be able to go through the whole csv file/s

Waro0N commented 1 year ago

You could use the langchain create_pandas_dataframe_agent or csv agent to talk to your CSV data.

MazenSiraj commented 1 year ago

@Waro0N I got you, but am wondering that the readretrieveread.py in line 87 is giving a static value "Employee1", so how can I change it to dynamic based on the input cuz if I searched on Employee2 as per the given example file it understands that the desired is Employee2 but the observation is fixed as per the static value Employee1. am just new to python so I can figure out how to manage it

@pablocastro for your kind explanation

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.

zhongshuai-cao commented 11 months ago

This idea holds potential, but it might require a fundamentally different approach. We would need to determine which CSV to retrieve, fetch that CSV file, pass it to the CSV agent, and then process the query. We might need to either devise a new strategy or enable GPT to determine the mode switch and render method for the CSV file in the AnalysisPanel. I've found that react-doc-viewer is effective for displaying CSVs.

My primary challenge lies in writing the agent asynchronously to align with the existing methodology in app.py.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.

AmyHei commented 1 month ago

does the csv file or structured data issue fix? I also need to read and retrival my table and answer questions like "what's the best region with the highest sale quaitity? " and give me results support table.

pamelafox commented 1 month ago

One approach is to call a service that can generate pandas code to answer questions like that, and run the analysis code in a sandboxed Python environment. That's now possible with dynamic sessions on Azure Container Apps. See this example from @anthonychu's Pycon talk: https://github.com/anthonychu/20240528-sessions-csv/blob/main/query-csv.ipynb