Scott Cogan
commited on
Commit
·
7ec0166
1
Parent(s):
96ca77e
langchain versions
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ from typing import IO, Dict
|
|
| 9 |
from io import BytesIO
|
| 10 |
from langchain_core.messages import HumanMessage, SystemMessage
|
| 11 |
from langgraph.graph import StateGraph
|
| 12 |
-
from langgraph.prebuilt import tools_condition
|
| 13 |
from langgraph.prebuilt import ToolNode
|
| 14 |
import base64
|
| 15 |
from google.ai.generativelanguage_v1beta.types import Tool as GenAITool
|
|
@@ -206,12 +205,7 @@ class BasicAgent:
|
|
| 206 |
|
| 207 |
# Define edges: these determine how the control flow moves
|
| 208 |
self.builder.add_edge("start", "assistant")
|
| 209 |
-
self.builder.
|
| 210 |
-
"assistant",
|
| 211 |
-
# If the latest message (result) from assistant is a tool call -> tools_condition routes to tools
|
| 212 |
-
# If the latest message (result) from assistant is a not a tool call -> tools_condition routes to END
|
| 213 |
-
tools_condition,
|
| 214 |
-
)
|
| 215 |
self.builder.add_edge("tools", "assistant")
|
| 216 |
self.react_graph = self.builder.compile()
|
| 217 |
|
|
|
|
| 9 |
from io import BytesIO
|
| 10 |
from langchain_core.messages import HumanMessage, SystemMessage
|
| 11 |
from langgraph.graph import StateGraph
|
|
|
|
| 12 |
from langgraph.prebuilt import ToolNode
|
| 13 |
import base64
|
| 14 |
from google.ai.generativelanguage_v1beta.types import Tool as GenAITool
|
|
|
|
| 205 |
|
| 206 |
# Define edges: these determine how the control flow moves
|
| 207 |
self.builder.add_edge("start", "assistant")
|
| 208 |
+
self.builder.add_edge("assistant", "tools")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
self.builder.add_edge("tools", "assistant")
|
| 210 |
self.react_graph = self.builder.compile()
|
| 211 |
|