Replies: 1 comment
-
@jvmani Hi there! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am able to connect to SQL server database via langchain.
But the output from prompt gives only objects in dbo schema.
I granted permission to the user as well and tried connecting to "sa" user. I still get the same results only from dbo schema.
I am also using ChatPromptTemplate.
Am I missing something or is there a limitation. Please advice.
os.environ["OPENAI_API_TYPE"]="azure"
os.environ["OPENAI_API_VERSION"]="2023-05-15"
os.environ["AZURE_ENDPOINT"] = "https://xxxxxxx.openai.azure.com
os.environ["OPENAI_API_KEY"]="xxxxxxxxxxxxxx"
os.environ["OPENAI_CHAT_MODEL"]="gpt-35-turbo-16k"
driver = '{SQL Server Native Client 11.0}'
odbc_str = 'mssql+pyodbc:///?odbc_connect='
'Driver='+driver+
';Server=tcp:' + os.getenv("SQL_SERVER")+';PORT=1433' +
';DATABASE=' + os.getenv("SQL_DB") +
';Uid=' + os.getenv("SQL_USERNAME")+
';Pwd=' + os.getenv("SQL_PWD") +
';Encrypt=yes;TrustServerCertificate=yes;Connection Timeout=30;'
Beta Was this translation helpful? Give feedback.
All reactions