Update rag_langgraph.py
Browse files- rag_langgraph.py +4 -4
rag_langgraph.py
CHANGED
@@ -43,7 +43,7 @@ def agent_node(state, agent, name):
|
|
43 |
def create_graph(topic, word_count):
|
44 |
tavily_tool = TavilySearchResults(max_results=10)
|
45 |
|
46 |
-
members = ["
|
47 |
|
48 |
system_prompt = (
|
49 |
"You are a supervisor tasked with managing a conversation between the"
|
@@ -93,14 +93,14 @@ def create_graph(topic, word_count):
|
|
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, [tavily_tool], 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)
|
103 |
-
workflow.add_node("Researcher", research_node)
|
104 |
workflow.add_node("Blogger", blogger_node)
|
105 |
workflow.add_node("supervisor", supervisor_chain)
|
106 |
|
|
|
43 |
def create_graph(topic, word_count):
|
44 |
tavily_tool = TavilySearchResults(max_results=10)
|
45 |
|
46 |
+
members = ["Blogger"]
|
47 |
|
48 |
system_prompt = (
|
49 |
"You are a supervisor tasked with managing a conversation between the"
|
|
|
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, [tavily_tool], 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)
|
103 |
+
#workflow.add_node("Researcher", research_node)
|
104 |
workflow.add_node("Blogger", blogger_node)
|
105 |
workflow.add_node("supervisor", supervisor_chain)
|
106 |
|