Spaces:
Running
Running
add tool doc
Browse files- src/tools/scout_toolkit.py +27 -2
src/tools/scout_toolkit.py
CHANGED
|
@@ -83,9 +83,33 @@ class ScoutToolkit(Toolkit):
|
|
| 83 |
|
| 84 |
def search_and_offload(self, task_list_json: str) -> str:
|
| 85 |
"""
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
"""
|
| 88 |
try:
|
|
|
|
| 89 |
data = self._robust_parse_json(task_list_json)
|
| 90 |
tasks = data.get("tasks", [])
|
| 91 |
global_info = data.get("global_info", {})
|
|
@@ -108,8 +132,9 @@ class ScoutToolkit(Toolkit):
|
|
| 108 |
return lat, lng
|
| 109 |
|
| 110 |
start_loc = global_info.get("start_location")
|
| 111 |
-
|
| 112 |
|
|
|
|
| 113 |
if isinstance(start_loc, str):
|
| 114 |
logger.debug(f"🕵️ Scout: Resolving Start Location Name '{start_loc}'...")
|
| 115 |
try:
|
|
|
|
| 83 |
|
| 84 |
def search_and_offload(self, task_list_json: str) -> str:
|
| 85 |
"""
|
| 86 |
+
Performs a proximity search for POIs based on the provided tasks and global context, then offloads results to the DB.
|
| 87 |
+
|
| 88 |
+
CRITICAL: The input JSON **MUST** include the 'global_info' section containing 'start_location' (lat, lng) to ensure searches are performed nearby the user's starting point, not in a random location.
|
| 89 |
+
|
| 90 |
+
Args:
|
| 91 |
+
task_list_json (str): A JSON formatted string. The structure must be:
|
| 92 |
+
{
|
| 93 |
+
"global_info": {
|
| 94 |
+
"start_location": ...,
|
| 95 |
+
"departure_time": str,
|
| 96 |
+
...
|
| 97 |
+
},
|
| 98 |
+
"tasks": [
|
| 99 |
+
{
|
| 100 |
+
"task_id": int,
|
| 101 |
+
"location_hint": str, # e.g. "Post Office", "7-11"
|
| 102 |
+
"priority": str,
|
| 103 |
+
...
|
| 104 |
+
},
|
| 105 |
+
...
|
| 106 |
+
]
|
| 107 |
+
}
|
| 108 |
+
Returns:
|
| 109 |
+
str: A Ref_id of DB system.
|
| 110 |
"""
|
| 111 |
try:
|
| 112 |
+
print("task_list_json", task_list_json)
|
| 113 |
data = self._robust_parse_json(task_list_json)
|
| 114 |
tasks = data.get("tasks", [])
|
| 115 |
global_info = data.get("global_info", {})
|
|
|
|
| 132 |
return lat, lng
|
| 133 |
|
| 134 |
start_loc = global_info.get("start_location")
|
| 135 |
+
logger.info(f"🕵️ Scout: Start Location - {start_loc}")
|
| 136 |
|
| 137 |
+
anchor_point = None
|
| 138 |
if isinstance(start_loc, str):
|
| 139 |
logger.debug(f"🕵️ Scout: Resolving Start Location Name '{start_loc}'...")
|
| 140 |
try:
|