Skip to content

Commit

Permalink
remove unused scripts in gaia example
Browse files Browse the repository at this point in the history
  • Loading branch information
ollmer committed Feb 24, 2025
1 parent b2eb109 commit 431c805
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 89 deletions.
3 changes: 1 addition & 2 deletions examples/gaia_agent/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
from tapeagents.tools.web_search import SearchAction

from .scorer import question_scorer
from .steps import GaiaAnswer, GaiaQuestion, ImageObservation
from .tape import GaiaMetadata, GaiaTape
from .steps import GaiaAnswer, GaiaMetadata, GaiaQuestion, GaiaTape, ImageObservation

logger = logging.getLogger(__name__)

Expand Down
52 changes: 0 additions & 52 deletions examples/gaia_agent/prompts.py

This file was deleted.

3 changes: 1 addition & 2 deletions examples/gaia_agent/scripts/browsergym_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
from tapeagents.steps import ReasoningThought
from tapeagents.tools.container_executor import init_code_sandbox

from ..steps import GaiaQuestion
from ..tape import GaiaTape
from ..steps import GaiaQuestion, GaiaTape

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/gaia_agent/scripts/collect_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import os
from collections import defaultdict

from examples.gaia_agent.tape import GaiaTape
from tapeagents.io import load_tapes

from ..eval import ensemble_files, majority_vote, tape_correct
from ..steps import GaiaTape

logging.basicConfig(level=logging.INFO)

Expand Down
2 changes: 1 addition & 1 deletion examples/gaia_agent/scripts/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tapeagents.orchestrator import get_agent_and_env_from_config, main_loop

from ..eval import load_dataset, task_to_observations
from ..tape import GaiaMetadata, GaiaTape
from ..steps import GaiaMetadata, GaiaTape

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion examples/gaia_agent/scripts/prepare_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tapeagents.io import load_tapes

from ..eval import get_exp_config_dict, load_dataset
from ..tape import GaiaTape
from ..steps import GaiaTape

logging.basicConfig(level=logging.INFO)

Expand Down
3 changes: 1 addition & 2 deletions examples/gaia_agent/scripts/studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from tapeagents.studio import Studio
from tapeagents.tools.container_executor import init_code_sandbox

from ..steps import GaiaQuestion
from ..tape import GaiaTape
from ..steps import GaiaQuestion, GaiaTape

logging.basicConfig(
level=logging.INFO,
Expand Down
3 changes: 1 addition & 2 deletions examples/gaia_agent/scripts/tape_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from tapeagents.tape_browser import TapeBrowser

from ..eval import calculate_accuracy, get_exp_config_dict, tape_correct
from ..steps import GaiaStep
from ..tape import GaiaTape
from ..steps import GaiaStep, GaiaTape

logging.basicConfig(level=logging.INFO)

Expand Down
2 changes: 1 addition & 1 deletion examples/gaia_agent/scripts/tape_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tapeagents.utils import diff_strings

from ..eval import calculate_accuracy, tape_correct
from ..tape import GaiaTape
from ..steps import GaiaTape


class TapeDiffGUI:
Expand Down
26 changes: 24 additions & 2 deletions examples/gaia_agent/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@

from pydantic import Field

from tapeagents.core import LLMOutputParsingFailureAction, Observation, SetNextNode, StopStep, Thought
from tapeagents.dialog_tape import UserStep
from tapeagents.core import (
LLMOutputParsingFailureAction,
Observation,
SetNextNode,
StopStep,
Tape,
TapeMetadata,
Thought,
)
from tapeagents.dialog_tape import DialogContext, UserStep
from tapeagents.environment import CodeExecutionResult, ExecuteCode
from tapeagents.steps import (
ActionExecutionFailure,
Expand Down Expand Up @@ -156,3 +164,17 @@ class GaiaAnswer(StopStep):
SetNextNode,
UserStep,
]


class GaiaMetadata(TapeMetadata):
task: dict = Field(default_factory=dict)
result: Any = None
terminated: bool = False
attempt_number: int = 0
level: int = 0
other: dict = Field(default_factory=dict)


class GaiaTape(Tape[DialogContext, GaiaStep]):
metadata: GaiaMetadata = Field(default_factory=GaiaMetadata)
context: DialogContext | None = DialogContext(tools=[])
22 changes: 0 additions & 22 deletions examples/gaia_agent/tape.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
load_user_input_tapes,
load_user_reference_tapes,
)
from examples.gaia_agent.tape import GaiaTape
from examples.gaia_agent.steps import GaiaTape
from examples.llama_agent import LLAMAChatBot
from examples.optimize.optimize import make_agentic_rag_agent, make_env
from examples.tape_improver import tape_improver
Expand Down

0 comments on commit 431c805

Please sign in to comment.