Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from langgraph.graph.message import add_messages
|
|
| 10 |
from langchain_hyperbrowser import HyperbrowserBrowserUseTool
|
| 11 |
from langgraph.graph import START, StateGraph
|
| 12 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 13 |
-
from langchain_core.messages import HumanMessage
|
| 14 |
|
| 15 |
browser_tool = HyperbrowserBrowserUseTool()
|
| 16 |
tools = [browser_tool]
|
|
@@ -23,7 +23,7 @@ class State(TypedDict):
|
|
| 23 |
messages = Annotated[list[AnyMessage], add_messages]
|
| 24 |
|
| 25 |
def assistant(state:State):
|
| 26 |
-
system_message = "You are a helpful assistant. Your job is to answer the questions asked of you as accurately as possible. You have access to a browser search tool, which you may use when needed to answer a question."
|
| 27 |
return {
|
| 28 |
"messages": [llm_with_tools.invoke([system_message] + state["messages"])]
|
| 29 |
}
|
|
|
|
| 10 |
from langchain_hyperbrowser import HyperbrowserBrowserUseTool
|
| 11 |
from langgraph.graph import START, StateGraph
|
| 12 |
from langgraph.prebuilt import ToolNode, tools_condition
|
| 13 |
+
from langchain_core.messages import HumanMessage, SystemMessage
|
| 14 |
|
| 15 |
browser_tool = HyperbrowserBrowserUseTool()
|
| 16 |
tools = [browser_tool]
|
|
|
|
| 23 |
messages = Annotated[list[AnyMessage], add_messages]
|
| 24 |
|
| 25 |
def assistant(state:State):
|
| 26 |
+
system_message = SystemMessage("You are a helpful assistant. Your job is to answer the questions asked of you as accurately as possible. You have access to a browser search tool, which you may use when needed to answer a question.")
|
| 27 |
return {
|
| 28 |
"messages": [llm_with_tools.invoke([system_message] + state["messages"])]
|
| 29 |
}
|