Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,9 +42,9 @@ llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash-latest")
|
|
| 42 |
|
| 43 |
@tool
|
| 44 |
def wikipedia_search(title: str) -> str:
|
| 45 |
-
"""Provides a short snippet from a Wikipedia article with the given
|
| 46 |
page = wikipedia.page(title)
|
| 47 |
-
return page.content[:
|
| 48 |
|
| 49 |
def agent_node(state: OrderState) -> OrderState:
|
| 50 |
"""agent with tool handling."""
|
|
@@ -124,7 +124,7 @@ llm_with_tools = llm.bind_tools(auto_tools + interactive_tools)
|
|
| 124 |
graph_builder = StateGraph(OrderState)
|
| 125 |
|
| 126 |
# Add nodes
|
| 127 |
-
graph_builder.add_node("
|
| 128 |
graph_builder.add_node("human", human_node)
|
| 129 |
graph_builder.add_node("tools", tool_node)
|
| 130 |
|
|
|
|
| 42 |
|
| 43 |
@tool
|
| 44 |
def wikipedia_search(title: str) -> str:
|
| 45 |
+
"""Provides a short snippet from a Wikipedia article with the given title"""
|
| 46 |
page = wikipedia.page(title)
|
| 47 |
+
return page.content[:300]
|
| 48 |
|
| 49 |
def agent_node(state: OrderState) -> OrderState:
|
| 50 |
"""agent with tool handling."""
|
|
|
|
| 124 |
graph_builder = StateGraph(OrderState)
|
| 125 |
|
| 126 |
# Add nodes
|
| 127 |
+
graph_builder.add_node("agent", agent_node)
|
| 128 |
graph_builder.add_node("human", human_node)
|
| 129 |
graph_builder.add_node("tools", tool_node)
|
| 130 |
|