Find answers from the community

Updated 3 months ago

Error

Hi Everyone, I need help resolving error while running this -

from llama_index import LLMPredictor, ServiceContext, SQLDatabase, VectorStoreIndex from llama_index.indices.struct_store import SQLTableRetrieverQueryEngine from llama_index.objects import SQLTableNodeMapping, ObjectIndex, SQLTableSchema from langchain import OpenAI

ERROR Message -
L
P
3 comments
I think this is a pydantic error in langchain?

Try pip install pydantic=1.10.12
Thanks @Logan M , it worked.

Additionally, I am trying to run text-to-sql on CSV data. I have gone through this blog which shows the methods/ code blocks to run text-sql on sql database. I was wondering if there is any existing functions to load CSV file and run text-to-sql on it.

I would greatly appreciate it if you could share any supporting materials or github code. Thanks.

Blog link - https://medium.com/dataherald/how-to-connect-llm-to-sql-database-with-llamaindex-fae0e54de97c
I think you'd have to put the csv into a sqlite db first. But that's a manual step for now
Add a reply
Sign up and join the conversation on Discord