Update rag_langgraph.py
Browse files- rag_langgraph.py +2 -3
rag_langgraph.py
CHANGED
@@ -2,7 +2,6 @@ from typing import Annotated, List, Tuple, Union
|
|
2 |
|
3 |
from langchain_community.tools.tavily_search import TavilySearchResults
|
4 |
from langchain_core.tools import tool
|
5 |
-
from langchain_experimental.tools import PythonREPLTool
|
6 |
|
7 |
from langchain.agents import AgentExecutor, create_openai_tools_agent
|
8 |
from langchain_core.messages import BaseMessage, HumanMessage
|
@@ -94,10 +93,10 @@ def create_graph(topic, word_count):
|
|
94 |
| JsonOutputFunctionsParser()
|
95 |
)
|
96 |
|
97 |
-
research_agent = create_agent(llm, [tavily_tool], "Research content on topic {topic}")
|
98 |
research_node = functools.partial(agent_node, agent=research_agent, name="Researcher")
|
99 |
|
100 |
-
blogger_agent = create_agent(llm, [], "Write a {word_count}-word blog post on topic {topic}")
|
101 |
blogger_node = functools.partial(agent_node, agent=blogger_agent, name="Blogger")
|
102 |
|
103 |
workflow = StateGraph(AgentState)
|
|
|
2 |
|
3 |
from langchain_community.tools.tavily_search import TavilySearchResults
|
4 |
from langchain_core.tools import tool
|
|
|
5 |
|
6 |
from langchain.agents import AgentExecutor, create_openai_tools_agent
|
7 |
from langchain_core.messages import BaseMessage, HumanMessage
|
|
|
93 |
| JsonOutputFunctionsParser()
|
94 |
)
|
95 |
|
96 |
+
research_agent = create_agent(llm, [tavily_tool], f"Research content on topic {topic}")
|
97 |
research_node = functools.partial(agent_node, agent=research_agent, name="Researcher")
|
98 |
|
99 |
+
blogger_agent = create_agent(llm, [], f"Write a {word_count}-word blog post on topic {topic}")
|
100 |
blogger_node = functools.partial(agent_node, agent=blogger_agent, name="Blogger")
|
101 |
|
102 |
workflow = StateGraph(AgentState)
|