Nathan Brake commited on
Commit
cdd4ebc
·
unverified ·
1 Parent(s): cf3dfa0

Update to work with newer any-agent code (#51)

Browse files

* Update to work with newer any-agent code

* format

.gitignore CHANGED
@@ -168,4 +168,4 @@ cython_debug/
168
  .vscode/
169
 
170
  output
171
- traces
 
168
  .vscode/
169
 
170
  output
171
+ traces
examples/langchain_single_agent_vertical.yaml CHANGED
@@ -1,5 +1,5 @@
1
  location: Pontevedra
2
- date: 2025-04-02 12:00
3
  max_driving_hours: 2
4
 
5
  framework: langchain
@@ -13,4 +13,5 @@ main_agent:
13
  - "surf_spot_finder.tools.get_wave_forecast"
14
  - "surf_spot_finder.tools.get_wind_forecast"
15
  - "any_agent.tools.search_web"
 
16
  - "any_agent.tools.visit_webpage"
 
1
  location: Pontevedra
2
+ date: 2025-04-10 12:00
3
  max_driving_hours: 2
4
 
5
  framework: langchain
 
13
  - "surf_spot_finder.tools.get_wave_forecast"
14
  - "surf_spot_finder.tools.get_wind_forecast"
15
  - "any_agent.tools.search_web"
16
+ - "any_agent.tools.show_plan"
17
  - "any_agent.tools.visit_webpage"
examples/llama_index_single_agent_vertical.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ location: Pontevedra
2
+ date: 2025-04-10 12:00
3
+ max_driving_hours: 2
4
+
5
+ framework: llama_index
6
+
7
+ main_agent:
8
+ model_id: o3-mini
9
+ tools:
10
+ - "surf_spot_finder.tools.driving_hours_to_meters"
11
+ - "surf_spot_finder.tools.get_area_lat_lon"
12
+ - "surf_spot_finder.tools.get_surfing_spots"
13
+ - "surf_spot_finder.tools.get_wave_forecast"
14
+ - "surf_spot_finder.tools.get_wind_forecast"
15
+ - "any_agent.tools.search_web"
16
+ - "any_agent.tools.show_plan"
17
+ - "any_agent.tools.visit_webpage"
examples/openai_single_agent_user_confirmation.yaml CHANGED
@@ -1,6 +1,6 @@
1
 
2
  location: Pontevedra
3
- date: 2025-04-05 12:00
4
  max_driving_hours: 2
5
  input_prompt_template: |
6
  According to the forecast, what will be the best spot to surf around {LOCATION},
 
1
 
2
  location: Pontevedra
3
+ date: 2025-04-10 12:00
4
  max_driving_hours: 2
5
  input_prompt_template: |
6
  According to the forecast, what will be the best spot to surf around {LOCATION},
examples/openai_single_agent_vertical.yaml CHANGED
@@ -1,5 +1,5 @@
1
  location: Pontevedra
2
- date: 2025-04-02 12:00
3
  max_driving_hours: 2
4
 
5
  framework: openai
@@ -12,6 +12,6 @@ main_agent:
12
  - "surf_spot_finder.tools.get_surfing_spots"
13
  - "surf_spot_finder.tools.get_wave_forecast"
14
  - "surf_spot_finder.tools.get_wind_forecast"
15
- - "surf_spot_finder.tools.search_web"
16
- - "surf_spot_finder.tools.show_plan"
17
- - "surf_spot_finder.tools.visit_webpage"
 
1
  location: Pontevedra
2
+ date: 2025-04-10 12:00
3
  max_driving_hours: 2
4
 
5
  framework: openai
 
12
  - "surf_spot_finder.tools.get_surfing_spots"
13
  - "surf_spot_finder.tools.get_wave_forecast"
14
  - "surf_spot_finder.tools.get_wind_forecast"
15
+ - "any_agent.tools.search_web"
16
+ - "any_agent.tools.show_plan"
17
+ - "any_agent.tools.visit_webpage"
examples/smolagents_single_agent_vertical.yaml CHANGED
@@ -1,5 +1,5 @@
1
  location: Pontevedra
2
- date: 2025-04-02 12:00
3
  max_driving_hours: 2
4
 
5
  framework: smolagents
@@ -13,6 +13,7 @@ main_agent:
13
  - "surf_spot_finder.tools.get_wave_forecast"
14
  - "surf_spot_finder.tools.get_wind_forecast"
15
  - "any_agent.tools.search_web"
 
16
  - "any_agent.tools.visit_webpage"
17
  - "smolagents.PythonInterpreterTool"
18
  - "smolagents.FinalAnswerTool"
 
1
  location: Pontevedra
2
+ date: 2025-04-10 12:00
3
  max_driving_hours: 2
4
 
5
  framework: smolagents
 
13
  - "surf_spot_finder.tools.get_wave_forecast"
14
  - "surf_spot_finder.tools.get_wind_forecast"
15
  - "any_agent.tools.search_web"
16
+ - "any_agent.tools.show_plan"
17
  - "any_agent.tools.visit_webpage"
18
  - "smolagents.PythonInterpreterTool"
19
  - "smolagents.FinalAnswerTool"
notebooks/experiment/agent_configs/langchain-4o-mini.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ framework: langchain
3
+
4
+ main_agent:
5
+ model_id: openai/gpt-4o-mini
6
+ tools:
7
+ - "surf_spot_finder.tools.driving_hours_to_meters"
8
+ - "surf_spot_finder.tools.get_area_lat_lon"
9
+ - "surf_spot_finder.tools.get_surfing_spots"
10
+ - "surf_spot_finder.tools.get_wave_forecast"
11
+ - "surf_spot_finder.tools.get_wind_forecast"
12
+ - "any_agent.tools.send_console_message"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/langchain-4o.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ framework: langchain
3
+
4
+ main_agent:
5
+ model_id: openai/gpt-4o
6
+ tools:
7
+ - "surf_spot_finder.tools.driving_hours_to_meters"
8
+ - "surf_spot_finder.tools.get_area_lat_lon"
9
+ - "surf_spot_finder.tools.get_surfing_spots"
10
+ - "surf_spot_finder.tools.get_wave_forecast"
11
+ - "surf_spot_finder.tools.get_wind_forecast"
12
+ - "any_agent.tools.send_console_message"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/openai-4o-mini.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ framework: openai
3
+
4
+ main_agent:
5
+ model_id: gpt-4o-mini
6
+ tools:
7
+ - "surf_spot_finder.tools.driving_hours_to_meters"
8
+ - "surf_spot_finder.tools.get_area_lat_lon"
9
+ - "surf_spot_finder.tools.get_surfing_spots"
10
+ - "surf_spot_finder.tools.get_wave_forecast"
11
+ - "surf_spot_finder.tools.get_wind_forecast"
12
+ - "any_agent.tools.send_console_message"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/openai-4o.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ framework: openai
3
+
4
+ main_agent:
5
+ model_id: gpt-4o
6
+ tools:
7
+ - "surf_spot_finder.tools.driving_hours_to_meters"
8
+ - "surf_spot_finder.tools.get_area_lat_lon"
9
+ - "surf_spot_finder.tools.get_surfing_spots"
10
+ - "surf_spot_finder.tools.get_wave_forecast"
11
+ - "surf_spot_finder.tools.get_wind_forecast"
12
+ - "any_agent.tools.send_console_message"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/openai-o1.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ framework: openai
3
+
4
+ main_agent:
5
+ model_id: o1
6
+ tools:
7
+ - "surf_spot_finder.tools.driving_hours_to_meters"
8
+ - "surf_spot_finder.tools.get_area_lat_lon"
9
+ - "surf_spot_finder.tools.get_surfing_spots"
10
+ - "surf_spot_finder.tools.get_wave_forecast"
11
+ - "surf_spot_finder.tools.get_wind_forecast"
12
+ - "any_agent.tools.send_console_message"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/openai-o3-mini.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ framework: openai
3
+
4
+ main_agent:
5
+ model_id: o3-mini
6
+ tools:
7
+ - "surf_spot_finder.tools.driving_hours_to_meters"
8
+ - "surf_spot_finder.tools.get_area_lat_lon"
9
+ - "surf_spot_finder.tools.get_surfing_spots"
10
+ - "surf_spot_finder.tools.get_wave_forecast"
11
+ - "surf_spot_finder.tools.get_wind_forecast"
12
+ - "any_agent.tools.send_console_message"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/smolagents-4o-mini.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ framework: smolagents
2
+
3
+ main_agent:
4
+ model_id: openai/gpt-4o-mini
5
+ tools:
6
+ - "surf_spot_finder.tools.driving_hours_to_meters"
7
+ - "surf_spot_finder.tools.get_area_lat_lon"
8
+ - "surf_spot_finder.tools.get_surfing_spots"
9
+ - "surf_spot_finder.tools.get_wave_forecast"
10
+ - "surf_spot_finder.tools.get_wind_forecast"
11
+ - "any_agent.tools.send_console_message"
12
+ - "smolagents.FinalAnswerTool"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/smolagents-4o.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ framework: smolagents
2
+
3
+ main_agent:
4
+ model_id: openai/gpt-4o
5
+ tools:
6
+ - "surf_spot_finder.tools.driving_hours_to_meters"
7
+ - "surf_spot_finder.tools.get_area_lat_lon"
8
+ - "surf_spot_finder.tools.get_surfing_spots"
9
+ - "surf_spot_finder.tools.get_wave_forecast"
10
+ - "surf_spot_finder.tools.get_wind_forecast"
11
+ - "any_agent.tools.send_console_message"
12
+ - "smolagents.FinalAnswerTool"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/smolagents-o1.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ framework: smolagents
2
+
3
+ main_agent:
4
+ model_id: openai/o1
5
+ tools:
6
+ - "surf_spot_finder.tools.driving_hours_to_meters"
7
+ - "surf_spot_finder.tools.get_area_lat_lon"
8
+ - "surf_spot_finder.tools.get_surfing_spots"
9
+ - "surf_spot_finder.tools.get_wave_forecast"
10
+ - "surf_spot_finder.tools.get_wind_forecast"
11
+ - "any_agent.tools.send_console_message"
12
+ - "smolagents.FinalAnswerTool"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/smolagents-o3-mini.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ framework: smolagents
2
+
3
+ main_agent:
4
+ model_id: openai/o3-mini
5
+ tools:
6
+ - "surf_spot_finder.tools.driving_hours_to_meters"
7
+ - "surf_spot_finder.tools.get_area_lat_lon"
8
+ - "surf_spot_finder.tools.get_surfing_spots"
9
+ - "surf_spot_finder.tools.get_wave_forecast"
10
+ - "surf_spot_finder.tools.get_wind_forecast"
11
+ - "any_agent.tools.send_console_message"
12
+ - "smolagents.FinalAnswerTool"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/smolagents-ollama-llama3.1-8b-fp16.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ framework: smolagents
2
+
3
+ main_agent:
4
+ model_id: ollama/llama3.1:8b-instruct-fp16
5
+ tools:
6
+ - "surf_spot_finder.tools.driving_hours_to_meters"
7
+ - "surf_spot_finder.tools.get_area_lat_lon"
8
+ - "surf_spot_finder.tools.get_surfing_spots"
9
+ - "surf_spot_finder.tools.get_wave_forecast"
10
+ - "surf_spot_finder.tools.get_wind_forecast"
11
+ - "any_agent.tools.send_console_message"
12
+ - "smolagents.FinalAnswerTool"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/agent_configs/smolagents-ollama-llama3.1-8b-q4.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ framework: smolagents
2
+
3
+ main_agent:
4
+ model_id: ollama/llama3.1:latest
5
+ tools:
6
+ - "surf_spot_finder.tools.driving_hours_to_meters"
7
+ - "surf_spot_finder.tools.get_area_lat_lon"
8
+ - "surf_spot_finder.tools.get_surfing_spots"
9
+ - "surf_spot_finder.tools.get_wave_forecast"
10
+ - "surf_spot_finder.tools.get_wind_forecast"
11
+ - "any_agent.tools.send_console_message"
12
+ - "smolagents.FinalAnswerTool"
13
+ - command: "docker"
14
+ args:
15
+ - "run"
16
+ - "-i"
17
+ - "--rm"
18
+ - "--mount"
19
+ - "type=bind,src=/tmp/surf-spot-finder,dst=/projects"
20
+ - "mcp/filesystem"
21
+ - "/projects"
22
+ tools:
23
+ - "read_file"
24
+ - "write_file"
25
+ - "directory_tree"
26
+ - "list_allowed_directories"
notebooks/experiment/compare.ipynb ADDED
@@ -0,0 +1,772 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "Which Agent is Best?"
8
+ ]
9
+ },
10
+ {
11
+ "cell_type": "code",
12
+ "execution_count": null,
13
+ "metadata": {},
14
+ "outputs": [],
15
+ "source": [
16
+ "import os\n",
17
+ "from surf_spot_finder.utils.logging import get_logger\n",
18
+ "import pandas as pd\n",
19
+ "\n",
20
+ "logger = get_logger()\n",
21
+ "\n",
22
+ "\n",
23
+ "def load_results():\n",
24
+ " results_path = \"./results.json\"\n",
25
+ " if not os.path.exists(results_path):\n",
26
+ " logger.info(\"No results found, skipping loading.\")\n",
27
+ " return pd.DataFrame()\n",
28
+ " df = pd.read_json(results_path, lines=True)\n",
29
+ " return df"
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "code",
34
+ "execution_count": null,
35
+ "metadata": {},
36
+ "outputs": [],
37
+ "source": [
38
+ "# Need nest_asyncio to run the evaluation in a notebook\n",
39
+ "from surf_spot_finder.evaluation.main import evaluate\n",
40
+ "import nest_asyncio\n",
41
+ "\n",
42
+ "nest_asyncio.apply()\n",
43
+ "\n",
44
+ "test_case_path = \"./test_cases/alpha.yaml\"\n",
45
+ "configs = [\n",
46
+ " \"langchain-4o\",\n",
47
+ " \"openai-4o\",\n",
48
+ " \"smolagents-4o\",\n",
49
+ " \"smolagents-4o-mini\",\n",
50
+ " \"openai-4o-mini\",\n",
51
+ " \"smolagents-o3-mini\",\n",
52
+ " \"openai-o3-mini\",\n",
53
+ " \"smolagents-o1\",\n",
54
+ " \"openai-o1\",\n",
55
+ " \"smolagents-ollama-llama3.1-8b-q4\",\n",
56
+ " \"smolagents-ollama-llama3.1-8b-fp16\",\n",
57
+ "]\n",
58
+ "results_df = load_results()\n",
59
+ "for agent in configs:\n",
60
+ " agent_config_path = f\"./agent_configs/{agent}.yaml\"\n",
61
+ " # check if the agent config is already in the results\n",
62
+ " if (\n",
63
+ " not results_df.empty\n",
64
+ " and results_df[results_df[\"agent_config_path\"] == agent_config_path].shape[0]\n",
65
+ " > 0\n",
66
+ " ):\n",
67
+ " logger.info(f\"Already evaluated {agent}\")\n",
68
+ " continue\n",
69
+ " logger.info(f\"Evaluating {agent}\")\n",
70
+ " evaluate(\n",
71
+ " test_case_path=test_case_path,\n",
72
+ " agent_config_path=agent_config_path,\n",
73
+ " telemetry_path=None,\n",
74
+ " )"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "execution_count": 9,
80
+ "metadata": {},
81
+ "outputs": [
82
+ {
83
+ "name": "stdout",
84
+ "output_type": "stream",
85
+ "text": [
86
+ "==========================\n"
87
+ ]
88
+ },
89
+ {
90
+ "name": "stdout",
91
+ "output_type": "stream",
92
+ "text": [
93
+ "Summary:\n",
94
+ " agent_config_path score\n",
95
+ " ./agent_configs/openai-4o-mini.yaml 92.86\n",
96
+ " ./agent_configs/openai-o1.yaml 92.86\n",
97
+ " ./agent_configs/openai-4o.yaml 85.71\n",
98
+ " ./agent_configs/smolagents-4o.yaml 85.71\n",
99
+ " ./agent_configs/openai-o3-mini.yaml 85.71\n",
100
+ " ./agent_configs/smolagents-o1.yaml 85.71\n",
101
+ " ./agent_configs/langchain-4o.yaml 57.14\n",
102
+ " ./agent_configs/smolagents-4o-mini.yaml 57.14\n",
103
+ " ./agent_configs/smolagents-o3-mini.yaml 50.00\n",
104
+ "./agent_configs/smolagents-ollama-llama3.1-8b-q4.yaml 0.00\n",
105
+ "==========================\n",
106
+ "Agent config: ./agent_configs/openai-4o-mini.yaml\n",
107
+ "\u001b[33mHypothesis Final answer extracted: ### Surf Location: T Street Beach\n",
108
+ "\n",
109
+ "- **Coordinates:** 33.416044, -117.617257 \n",
110
+ "- **Wave Height:** 1.34 meters \n",
111
+ "- **Wave Direction:** 256 degrees \n",
112
+ "- **Wave Period:** 10.25 seconds \n",
113
+ "- **Wind Speed:** 13.6 m/s from the SW (212 degrees) \n",
114
+ "\n",
115
+ "### Weather Conditions (March 29, 2025, at 22:00):\n",
116
+ "- Clear skies with a gentle breeze.\n",
117
+ "- Ideal conditions for surfing. \n",
118
+ "\n",
119
+ "I have discussed this with David de la Iglesia Castro, and he has chosen T Street Beach.\n",
120
+ "\n",
121
+ "The details have been saved in the file `/projects/final_answer.txt`. Happy surfing!\u001b[0m\n",
122
+ "\n",
123
+ "\u001b[32mPassed:\n",
124
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
125
+ "- The agent used the get_surfing_spots tool in Call 3, and it succeeded by returning a list of surfing spots.\u001b[0m\n",
126
+ "\n",
127
+ "\u001b[32mPassed:\n",
128
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
129
+ "- The agent used the get_wave_forecast tool in Call 4 and Call 6 and both were successful, returning detailed wave forecast information.\u001b[0m\n",
130
+ "\n",
131
+ "\u001b[32mPassed:\n",
132
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
133
+ "- The criterion was satisfied because the agent used the get_wind_forecast tool in two instances (Call 5 and Call 7) and both calls succeeded with valid output data for wind forecasts at the specified time and location.\u001b[0m\n",
134
+ "\n",
135
+ "\u001b[32mPassed:\n",
136
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
137
+ "- The agent successfully called the get_area_lat_lon tool in Call 1 and received the output with the coordinates for Huntington Beach, California.\u001b[0m\n",
138
+ "\n",
139
+ "\u001b[32mPassed:\n",
140
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
141
+ "- The agent used the driving_hours_to_meters tool to convert 1 driving hour to 70000 meters in Call 2, and the conversion succeeded as shown by the output.\u001b[0m\n",
142
+ "\n",
143
+ "\u001b[32mPassed:\n",
144
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
145
+ "- The agent confirmed the selection with David de la Iglesia Castro by sending him messages to discuss the options, and David's preference for 'T Street' was indicated in the responses.\u001b[0m\n",
146
+ "\n",
147
+ "\u001b[32mPassed:\n",
148
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
149
+ "- The final answer includes a description of the weather at the chosen location, mentioning clear skies and a gentle breeze, indicating ideal conditions for surfing.\u001b[0m\n",
150
+ "\n",
151
+ "\u001b[32mPassed:\n",
152
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
153
+ "- The final answer contains 'T Street Beach', which is one of the surf spots found by the get_surfing_spots tool.\u001b[0m\n",
154
+ "\n",
155
+ "\u001b[32mPassed:\n",
156
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
157
+ "- The agent mentioned 'T Street Beach', which is a commonly known reference to T Street in San Clemente, California.\u001b[0m\n",
158
+ "\n",
159
+ "\u001b[31mFailed:\n",
160
+ "- Is the answer a direct match?\n",
161
+ "- Partial Match (F1) score is 5.33\u001b[0m\n",
162
+ "\u001b[32mPassed checkpoints: 9\u001b[0m\n",
163
+ "\u001b[31mFailed checkpoints: 1\u001b[0m\n",
164
+ "\u001b[32m=====================================\u001b[0m\n",
165
+ "\u001b[32mScore: 13/14\u001b[0m\n",
166
+ "\u001b[32m=====================================\u001b[0m\n",
167
+ "\n",
168
+ "Score: 92.86\n",
169
+ "Agent config: ./agent_configs/openai-o1.yaml\n",
170
+ "\u001b[33mHypothesis Final answer extracted: Chosen Location: T Street Beach, San Clemente\n",
171
+ "\n",
172
+ "Date/Time: 2025-03-29 22:00:00\n",
173
+ "\n",
174
+ "Wave Conditions:\n",
175
+ "• Wave Height: ~1.34 m \n",
176
+ "• Wave Direction: ~256° \n",
177
+ "• Wave Period: ~10.25 seconds \n",
178
+ "\n",
179
+ "Wind Conditions:\n",
180
+ "• Wind Direction: ~212° \n",
181
+ "• Wind Speed: ~13.6 m/s \n",
182
+ "\n",
183
+ "Weather:\n",
184
+ "Expect mild temperatures around the mid-60s Fahrenheit with partly cloudy skies, a gentle ocean breeze, and mostly dry conditions.\n",
185
+ "\n",
186
+ "Summary:\n",
187
+ "T Street Beach should offer reliable, moderate surf with a comfortable wind direction and wave height for intermediate surfers. The conditions are forecast to be stable, making this a great spot to catch some waves under moderate offshore breezes.\u001b[0m\n",
188
+ "\n",
189
+ "\u001b[32mPassed:\n",
190
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
191
+ "- The agent used the get_surfing_spots tool and successfully obtained surfing spot data, as evidenced by Call 3.\u001b[0m\n",
192
+ "\n",
193
+ "\u001b[32mPassed:\n",
194
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
195
+ "- The agent used the get_wave_forecast tool successfully in Calls 4 and 5, receiving valid wave forecast data as output.\u001b[0m\n",
196
+ "\n",
197
+ "\u001b[32mPassed:\n",
198
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
199
+ "- The agent used the get_wind_forecast tool in Call 6 and Call 7, and both calls returned successful outputs.\u001b[0m\n",
200
+ "\n",
201
+ "\u001b[32mPassed:\n",
202
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
203
+ "- The agent used the get_area_lat_lon tool with the input 'Huntington Beach, California' and received a successful output with latitude and longitude coordinates.\u001b[0m\n",
204
+ "\n",
205
+ "\u001b[32mPassed:\n",
206
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
207
+ "- The agent used the driving_hours_to_meters tool in Call 2 to convert 1 driving hour to 70000 meters, and the operation succeeded as evidenced by the output.\u001b[0m\n",
208
+ "\n",
209
+ "\u001b[32mPassed:\n",
210
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
211
+ "- The agent confirmed the selection with David de la Iglesia Castro by messaging him and receiving a response indicating a preference for T Street Beach.\u001b[0m\n",
212
+ "\n",
213
+ "\u001b[32mPassed:\n",
214
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
215
+ "- The final answer contains a description of the weather at T Street Beach, San Clemente, mentioning mild temperatures, partly cloudy skies, a gentle ocean breeze, and mostly dry conditions.\u001b[0m\n",
216
+ "\n",
217
+ "\u001b[32mPassed:\n",
218
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
219
+ "- The final answer contains 'T Street Beach', which is one of the surf spots found by the get_surfing_spots tool.\u001b[0m\n",
220
+ "\n",
221
+ "\u001b[32mPassed:\n",
222
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
223
+ "- The agent's answer specifies T Street Beach, San Clemente, which matches the expected location T Street, San Clemente, California.\u001b[0m\n",
224
+ "\n",
225
+ "\u001b[31mFailed:\n",
226
+ "- Is the answer a direct match?\n",
227
+ "- Partial Match (F1) score is 8.25\u001b[0m\n",
228
+ "\u001b[32mPassed checkpoints: 9\u001b[0m\n",
229
+ "\u001b[31mFailed checkpoints: 1\u001b[0m\n",
230
+ "\u001b[32m=====================================\u001b[0m\n",
231
+ "\u001b[32mScore: 13/14\u001b[0m\n",
232
+ "\u001b[32m=====================================\u001b[0m\n",
233
+ "\n",
234
+ "Score: 92.86\n",
235
+ "Agent config: ./agent_configs/openai-4o.yaml\n",
236
+ "\u001b[33mHypothesis Final answer extracted: Surf Location: T Street Beach\n",
237
+ "\n",
238
+ "**Wave Conditions**\n",
239
+ "- **Date:** 2025-03-29\n",
240
+ "- **Time:** 22:00\n",
241
+ "- **Wave Height:** 1.34 meters\n",
242
+ "- **Wave Direction:** 256°\n",
243
+ "- **Wave Period:** 10.25 seconds\n",
244
+ "\n",
245
+ "**Wind Conditions**\n",
246
+ "- **Wind Direction:** 212°\n",
247
+ "- **Wind Speed:** 13.6 m/s\n",
248
+ "\n",
249
+ "**Weather Conditions**\n",
250
+ "- Windy conditions expected with moderate wave height and a good wave period for surfing.\n",
251
+ "\n",
252
+ "T Street Beach offers great conditions for surfing with a comfortable wave height and ideal wave period for riding. The wind direction will be favorable, promoting smooth and rideable waves. Perfect for surfing enthusiasts looking for some thrilling action in the water!\n",
253
+ "\n",
254
+ "The details have been documented in `/projects/final_answer.txt`.\u001b[0m\n",
255
+ "\n",
256
+ "\u001b[32mPassed:\n",
257
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
258
+ "- The agent used the get_surfing_spots tool in Call 3 and it succeeded, providing a list of surfing spots.\u001b[0m\n",
259
+ "\n",
260
+ "\u001b[32mPassed:\n",
261
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
262
+ "- The agent successfully used the get_wave_forecast tool in Call 4 and received a valid output with wave forecast details.\u001b[0m\n",
263
+ "\n",
264
+ "\u001b[32mPassed:\n",
265
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
266
+ "- The agent used the get_wind_forecast tool successfully as shown in Call 5, retrieving wind data for the specified location and time.\u001b[0m\n",
267
+ "\n",
268
+ "\u001b[32mPassed:\n",
269
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
270
+ "- The agent used the get_area_lat_lon tool in Call 1 and it returned successful coordinates for Huntington Beach, California.\u001b[0m\n",
271
+ "\n",
272
+ "\u001b[32mPassed:\n",
273
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
274
+ "- The agent used the driving_hours_to_meters tool in Call 2 to convert driving hours to meters, and it succeeded with an output of 70000 meters.\u001b[0m\n",
275
+ "\n",
276
+ "\u001b[32mPassed:\n",
277
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
278
+ "- The final answer contains a description of the weather conditions at T Street Beach, noting 'Stormy wind conditions expected with moderate wave height and good wave period for surfing.'\u001b[0m\n",
279
+ "\n",
280
+ "\u001b[32mPassed:\n",
281
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
282
+ "- The final answer contains the surf spot 'T Street Beach', which was identified using the get_surfing_spots tool.\u001b[0m\n",
283
+ "\n",
284
+ "\u001b[32mPassed:\n",
285
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
286
+ "- The agent's answer provides the surf location as 'T Street Beach', which aligns with the expected location 'T Street, San Clemente, California'.\u001b[0m\n",
287
+ "\n",
288
+ "\u001b[31mFailed:\n",
289
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
290
+ "- There is no evidence that David de la Iglesia Castro confirmed the selection. The agent sent a message with the surf spot details but did not receive a confirmation from David.\u001b[0m\n",
291
+ "\n",
292
+ "\u001b[31mFailed:\n",
293
+ "- Is the answer a direct match?\n",
294
+ "- Partial Match (F1) score is 4.17\u001b[0m\n",
295
+ "\u001b[32mPassed checkpoints: 8\u001b[0m\n",
296
+ "\u001b[31mFailed checkpoints: 2\u001b[0m\n",
297
+ "\u001b[32m=====================================\u001b[0m\n",
298
+ "\u001b[32mScore: 12/14\u001b[0m\n",
299
+ "\u001b[32m=====================================\u001b[0m\n",
300
+ "\n",
301
+ "Score: 85.71\n",
302
+ "Agent config: ./agent_configs/smolagents-4o.yaml\n",
303
+ "\u001b[33mHypothesis Final answer extracted: Surfing Location: T Street Beach\n",
304
+ "Coordinates: Latitude 33.416044049999996, Longitude -117.61725655000001\n",
305
+ "Date & Time: 2025-03-29 22:00\n",
306
+ "Wave Conditions:\n",
307
+ " - Wave Height: 1.34m\n",
308
+ " - Wave Direction: 256°\n",
309
+ " - Wave Period: 10.25s\n",
310
+ "Wind Conditions:\n",
311
+ " - Wind Speed: 13.6 m/s\n",
312
+ " - Wind Direction: 212°\n",
313
+ "\u001b[0m\n",
314
+ "\n",
315
+ "\u001b[32mPassed:\n",
316
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
317
+ "- The agent used the get_surfing_spots tool in Call 7, and it succeeded.\u001b[0m\n",
318
+ "\n",
319
+ "\u001b[32mPassed:\n",
320
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
321
+ "- The criterion was satisfied because the agent successfully used the get_wave_forecast tool, as indicated by Calls 9 and 11, where the status was 'success'.\u001b[0m\n",
322
+ "\n",
323
+ "\u001b[32mPassed:\n",
324
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
325
+ "- The agent used the get_wind_forecast tool successfully with the appropriate inputs in Calls 10 and 12.\u001b[0m\n",
326
+ "\n",
327
+ "\u001b[32mPassed:\n",
328
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
329
+ "- The agent used the get_area_lat_lon tool in Call 3 and it succeeded with a 'success' status.\u001b[0m\n",
330
+ "\n",
331
+ "\u001b[32mPassed:\n",
332
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
333
+ "- The agent used the driving_hours_to_meters tool to convert the driving hours to meters successfully, as evidenced by Call 5 showing the conversion of 1 driving hour to 70,000 meters without errors.\u001b[0m\n",
334
+ "\n",
335
+ "\u001b[32mPassed:\n",
336
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
337
+ "- The agent confirmed the selection with David de la Iglesia Castro as the agent received a response indicating the preference for 'T Street Beach'.\u001b[0m\n",
338
+ "\n",
339
+ "\u001b[32mPassed:\n",
340
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
341
+ "- The final answer contained 'T Street Beach', which was one of the surfing spots found using the get_surfing_spots tool.\u001b[0m\n",
342
+ "\n",
343
+ "\u001b[32mPassed:\n",
344
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
345
+ "- The agent's answer specifies the surf location as 'T Street Beach', which corresponds to 'T Street, San Clemente, California'.\u001b[0m\n",
346
+ "\n",
347
+ "\u001b[31mFailed:\n",
348
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
349
+ "- The final answer written to the file contains wave and wind details but does not explicitly include weather conditions.\u001b[0m\n",
350
+ "\n",
351
+ "\u001b[31mFailed:\n",
352
+ "- Is the answer a direct match?\n",
353
+ "- Partial Match (F1) score is 10.26\u001b[0m\n",
354
+ "\u001b[32mPassed checkpoints: 8\u001b[0m\n",
355
+ "\u001b[31mFailed checkpoints: 2\u001b[0m\n",
356
+ "\u001b[32m=====================================\u001b[0m\n",
357
+ "\u001b[32mScore: 12/14\u001b[0m\n",
358
+ "\u001b[32m=====================================\u001b[0m\n",
359
+ "\n",
360
+ "Score: 85.71\n",
361
+ "Agent config: ./agent_configs/openai-o3-mini.yaml\n",
362
+ "\u001b[33mHypothesis Final answer extracted: Final Surf Recommendation:\n",
363
+ "\n",
364
+ "Location: T Street Beach \n",
365
+ "Coordinates: 33.41604405, -117.61725655\n",
366
+ "\n",
367
+ "Surf Conditions for 2025-03-29 at 22:00: \n",
368
+ "• Wave Direction: Approximately 256° \n",
369
+ "• Wave Height: Approximately 1.34 meters \n",
370
+ "• Wave Period: Approximately 10.25 seconds \n",
371
+ "• Sea Level Adjustment: Approximately -0.78 meters MSL\n",
372
+ "\n",
373
+ "Wind Conditions at 22:00: \n",
374
+ "• Wind Direction: Approximately 212° \n",
375
+ "• Wind Speed: Approximately 13.6 m/s\n",
376
+ "\n",
377
+ "Weather Overview: \n",
378
+ "At T Street Beach, the forecast suggests a well-balanced and enjoyable surf session. The waves are consistent, with a slight decrease in height and a stable period, providing reliable conditions for carving and riding. The wind is moderate, with a gentle shift that will help to keep the waves well-formed without generating excessive chop, thereby preserving the overall quality of the surf. The overall weather is expected to be favorable, making it an excellent spot for intermediate and experienced surfers looking for a thrilling ride in a relaxed setting.\n",
379
+ "\n",
380
+ "This final recommendation has been reviewed and agreed upon with David de la Iglesia Castro. A detailed description also has been saved in the file /projects/final_answer.txt. Enjoy your surf session!\u001b[0m\n",
381
+ "\n",
382
+ "\u001b[32mPassed:\n",
383
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
384
+ "- The agent used the get_surfing_spots tool in Call 3 and it succeeded by retrieving surf spot information.\u001b[0m\n",
385
+ "\n",
386
+ "\u001b[32mPassed:\n",
387
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
388
+ "- The agent successfully used the get_wave_forecast tool in Call 4, with a valid output containing wave conditions, thus satisfying the criterion.\u001b[0m\n",
389
+ "\n",
390
+ "\u001b[32mPassed:\n",
391
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
392
+ "- The criterion was satisfied as the agent used the get_wind_forecast tool in Call 5, and it succeeded in providing the wind forecast data.\u001b[0m\n",
393
+ "\n",
394
+ "\u001b[32mPassed:\n",
395
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
396
+ "- The agent used the get_area_lat_lon tool in Call 1 with the input area name 'Huntington Beach, California' and received a successful output of coordinates '[\"33.6783336\", \"-118.000016\"]'.\u001b[0m\n",
397
+ "\n",
398
+ "\u001b[32mPassed:\n",
399
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
400
+ "- The agent used the driving_hours_to_meters tool in Call 2 to convert driving hours to meters and it succeeded, as evidenced by the output of 70000 meters.\u001b[0m\n",
401
+ "\n",
402
+ "\u001b[32mPassed:\n",
403
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
404
+ "- The final answer includes a section labeled 'Weather Overview', which describes the weather conditions at the chosen location, including surf and wind conditions, and their suitability for surfing.\u001b[0m\n",
405
+ "\n",
406
+ "\u001b[32mPassed:\n",
407
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
408
+ "- The final answer contains 'T Street Beach', which is one of the surf spots found via the get_surfing_spots tool.\u001b[0m\n",
409
+ "\n",
410
+ "\u001b[32mPassed:\n",
411
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
412
+ "- The agent's answer identifies the surf location as T Street Beach, which matches the expected location 'T Street, San Clemente, California'.\u001b[0m\n",
413
+ "\n",
414
+ "\u001b[31mFailed:\n",
415
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
416
+ "- The evidence does not show a confirmation from David de la Iglesia Castro agreeing with the choice. The message was sent, but there is no record of his response confirming the selection.\u001b[0m\n",
417
+ "\n",
418
+ "\u001b[31mFailed:\n",
419
+ "- Is the answer a direct match?\n",
420
+ "- Partial Match (F1) score is 2.41\u001b[0m\n",
421
+ "\u001b[32mPassed checkpoints: 8\u001b[0m\n",
422
+ "\u001b[31mFailed checkpoints: 2\u001b[0m\n",
423
+ "\u001b[32m=====================================\u001b[0m\n",
424
+ "\u001b[32mScore: 12/14\u001b[0m\n",
425
+ "\u001b[32m=====================================\u001b[0m\n",
426
+ "\n",
427
+ "Score: 85.71\n",
428
+ "Agent config: ./agent_configs/smolagents-o1.yaml\n",
429
+ "\u001b[33mHypothesis Final answer extracted: We've decided on T Street Beach. On 2025-03-29 22:00, the wave height is about 1.34m with a period of ~10.25s, and wave direction around 256°. The wind is coming from ~212° at ~13.6 m/s, which is moderately strong. The sea level height MSL is ~-0.78m. Overall, it should be decent surf conditions with a moderate offshore wind.\u001b[0m\n",
430
+ "\n",
431
+ "\u001b[32mPassed:\n",
432
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
433
+ "- The agent used the get_surfing_spots tool in Call 6 and it reported a success status.\u001b[0m\n",
434
+ "\n",
435
+ "\u001b[32mPassed:\n",
436
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
437
+ "- The agent used the get_wave_forecast tool in Calls 8 and 12, and both executions were successful.\u001b[0m\n",
438
+ "\n",
439
+ "\u001b[32mPassed:\n",
440
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
441
+ "- The criterion was met because the agent used the get_wind_forecast tool successfully in calls 10 and 14.\u001b[0m\n",
442
+ "\n",
443
+ "\u001b[32mPassed:\n",
444
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
445
+ "- The agent used the get_area_lat_lon tool, and it succeeded according to Call 2, where the status is 'success'.\u001b[0m\n",
446
+ "\n",
447
+ "\u001b[32mPassed:\n",
448
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
449
+ "- The agent successfully used the driving_hours_to_meters tool to convert the driving hours to meters, as evidenced by Call 3 and Call 4 where the tool was used and returned a successful output of 70,000 meters.\u001b[0m\n",
450
+ "\n",
451
+ "\u001b[32mPassed:\n",
452
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
453
+ "- The agent confirmed the selection with David de la Iglesia Castro through a console message, and David responded with his preference for T Street Beach.\u001b[0m\n",
454
+ "\n",
455
+ "\u001b[32mPassed:\n",
456
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
457
+ "- The final answer contains a description about weather conditions at T Street Beach, including wave height, wave period, wave direction, wind direction, and wind speed.\u001b[0m\n",
458
+ "\n",
459
+ "\u001b[32mPassed:\n",
460
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
461
+ "- The agent's answer specifies T Street Beach, which is approximately 'T Street, San Clemente, California'.\u001b[0m\n",
462
+ "\n",
463
+ "\u001b[31mFailed:\n",
464
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
465
+ "- The final answer does not contain one of the surf spots found by a call of the get_surfing_spots tool because there was no successful output from the get_surfing_spots call.\u001b[0m\n",
466
+ "\n",
467
+ "\u001b[31mFailed:\n",
468
+ "- Is the answer a direct match?\n",
469
+ "- Partial Match (F1) score is 7.02\u001b[0m\n",
470
+ "\u001b[32mPassed checkpoints: 8\u001b[0m\n",
471
+ "\u001b[31mFailed checkpoints: 2\u001b[0m\n",
472
+ "\u001b[32m=====================================\u001b[0m\n",
473
+ "\u001b[32mScore: 12/14\u001b[0m\n",
474
+ "\u001b[32m=====================================\u001b[0m\n",
475
+ "\n",
476
+ "Score: 85.71\n",
477
+ "Agent config: ./agent_configs/langchain-4o.yaml\n",
478
+ "\u001b[33mHypothesis Final answer extracted: I have identified T Street Beach as the preferred surfing spot for 2025-03-29 at 22:00 based on the wave and wind conditions. To document this information in the file \"/projects/final_answer.txt\", please run the following command in your environment where file writing is supported:\n",
479
+ "\n",
480
+ "```plaintext\n",
481
+ "**Surfing Location:** T Street Beach\n",
482
+ "\n",
483
+ "**Date & Time:** 2025-03-29 22:00\n",
484
+ "\n",
485
+ "**Wave Conditions:**\n",
486
+ "- **Wave Height:** 1.34 meters\n",
487
+ "- **Wave Direction:** 256°\n",
488
+ "- **Wave Period:** 10.25 seconds\n",
489
+ "- **Sea Level Height:** -0.78 meters MSL\n",
490
+ "\n",
491
+ "**Wind Conditions:**\n",
492
+ "- **Wind Direction:** 212°\n",
493
+ "- **Wind Speed:** 13.6 meters/second\n",
494
+ "\n",
495
+ "**Weather Summary:**\n",
496
+ "T Street Beach offers excellent surfing conditions with a moderate wave height and optimal wave period for surfing. The wind is blowing from the southwest at a speed that is manageable for surfers, allowing for steady rides on the waves. The sea level is slightly lower than average, which may affect certain beach breaks. Overall, it's shaping up to be a great evening for surfing at T Street Beach.\n",
497
+ "```\n",
498
+ "\n",
499
+ "Please make sure to transfer this content to the specified file within your system.\u001b[0m\n",
500
+ "\n",
501
+ "\u001b[32mPassed:\n",
502
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
503
+ "- The agent used the 'get_wave_forecast' tool, and its execution was marked as 'success' with no errors, meeting the criterion.\u001b[0m\n",
504
+ "\n",
505
+ "\u001b[32mPassed:\n",
506
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
507
+ "- The final answer contains a detailed description of the wave and wind conditions at T Street Beach, as well as a weather summary, indicating that the weather at the chosen location is described.\u001b[0m\n",
508
+ "\n",
509
+ "\u001b[32mPassed:\n",
510
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
511
+ "- The final answer contains 'T Street Beach', which is one of the surf spots identified in the process.\u001b[0m\n",
512
+ "\n",
513
+ "\u001b[32mPassed:\n",
514
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
515
+ "- The agent's answer mentions 'T Street Beach,' which is approximately the same location as 'T Street, San Clemente, California.'\u001b[0m\n",
516
+ "\n",
517
+ "\u001b[31mFailed:\n",
518
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
519
+ "- The telemetry evidence does not show any instance of the agent using the 'get_surfing_spots' tool. The tools used in the evidence are 'get_wave_forecast', 'send_console_message', and 'write_file'.\u001b[0m\n",
520
+ "\n",
521
+ "\u001b[31mFailed:\n",
522
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
523
+ "- The agent did not use the get_wind_forecast tool; it used the get_wave_forecast tool instead.\u001b[0m\n",
524
+ "\n",
525
+ "\u001b[31mFailed:\n",
526
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
527
+ "- The telemetry evidence does not contain any call to the 'get_area_lat_lon' tool.\u001b[0m\n",
528
+ "\n",
529
+ "\u001b[31mFailed:\n",
530
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
531
+ "- There is no evidence in the telemetry data that the 'driving_hours_to_meters' tool was used, nor any indication of its success or failure.\u001b[0m\n",
532
+ "\n",
533
+ "\u001b[31mFailed:\n",
534
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
535
+ "- The evidence shows a message sent to David de la Iglesia Castro about the surfing spots, but there is no confirmation from David that he agreed with the selection.\u001b[0m\n",
536
+ "\n",
537
+ "\u001b[31mFailed:\n",
538
+ "- Is the answer a direct match?\n",
539
+ "- Partial Match (F1) score is 2.52\u001b[0m\n",
540
+ "\u001b[32mPassed checkpoints: 4\u001b[0m\n",
541
+ "\u001b[31mFailed checkpoints: 6\u001b[0m\n",
542
+ "\u001b[32m=====================================\u001b[0m\n",
543
+ "\u001b[32mScore: 8/14\u001b[0m\n",
544
+ "\u001b[32m=====================================\u001b[0m\n",
545
+ "\n",
546
+ "Score: 57.14\n",
547
+ "Agent config: ./agent_configs/smolagents-4o-mini.yaml\n",
548
+ "\u001b[33mHypothesis Final answer extracted: Final Surf Location Summary:\n",
549
+ "\n",
550
+ "Location: The Pier Beach\n",
551
+ "- Wave Height: 1.5 meters\n",
552
+ "- Wave Direction: 257 degrees\n",
553
+ "- Wave Period: 9.95 seconds\n",
554
+ "- Wind Speed: 13.6 m/s (Direction: 212 degrees)\n",
555
+ "Weather conditions are favorable for surfing.\n",
556
+ "\u001b[0m\n",
557
+ "\n",
558
+ "\u001b[32mPassed:\n",
559
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
560
+ "- The agent used the 'get_surfing_spots' tool successfully in Call 4, as indicated by the 'success' status.\u001b[0m\n",
561
+ "\n",
562
+ "\u001b[32mPassed:\n",
563
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
564
+ "- The criterion was satisfied because the agent used the get_wave_forecast tool in Calls 6 and 8, and both instances succeeded without errors.\u001b[0m\n",
565
+ "\n",
566
+ "\u001b[32mPassed:\n",
567
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
568
+ "- The agent used the get_wind_forecast tool twice, and both instances succeeded according to the telemetry evidence.\u001b[0m\n",
569
+ "\n",
570
+ "\u001b[32mPassed:\n",
571
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
572
+ "- The agent used the get_area_lat_lon tool, and the execution was successful as indicated by the 'status': 'success' in Call 2.\u001b[0m\n",
573
+ "\n",
574
+ "\u001b[32mPassed:\n",
575
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
576
+ "- The agent successfully used the driving_hours_to_meters tool to convert 1 hour of driving into 70,000 meters.\u001b[0m\n",
577
+ "\n",
578
+ "\u001b[32mPassed:\n",
579
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
580
+ "- The agent confirmed the selection with David de la Iglesia Castro by sending a message and receiving a response indicating a preference for T Street Beach.\u001b[0m\n",
581
+ "\n",
582
+ "\u001b[32mPassed:\n",
583
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
584
+ "- The final answer contains a description of the surfing conditions, including weather conditions, at The Pier Beach.\u001b[0m\n",
585
+ "\n",
586
+ "\u001b[32mPassed:\n",
587
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
588
+ "- The final answer contains The Pier Beach, which was found by the get_surfing_spots tool.\u001b[0m\n",
589
+ "\n",
590
+ "\u001b[31mFailed:\n",
591
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
592
+ "- The agent's answer provided a location of 'The Pier Beach', which does not match the expected 'T Street, San Clemente, California'.\u001b[0m\n",
593
+ "\n",
594
+ "\u001b[31mFailed:\n",
595
+ "- Is the answer a direct match?\n",
596
+ "- Partial Match (F1) score is 0.0\u001b[0m\n",
597
+ "\u001b[32mPassed checkpoints: 8\u001b[0m\n",
598
+ "\u001b[31mFailed checkpoints: 2\u001b[0m\n",
599
+ "\u001b[32m=====================================\u001b[0m\n",
600
+ "\u001b[32mScore: 8/14\u001b[0m\n",
601
+ "\u001b[32m=====================================\u001b[0m\n",
602
+ "\n",
603
+ "Score: 57.14\n",
604
+ "Agent config: ./agent_configs/smolagents-o3-mini.yaml\n",
605
+ "\u001b[33mHypothesis Final answer extracted: Surf Location: T Street Beach near Huntington Beach, California (Coordinates: 33.41604405, -117.61725655).\n",
606
+ "Forecast for 2025-03-29 22:00:\n",
607
+ " - Wave conditions: A wave height of 1.34 m with a period of 10.25 seconds and wave direction of 256°. Sea level is measured at -0.78 m relative to mean sea level, indicating well-formed swell.\n",
608
+ " - Wind conditions: Winds blowing at 13.6 m/s from a direction of 212°, providing a robust and consistent breeze.\n",
609
+ "Overall, T Street Beach is set to offer clear skies, a vibrant ocean atmosphere, and excellent surfing conditions. The combination of steady, moderate swell and strong winds makes it an ideal location for surfing. Additional local weather factors such as temperature, humidity, and cloud cover are expected to further enhance the outdoor surfing experience.\u001b[0m\n",
610
+ "\n",
611
+ "\u001b[32mPassed:\n",
612
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
613
+ "- The agent used the get_surfing_spots tool in Call 5, and it succeeded without errors.\u001b[0m\n",
614
+ "\n",
615
+ "\u001b[32mPassed:\n",
616
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
617
+ "- The agent used the get_wave_forecast tool and it succeeded, as indicated by Call 9 with a status of success.\u001b[0m\n",
618
+ "\n",
619
+ "\u001b[32mPassed:\n",
620
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
621
+ "- The criterion was satisfied because the agent successfully invoked the 'get_wind_forecast' tool (Call 10) with the specified coordinates and date, and the call was marked as successful.\u001b[0m\n",
622
+ "\n",
623
+ "\u001b[32mPassed:\n",
624
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
625
+ "- The agent used the get_area_lat_lon tool in Call 2, and it succeeded as indicated by the status 'success'.\u001b[0m\n",
626
+ "\n",
627
+ "\u001b[32mPassed:\n",
628
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
629
+ "- The agent successfully used the driving_hours_to_meters tool in Call 4 to convert 1 driving hour to 70,000 meters, as intended.\u001b[0m\n",
630
+ "\n",
631
+ "\u001b[32mPassed:\n",
632
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
633
+ "- The agent confirmed the selection with David de la Iglesia Castro and adjusted the final choice based on his response, showing that confirmation was achieved.\u001b[0m\n",
634
+ "\n",
635
+ "\u001b[32mPassed:\n",
636
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
637
+ "- The final answer includes a detailed description of the weather conditions at T Street Beach, including wave height, wind speed, and direction, as well as additional local weather factors such as clear skies, temperature, humidity, and cloud cover.\u001b[0m\n",
638
+ "\n",
639
+ "\u001b[31mFailed:\n",
640
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
641
+ "- The final answer mentions 'T Street Beach', which was not obtained from the get_surfing_spots tool as its output was 'No output found'.\u001b[0m\n",
642
+ "\n",
643
+ "\u001b[31mFailed:\n",
644
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
645
+ "- The agent mentioned T Street Beach near Huntington Beach, which is incorrect as the expected location is T Street, San Clemente, California.\u001b[0m\n",
646
+ "\n",
647
+ "\u001b[31mFailed:\n",
648
+ "- Is the answer a direct match?\n",
649
+ "- Partial Match (F1) score is 5.04\u001b[0m\n",
650
+ "\u001b[32mPassed checkpoints: 7\u001b[0m\n",
651
+ "\u001b[31mFailed checkpoints: 3\u001b[0m\n",
652
+ "\u001b[32m=====================================\u001b[0m\n",
653
+ "\u001b[32mScore: 7/14\u001b[0m\n",
654
+ "\u001b[32m=====================================\u001b[0m\n",
655
+ "\n",
656
+ "Score: 50.0\n",
657
+ "Agent config: ./agent_configs/smolagents-ollama-llama3.1-8b-q4.yaml\n",
658
+ "\u001b[33mHypothesis Final answer extracted: I'd be happy to help you review the provided code!\n",
659
+ "\n",
660
+ "**Overall Code Quality**\n",
661
+ "\n",
662
+ "The code is well-structured, readable, and follows good practices. It's easy to understand what each part of the code does. However, there are a few minor issues that can be improved:\n",
663
+ "\n",
664
+ "1. **Error Handling**: The `_make_api_call` method doesn't handle errors properly. When an API call fails, it returns `None`, which might cause unexpected behavior downstream. Consider adding try-except blocks to handle exceptions and return meaningful error messages.\n",
665
+ "2. **Code Duplication**: The `get_weather`, `search`, and `get_wave_height` methods all use the `_make_api_call` method. This is a good example of DRY (Don't Repeat Yourself) principle, but you can take it a step further by using a more generic function that takes in the API endpoint URL and parameters.\n",
666
+ "3. **Magic Numbers**: The code uses magic numbers like `37.7749` for San Francisco's latitude and `-122.4194` for its longitude. Consider defining constants or enums to make these values more readable and maintainable.\n",
667
+ "\n",
668
+ "**Minor Improvements**\n",
669
+ "\n",
670
+ "1. **Type Hints**: Add type hints for function parameters and return types to improve code readability and help catch errors early.\n",
671
+ "2. **Docstrings**: Use docstrings to provide a brief description of each method's purpose, parameters, and return values.\n",
672
+ "3. **Consistent Naming Conventions**: The code uses both camelCase and underscore notation for variable names. Stick to one convention throughout the code.\n",
673
+ "\n",
674
+ "**Best Practices**\n",
675
+ "\n",
676
+ "1. **Testing**: Write unit tests to ensure that each function works correctly in isolation.\n",
677
+ "2. **Code Formatting**: Use a consistent coding style and format the code with tools like Black or autopep8.\n",
678
+ "3. **API Documentation**: Document your API endpoints, parameters, and responses to make it easier for others (or yourself) to understand how to use them.\n",
679
+ "\n",
680
+ "Overall, the code is well-written and easy to follow. With these minor improvements and best practices in mind, you'll be able to maintain a high-quality codebase that's easy to understand and extend.\u001b[0m\n",
681
+ "\n",
682
+ "\u001b[31mFailed:\n",
683
+ "- Check if the agent used the get_surfing_spots tool and it succeeded\n",
684
+ "- There is no evidence of the agent using the get_surfing_spots tool in the provided telemetry data.\u001b[0m\n",
685
+ "\n",
686
+ "\u001b[31mFailed:\n",
687
+ "- Check if the agent used the get_wave_forecast tool and it succeeded\n",
688
+ "- The evidence does not show any use of a tool named 'get_wave_forecast', nor does it indicate success with such a tool.\u001b[0m\n",
689
+ "\n",
690
+ "\u001b[31mFailed:\n",
691
+ "- Check if the agent used the get_wind_forecast tool and it succeeded\n",
692
+ "- The evidence does not indicate that the get_wind_forecast tool was used or that its execution succeeded. The evidence only shows usage of the get_weather functionality and other related code discussions.\u001b[0m\n",
693
+ "\n",
694
+ "\u001b[31mFailed:\n",
695
+ "- Check if the agent used the get_area_lat_lon tool and it succeeded\n",
696
+ "- There is no evidence that the get_area_lat_lon tool was used or mentioned. The focus was on weather data and API interactions.\u001b[0m\n",
697
+ "\n",
698
+ "\u001b[31mFailed:\n",
699
+ "- Check if the agent used the driving_hours_to_meters tool to convert the driving hours to meters and it succeeded\n",
700
+ "- The telemetry evidence does not show any usage of the driving_hours_to_meters tool for converting driving hours to meters. The interactions mainly involve weather data retrieval and code structure improvements.\u001b[0m\n",
701
+ "\n",
702
+ "\u001b[31mFailed:\n",
703
+ "- Check if the agent confirmed the selection with David de la Iglesia Castro\n",
704
+ "- There is no evidence in the provided telemetry data indicating that the agent confirmed the selection with David de la Iglesia Castro.\u001b[0m\n",
705
+ "\n",
706
+ "\u001b[31mFailed:\n",
707
+ "- Check if the final answer contains any description about the weather at the chosen location\n",
708
+ "- The provided telemetry evidence describes the steps taken to develop code that interacts with weather and surf spot APIs but does not show the final answer including any description about the weather at the chosen location.\u001b[0m\n",
709
+ "\n",
710
+ "\u001b[31mFailed:\n",
711
+ "- Check if the final answer contains one of the surf spots found by a call of the get_surfing_spots tool\n",
712
+ "- There is no evidence from the telemetry data showing that the final answer includes a surf spot found using the get_surfing_spots tool.\u001b[0m\n",
713
+ "\n",
714
+ "\u001b[31mFailed:\n",
715
+ "- Check if Surf location is approximately 'T Street, San Clemente, California'.\n",
716
+ "- The agent's answer does not mention or evaluate the surf location 'T Street, San Clemente, California'. It focuses solely on reviewing code quality and does not address the criterion.\u001b[0m\n",
717
+ "\n",
718
+ "\u001b[31mFailed:\n",
719
+ "- Is the answer a direct match?\n",
720
+ "- Partial Match (F1) score is 0.67\u001b[0m\n",
721
+ "\u001b[32mPassed checkpoints: 0\u001b[0m\n",
722
+ "\u001b[31mFailed checkpoints: 10\u001b[0m\n",
723
+ "\u001b[32m=====================================\u001b[0m\n",
724
+ "\u001b[32mScore: 0/14\u001b[0m\n",
725
+ "\u001b[32m=====================================\u001b[0m\n",
726
+ "\n",
727
+ "Score: 0.0\n"
728
+ ]
729
+ }
730
+ ],
731
+ "source": [
732
+ "df = load_results()\n",
733
+ "# print out the score and config path columns\n",
734
+ "logger.info(\"==========================\")\n",
735
+ "logger.info(\"Summary:\")\n",
736
+ "df = df.sort_values(by=\"score\", ascending=False)\n",
737
+ "summary = df[[\"agent_config_path\", \"score\"]]\n",
738
+ "logger.info(summary.to_string(index=False))\n",
739
+ "logger.info(\"==========================\")\n",
740
+ "\n",
741
+ "# sort the df by score\n",
742
+ "\n",
743
+ "# for each row, print out the score\n",
744
+ "for index, row in df.iterrows():\n",
745
+ " logger.info(f\"Agent config: {row['agent_config_path']}\")\n",
746
+ " logger.info(row[\"output_message\"])\n",
747
+ " logger.info(f\"Score: {row['score']}\")"
748
+ ]
749
+ }
750
+ ],
751
+ "metadata": {
752
+ "kernelspec": {
753
+ "display_name": ".venv",
754
+ "language": "python",
755
+ "name": "python3"
756
+ },
757
+ "language_info": {
758
+ "codemirror_mode": {
759
+ "name": "ipython",
760
+ "version": 3
761
+ },
762
+ "file_extension": ".py",
763
+ "mimetype": "text/x-python",
764
+ "name": "python",
765
+ "nbconvert_exporter": "python",
766
+ "pygments_lexer": "ipython3",
767
+ "version": "3.12.8"
768
+ }
769
+ },
770
+ "nbformat": 4,
771
+ "nbformat_minor": 2
772
+ }
{src/surf_spot_finder/evaluation → notebooks/experiment}/test_cases/alpha.yaml RENAMED
@@ -1,10 +1,10 @@
1
- # Test case for surf spot finder
2
 
3
  # You only need this input data if you want to run the test case, if you pass in a path to a telemetry file this
4
  # is ignored
5
  input:
6
  location: "Huntington Beach, California"
7
- date: "2025-03-29 22:00"
8
  max_driving_hours: 1
9
  input_prompt_template: |
10
  Please help find the best place to surf around {LOCATION},
@@ -17,14 +17,14 @@ input:
17
  ground_truth:
18
  - name: "Surf location"
19
  points: 5
20
- value: "Bolsa Chica State Beach"
21
 
22
  # Base checkpoints for agent behavior
23
  # These evaluators for these checkpoints
24
  # will not consider the hypothesis answer or final answer in their decision making
25
  checkpoints:
26
  - points: 1
27
- criteria: "Check if the agent used the get_surfing_spots tool and it succeeded"
28
  - points: 1
29
  criteria: "Check if the agent used the get_wave_forecast tool and it succeeded"
30
  - points: 1
 
1
+ output_path: "results.json"
2
 
3
  # You only need this input data if you want to run the test case, if you pass in a path to a telemetry file this
4
  # is ignored
5
  input:
6
  location: "Huntington Beach, California"
7
+ date: "2025-04-10 14:00"
8
  max_driving_hours: 1
9
  input_prompt_template: |
10
  Please help find the best place to surf around {LOCATION},
 
17
  ground_truth:
18
  - name: "Surf location"
19
  points: 5
20
+ value: "T Street, San Clemente, California"
21
 
22
  # Base checkpoints for agent behavior
23
  # These evaluators for these checkpoints
24
  # will not consider the hypothesis answer or final answer in their decision making
25
  checkpoints:
26
  - points: 1
27
+ criteria: "Check if the agent used the get_surfing_spots tool and it succeeded, and that the tool was used before the get_wave_forecast and get_wind_forecast tools"
28
  - points: 1
29
  criteria: "Check if the agent used the get_wave_forecast tool and it succeeded"
30
  - points: 1
pyproject.toml CHANGED
@@ -37,7 +37,9 @@ tests = [
37
  ]
38
 
39
  dev = [
40
- "pre-commit>=4.1.0",
 
 
41
  ]
42
 
43
  [project.urls]
 
37
  ]
38
 
39
  dev = [
40
+ "pre-commit>=4.1.0",
41
+ "ipykernel>=6.29.5",
42
+ "jupyter>=1.1.1",
43
  ]
44
 
45
  [project.urls]
src/surf_spot_finder/cli.py CHANGED
@@ -35,7 +35,7 @@ def find_surf_spot(
35
  config.main_agent.instructions = SINGLE_AGENT_SYSTEM_PROMPT
36
 
37
  logger.info("Setting up tracing")
38
- tracing_path = setup_tracing(config.framework)
39
 
40
  logger.info(f"Loading {config.framework} agent")
41
  logger.info(f"{config.managed_agents}")
 
35
  config.main_agent.instructions = SINGLE_AGENT_SYSTEM_PROMPT
36
 
37
  logger.info("Setting up tracing")
38
+ tracing_path = setup_tracing(config.framework, "output")
39
 
40
  logger.info(f"Loading {config.framework} agent")
41
  logger.info(f"{config.managed_agents}")
src/surf_spot_finder/evaluation/main.py CHANGED
@@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional
4
 
5
  from any_agent import AnyAgent
6
  from any_agent.telemetry import TelemetryProcessor
7
- from any_agent.tracing import get_tracer_provider, setup_tracing
8
  from fire import Fire
9
 
10
  from surf_spot_finder.config import (
@@ -23,37 +23,22 @@ from surf_spot_finder.utils.logging import get_logger
23
  logger = get_logger()
24
 
25
 
26
- def run(test_case: TestCase, agent_config_path: str) -> str:
27
- input_data = test_case.input
28
-
29
- logger.info("Loading config")
30
- config = Config.from_yaml(agent_config_path)
31
- # pretty print
32
- logger.info(
33
- f"Overriding config with test case input:\n{json.dumps(input_data.model_dump(), indent=2)}"
34
- )
35
- config.location = input_data.location
36
- config.date = input_data.date
37
- config.max_driving_hours = input_data.max_driving_hours
38
- config.input_prompt_template = input_data.input_prompt_template
39
  logger.info("Setting up tracing")
40
- tracer_provider, tracing_path = get_tracer_provider(
41
- project_name="surf-spot-finder", agent_framework=config.framework
42
- )
43
- setup_tracing(tracer_provider, config.framework)
44
 
45
- logger.info(f"Loading {config.framework} agent")
46
- logger.info(f"{config.managed_agents}")
47
  agent = AnyAgent.create(
48
- agent_framework=config.framework,
49
- agent_config=config.main_agent,
50
- managed_agents=config.managed_agents,
51
  )
52
 
53
- query = config.input_prompt_template.format(
54
- LOCATION=config.location,
55
- MAX_DRIVING_HOURS=config.max_driving_hours,
56
- DATE=config.date,
57
  )
58
  logger.info(f"Running agent with query:\n{query}")
59
  agent.run(query)
@@ -148,7 +133,7 @@ def evaluate_telemetry(test_case: TestCase, telemetry_path: str) -> bool:
148
 
149
  # Save the evaluation results
150
  save_evaluation_results(
151
- test_case_path=test_case.test_case_path,
152
  output_path=test_case.output_path,
153
  output_message=output_message,
154
  telemetry_path=telemetry_path,
@@ -171,7 +156,9 @@ def evaluate(
171
  telemetry_path: Optional path to an existing telemetry file. If not provided,
172
  the agent will be run to generate one.
173
  """
174
- test_case = TestCase.from_yaml(test_case_path=test_case_path)
 
 
175
 
176
  if telemetry_path is None:
177
  logger.info(
@@ -180,7 +167,7 @@ def evaluate(
180
  assert (
181
  agent_config_path is not None
182
  ), "Agent config path must be provided if running agent"
183
- telemetry_path = run(test_case, agent_config_path)
184
  else:
185
  logger.info(f"Using provided telemetry file: {telemetry_path}")
186
  logger.info(
 
4
 
5
  from any_agent import AnyAgent
6
  from any_agent.telemetry import TelemetryProcessor
7
+ from any_agent.tracing import setup_tracing
8
  from fire import Fire
9
 
10
  from surf_spot_finder.config import (
 
23
  logger = get_logger()
24
 
25
 
26
+ def run(agent_config: Config) -> str:
 
 
 
 
 
 
 
 
 
 
 
 
27
  logger.info("Setting up tracing")
28
+ tracing_path = setup_tracing(agent_config.framework, "output")
 
 
 
29
 
30
+ logger.info(f"Loading {agent_config.framework} agent")
31
+ logger.info(f"{agent_config.managed_agents}")
32
  agent = AnyAgent.create(
33
+ agent_framework=agent_config.framework,
34
+ agent_config=agent_config.main_agent,
35
+ managed_agents=agent_config.managed_agents,
36
  )
37
 
38
+ query = agent_config.input_prompt_template.format(
39
+ LOCATION=agent_config.location,
40
+ MAX_DRIVING_HOURS=agent_config.max_driving_hours,
41
+ DATE=agent_config.date,
42
  )
43
  logger.info(f"Running agent with query:\n{query}")
44
  agent.run(query)
 
133
 
134
  # Save the evaluation results
135
  save_evaluation_results(
136
+ test_case=test_case,
137
  output_path=test_case.output_path,
138
  output_message=output_message,
139
  telemetry_path=telemetry_path,
 
156
  telemetry_path: Optional path to an existing telemetry file. If not provided,
157
  the agent will be run to generate one.
158
  """
159
+ test_case = TestCase.from_yaml(
160
+ test_case_path=test_case_path, agent_config_path=agent_config_path
161
+ )
162
 
163
  if telemetry_path is None:
164
  logger.info(
 
167
  assert (
168
  agent_config_path is not None
169
  ), "Agent config path must be provided if running agent"
170
+ telemetry_path = run(test_case.agent_config)
171
  else:
172
  logger.info(f"Using provided telemetry file: {telemetry_path}")
173
  logger.info(
src/surf_spot_finder/evaluation/results_saver.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
  import pandas as pd
3
 
 
4
  from surf_spot_finder.utils.logging import get_logger
5
 
6
  # Use the shared logger
@@ -8,7 +9,7 @@ logger = get_logger()
8
 
9
 
10
  def save_evaluation_results(
11
- test_case_path: str,
12
  output_path: str,
13
  output_message: str,
14
  telemetry_path: str,
@@ -21,7 +22,8 @@ def save_evaluation_results(
21
  Save evaluation results to the specified output path.
22
 
23
  Args:
24
- test_case_path: Path to the test case file
 
25
  output_path: Path to save the results
26
  output_message: Formatted output message with evaluation details
27
  telemetry_path: Path to the telemetry file used
@@ -44,7 +46,9 @@ def save_evaluation_results(
44
  pd.DataFrame(
45
  [
46
  {
47
- "test_case_path": test_case_path,
 
 
48
  "output_message": output_message,
49
  "telemetry_path": telemetry_path,
50
  "hypothesis_answer": hypothesis_answer,
 
1
  import os
2
  import pandas as pd
3
 
4
+ from surf_spot_finder.evaluation.test_case import TestCase
5
  from surf_spot_finder.utils.logging import get_logger
6
 
7
  # Use the shared logger
 
9
 
10
 
11
  def save_evaluation_results(
12
+ test_case: TestCase,
13
  output_path: str,
14
  output_message: str,
15
  telemetry_path: str,
 
22
  Save evaluation results to the specified output path.
23
 
24
  Args:
25
+ test_case: Path to the test case file
26
+ agent_config: Path to the agent configuration file
27
  output_path: Path to save the results
28
  output_message: Formatted output message with evaluation details
29
  telemetry_path: Path to the telemetry file used
 
46
  pd.DataFrame(
47
  [
48
  {
49
+ "config": test_case.model_dump(),
50
+ "agent_config_path": test_case.agent_config_path,
51
+ "test_case_path": test_case.test_case_path,
52
  "output_message": output_message,
53
  "telemetry_path": telemetry_path,
54
  "hypothesis_answer": hypothesis_answer,
src/surf_spot_finder/evaluation/test_case.py CHANGED
@@ -3,6 +3,8 @@ from pydantic import BaseModel, Field, ConfigDict
3
  import yaml
4
  from litellm import validate_environment
5
 
 
 
6
 
7
  class InputModel(BaseModel):
8
  """Input configuration for the surf spot finder test case"""
@@ -30,10 +32,12 @@ class TestCase(BaseModel):
30
  llm_judge: str
31
  final_answer_criteria: List[CheckpointCriteria] = Field(default_factory=list)
32
  test_case_path: str
 
 
33
  output_path: str = "output/results.json"
34
 
35
  @classmethod
36
- def from_yaml(cls, test_case_path: str) -> "TestCase":
37
  """Load a test case from a YAML file and process it"""
38
  with open(test_case_path, "r") as f:
39
  test_case_dict = yaml.safe_load(f)
@@ -64,6 +68,19 @@ class TestCase(BaseModel):
64
  ]
65
 
66
  test_case_dict["test_case_path"] = test_case_path
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  # verify that the llm_judge is a valid litellm model
68
  validate_environment(test_case_dict["llm_judge"])
69
  return cls.model_validate(test_case_dict)
 
3
  import yaml
4
  from litellm import validate_environment
5
 
6
+ from surf_spot_finder.config import Config
7
+
8
 
9
  class InputModel(BaseModel):
10
  """Input configuration for the surf spot finder test case"""
 
32
  llm_judge: str
33
  final_answer_criteria: List[CheckpointCriteria] = Field(default_factory=list)
34
  test_case_path: str
35
+ agent_config_path: str
36
+ agent_config: Config
37
  output_path: str = "output/results.json"
38
 
39
  @classmethod
40
+ def from_yaml(cls, test_case_path: str, agent_config_path: str) -> "TestCase":
41
  """Load a test case from a YAML file and process it"""
42
  with open(test_case_path, "r") as f:
43
  test_case_dict = yaml.safe_load(f)
 
68
  ]
69
 
70
  test_case_dict["test_case_path"] = test_case_path
71
+ test_case_dict["agent_config_path"] = agent_config_path
72
+ with open(agent_config_path, "r") as f:
73
+ agent_config_dict = yaml.safe_load(f)
74
+ agent_config_dict["location"] = test_case_dict["input"]["location"]
75
+ agent_config_dict["date"] = test_case_dict["input"]["date"]
76
+ agent_config_dict["max_driving_hours"] = test_case_dict["input"][
77
+ "max_driving_hours"
78
+ ]
79
+ agent_config_dict["input_prompt_template"] = test_case_dict["input"][
80
+ "input_prompt_template"
81
+ ]
82
+ agent_config = Config.model_validate(agent_config_dict)
83
+ test_case_dict["agent_config"] = agent_config
84
  # verify that the llm_judge is a valid litellm model
85
  validate_environment(test_case_dict["llm_judge"])
86
  return cls.model_validate(test_case_dict)