Skip to content

SQL Agent - Langgraph - python #130369

Discussion options

You must be logged in to vote

Hi Alessio,

Thanks for your patience. Here's a revised version of your code. I've removed the tool_choice parameter to avoid the unknown enum label "any" error. Additionally, I included proper BigQuery query execution and error handling within the db_query_tool function.

Please replace the placeholder in db_query_tool with actual BigQuery execution logic and ensure that the API key provided has the necessary permissions to access BigQuery and execute queries.
`from langchain_google_genai import ChatGoogleGenerativeAI
from langchain_core.prompts import ChatPromptTemplate
import os
import getpass
from langchain_core.tools import tool
from google.cloud import bigquery
from google.api_core.ex…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CodeCandyCelvin
Comment options

Answer selected by MatrixChess
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants