Langchain SQL agent with Azure OpenAI fails on invoke method returning Internal server error 500 #24488
Replies: 3 comments 5 replies
-
Hey there, @abhinabsarkar! I'm here to help you with your coding issues and questions. Let's work together to tackle this bug and find a solution. To resolve the Internal Server Error (500) when invoking the LangChain SQL agent with Azure OpenAI, ensure that you have correctly configured the environment variables and the deployment name. Here is a checklist and example code to help you verify your setup:
If the error persists, double-check the Azure portal to ensure that your deployment is active and that the API key is valid. Additionally, verify that the endpoint URL is correct and that there are no network issues preventing access to the Azure OpenAI service. Also, ensure that the |
Beta Was this translation helpful? Give feedback.
-
@dosu as I confirmed in the original post that the environment variables are set & I can interact with DB & LLM using Langchain. The code fails for the create_sql_agent when trying to use the executor. It doesn't give me any specific error message on why it fails other than error code 500. |
Beta Was this translation helpful? Give feedback.
-
Can anyone advise what is that I am missing here? |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
System Info
Langchain version
langchain==0.2.10
langchain-community==0.2.9
langchain-core==0.2.22
langchain-openai==0.1.16
langchain-text-splitters==0.2.2
Platform
WSL 2 running on Ubuntu in Windows 11
Python version
Python 3.8.10
Beta Was this translation helpful? Give feedback.
All reactions