Update rag_langgraph.py
Browse files- rag_langgraph.py +5 -5
rag_langgraph.py
CHANGED
@@ -102,12 +102,8 @@ def create_graph(topic):
|
|
102 |
"4. At the end of the article, add a reference section with research papers.")
|
103 |
researcher_node = functools.partial(agent_node, agent=researcher_agent, name="Researcher")
|
104 |
|
105 |
-
#writer_agent = create_agent(llm, [today_tool], system_prompt=f"Write a 2000-word article on topic: {topic}. At the beginning, add current date and author: Multi-AI-Agent System based on GPT-4o. At the end, add a reference section with research papers.")
|
106 |
-
#writer_node = functools.partial(agent_node, agent=writer_agent, name="Writer")
|
107 |
-
|
108 |
workflow = StateGraph(AgentState)
|
109 |
workflow.add_node("Researcher", researcher_node)
|
110 |
-
#workflow.add_node("Writer", writer_node)
|
111 |
workflow.add_node("Manager", supervisor_chain)
|
112 |
|
113 |
for member in members:
|
@@ -128,4 +124,8 @@ def run_multi_agent(topic):
|
|
128 |
HumanMessage(content=topic)
|
129 |
]
|
130 |
})
|
131 |
-
|
|
|
|
|
|
|
|
|
|
102 |
"4. At the end of the article, add a reference section with research papers.")
|
103 |
researcher_node = functools.partial(agent_node, agent=researcher_agent, name="Researcher")
|
104 |
|
|
|
|
|
|
|
105 |
workflow = StateGraph(AgentState)
|
106 |
workflow.add_node("Researcher", researcher_node)
|
|
|
107 |
workflow.add_node("Manager", supervisor_chain)
|
108 |
|
109 |
for member in members:
|
|
|
124 |
HumanMessage(content=topic)
|
125 |
]
|
126 |
})
|
127 |
+
article = result['messages'][-1].content
|
128 |
+
print("###")
|
129 |
+
print(article)
|
130 |
+
print("###")
|
131 |
+
return article
|