Skip to content

Commit

Permalink
Replace deprecated openai imports from langchain and langchain_community
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Dec 14, 2024
1 parent 3e76cd5 commit 2de1593
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/llm/agents/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from langchain.agents import initialize_agent
from langchain.agents import load_tools
from langchain.agents.agent import AgentExecutor
from langchain.llms.openai import OpenAI
from langchain_openai import OpenAI

from morpheus.config import Config
from morpheus.pipeline.linear_pipeline import LinearPipeline
Expand Down
2 changes: 1 addition & 1 deletion tests/morpheus_llm/llm/nodes/test_langchain_agent_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
from langchain.agents import initialize_agent
from langchain.callbacks.manager import AsyncCallbackManagerForToolRun
from langchain.callbacks.manager import CallbackManagerForToolRun
from langchain_community.chat_models.openai import ChatOpenAI
from langchain_core.tools import BaseTool
from langchain_openai import ChatOpenAI
except ImportError:
pass

Expand Down
2 changes: 1 addition & 1 deletion tests/morpheus_llm/llm/test_agents_simple_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
from langchain.agents.tools import Tool
from langchain.schema import Generation
from langchain.schema import LLMResult
from langchain_community.llms import OpenAI # pylint: disable=no-name-in-module
from langchain_community.utilities import serpapi
from langchain_openai import OpenAI # pylint: disable=no-name-in-module
except ImportError:
pass

Expand Down

0 comments on commit 2de1593

Please sign in to comment.