Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding descriptive prompts for screenshot/som #129

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/agentlab/agents/dynamic_prompting.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,12 @@ def add_screenshot(self, prompt: BaseMessage) -> BaseMessage:
if self.flags.use_screenshot:
if self.flags.use_som:
screenshot = self.obs["screenshot_som"]
prompt.add_text(
"\n## Screenshot:\nHere is a screenshot of the page, it is annotated with bounding boxes and corresponding bids:"
)
else:
screenshot = self.obs["screenshot"]
prompt.add_text("\n## Screenshot:\nHere is a screenshot of the page:")
img_url = image_to_jpg_base64_url(screenshot)
prompt.add_image(img_url, detail=self.flags.openai_vision_detail)
return prompt
Expand Down
9 changes: 3 additions & 6 deletions src/agentlab/experiments/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pickle
import re
import uuid
from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
Expand All @@ -16,11 +17,7 @@
from agentlab.experiments import args
from agentlab.experiments import reproducibility_util as repro
from agentlab.experiments.exp_utils import RESULTS_DIR, add_dependencies
from agentlab.experiments.launch_exp import (
find_incomplete,
non_dummy_count,
run_experiments,
)
from agentlab.experiments.launch_exp import find_incomplete, non_dummy_count, run_experiments

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -353,7 +350,7 @@ def _agents_on_benchmark(
The logging level for individual jobs.

Returns:
study: Study
list[ExpArgs]: The list of experiments to run.
"""

if not isinstance(agents, (list, tuple)):
Expand Down