Spaces:
Sleeping
Sleeping
wiki
Browse files
app.py
CHANGED
@@ -259,6 +259,7 @@ def respond_to_input(user_input: str) -> str:
|
|
259 |
system_msg = SystemMessage(
|
260 |
content=(
|
261 |
"You are an agent that picks exactly one course of action:\n"
|
|
|
262 |
" 1) If the user's question is best answered by looking up a Wikipedia summary, return\n"
|
263 |
" {\"wiki_query\":\"<query for Wikipedia>\"} and nothing else.\n"
|
264 |
" 2) Otherwise, if Wikipedia won't directly help, but you still need web results, return\n"
|
|
|
259 |
system_msg = SystemMessage(
|
260 |
content=(
|
261 |
"You are an agent that picks exactly one course of action:\n"
|
262 |
+
"Use Wikipedia first before even using web search Please. "
|
263 |
" 1) If the user's question is best answered by looking up a Wikipedia summary, return\n"
|
264 |
" {\"wiki_query\":\"<query for Wikipedia>\"} and nothing else.\n"
|
265 |
" 2) Otherwise, if Wikipedia won't directly help, but you still need web results, return\n"
|
tools.py
CHANGED
@@ -205,6 +205,7 @@ def wikipedia_search_tool(state: AgentState) -> AgentState:
|
|
205 |
}
|
206 |
If no valid wiki_query is provided, returns {}.
|
207 |
"""
|
|
|
208 |
query = state.get("wiki_query", "").strip()
|
209 |
if not query:
|
210 |
return {}
|
|
|
205 |
}
|
206 |
If no valid wiki_query is provided, returns {}.
|
207 |
"""
|
208 |
+
print("reached wikipedia search tool")
|
209 |
query = state.get("wiki_query", "").strip()
|
210 |
if not query:
|
211 |
return {}
|