SQL Agent for Google Big Query #17760
Replies: 2 comments 2 replies
-
🤖 Hey @hugoferrero! Great to see you back here, diving into the possibilities with LangChain and Google BigQuery. I hope all's been well on your side! Yes, it is indeed possible to create an SQL agent in the latest version of LangChain to query tables on Google BigQuery. The function To use Google BigQuery, you would need to create an instance of Here is an example of how you might do this: from langchain_openai import ChatOpenAI
from langchain_community.agent_toolkits import create_sql_agent
from langchain_community.utilities import SQLDatabase
# Connect to your Google BigQuery database
db = SQLDatabase.from_uri("bigquery://project_id")
# Create a language model
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
# Create the SQL agent
agent_executor = create_sql_agent(llm, db=db, agent_type="openai-tools", verbose=True) Please note that you would need to replace As for your question about the If you encounter any issues or need further clarification, please provide more details so I can assist you better. Sources
|
Beta Was this translation helpful? Give feedback.
-
I solved it by |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
Is it possible to create an sql agent to query tables on Google BigQuery with the latests versions of langchain?. It was possible with older versions.
System Info
a
Beta Was this translation helpful? Give feedback.
All reactions