You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to write a simple code in databricks using langchain. But it is throwing this error: Resource not
%pip install --upgrade openai
%pip install langchain --upgrade
%pip install pymssql --upgrade
%pip install SQLAlchemy
%pip install pyodbc
import os
from langchain.llms import AzureOpenAI
import openai
from langchain.agents import create_sql_agent
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
from langchain.sql_database import SQLDatabase
from langchain.llms.openai import OpenAI
from langchain.agents import AgentExecutor
import pymssql
from sqlalchemy.engine import URL
Configure OpenAI API
os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_KEY"] = "xxxxxxxx"
os.environ["OPENAI_API_BASE"] = "https://zxadw.openai.azure.com/"
os.environ["OPENAI_API_VERSION"] = "2022-12-01"
llm = AzureOpenAI(deployment_name="text-davinci-003", model_name="text-davinci-003")
db = SQLDatabase.from_uri("mssql+pymssql://sqladmin:Passw0rd@hostnameofazuresqldb:1433/AdventureWorks2017")
toolkit = SQLDatabaseToolkit(db=db, llm=llm ,use_query_checker=True, verbose=True, return_intermediate_steps=True )
agent_executor = create_sql_agent(
)
agent_executor.run("List the tables in the database")
But it throws this error:
Any clue!!
Regards
Rajaniesh
Beta Was this translation helpful? Give feedback.
All reactions