Skip to content

Commit f9b30ce

Browse files
authored
Merge pull request #78 from PathOnAI/check-lats
Add Config(Lats)
2 parents 60b5223 + 644c882 commit f9b30ce

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

visual-tree-search-app/components/ControlPanelLATS.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface SearchParams {
99
goal: string;
1010
maxDepth: number;
1111
num_simulations: number;
12+
iterations: number;
1213
}
1314

1415
interface ControlPanelProps {
@@ -131,6 +132,19 @@ const ControlPanelLATS: React.FC<ControlPanelProps> = ({
131132
className="border-slate-300 dark:border-slate-600 focus:ring-cyan-500 focus:border-cyan-500"
132133
/>
133134
</div>
135+
136+
<div className="space-y-2">
137+
<Label htmlFor="iterations" className="text-slate-700 dark:text-slate-300 font-medium">Iterations</Label>
138+
<Input
139+
id="iterations"
140+
type="number"
141+
min={1}
142+
max={10}
143+
value={searchParams.iterations}
144+
onChange={(e) => handleParamChange('iterations', parseInt(e.target.value))}
145+
className="border-slate-300 dark:border-slate-600 focus:ring-cyan-500 focus:border-cyan-500"
146+
/>
147+
</div>
134148
</div>
135149
</div>
136150
)}

visual-tree-search-app/pages/LATSAgent.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface SearchParams {
1010
goal: string;
1111
maxDepth: number;
1212
num_simulations: number;
13+
iterations: number;
1314
}
1415

1516
interface Message {
@@ -31,7 +32,8 @@ const LATSAgent = () => {
3132
startingUrl: 'http://xwebarena.pathonai.org:7770/',
3233
goal: 'search running shoes, click on the first result',
3334
maxDepth: 3,
34-
num_simulations: 1
35+
num_simulations: 1,
36+
iterations: 1
3537
});
3638

3739
const [sessionId, setSessionId] = useState<string | null>(null);
@@ -103,6 +105,9 @@ const LATSAgent = () => {
103105
starting_url: searchParams.startingUrl,
104106
goal: searchParams.goal,
105107
search_algorithm: "lats",
108+
max_depth: searchParams.maxDepth,
109+
num_simulations: searchParams.num_simulations,
110+
iterations: searchParams.iterations
106111
};
107112

108113
wsRef.current?.send(JSON.stringify(request));

visual-tree-search-backend/app/api/lwats/agents_async/SearchAgents/lats_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def lats_search(self, websocket=None):
2727
for i in range(self.config.iterations):
2828
await self.websocket_iteration_start(i, websocket=websocket)
2929

30-
print(f"Iteration {i}...")
30+
print(f"Iteration {i}/{self.config.iterations} ...")
3131

3232
# Step 1: Node Selection
3333
## TODO: move websocket node selection into node_selection method

visual-tree-search-backend/app/api/routes/tree_search_websocket.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ async def handle_search_request(websocket: WebSocket, message: Dict[str, Any]):
7777
search_algorithm = message.get("search_algorithm", "bfs")
7878
max_depth = message.get("max_depth", 3)
7979
storage_state = message.get("storage_state", "app/api/shopping.json")
80+
iterations = message.get("iterations", 1) # Extract iterations parameter
81+
num_simulations=message.get("num_simulations", 1)
8082

8183
# Send status update
8284
await websocket.send_json({
@@ -91,7 +93,9 @@ async def handle_search_request(websocket: WebSocket, message: Dict[str, Any]):
9193
search_algorithm=search_algorithm,
9294
max_depth=max_depth,
9395
storage_state=storage_state,
94-
headless=False
96+
headless=False,
97+
iterations=iterations,
98+
num_simulations=num_simulations
9599
)
96100

97101
# Send status update

0 commit comments

Comments
 (0)