Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ChatOpenAI from deprecated version of LangChain langchain.chat_model not from langchain_openai #284

Open
moneebullah25 opened this issue May 15, 2024 · 0 comments

Comments

@moneebullah25
Copy link

https://github.com/aurelio-labs/semantic-router/blob/main/docs/03-basic-langchain-agent.ipynb

In the above notebook, there is small bug where we are importing ChatOpenAI class from deprecated version of LangChain langchain.chat_model not from langchain_openai.

Had to change:

from langchain.agents import AgentType, initialize_agent
from langchain.chat_models import ChatOpenAI
from langchain.memory import ConversationBufferWindowMemory

llm = ChatOpenAI(model="gpt-3.5-turbo-1106")

To

from langchain.agents import AgentType, initialize_agent
from langchain_openai import ChatOpenAI
from langchain.memory import ConversationBufferWindowMemory

llm = ChatOpenAI(model="gpt-3.5-turbo-1106")
moneebullah25 added a commit to moneebullah25/semantic-router that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant