diff --git a/docs/challenges/building_challenges.md b/docs/challenges/building_challenges.md index e59cad3e..09ab3bf5 100644 --- a/docs/challenges/building_challenges.md +++ b/docs/challenges/building_challenges.md @@ -101,7 +101,6 @@ def input_generator(input_sequence: list) -> Generator[str, None, None]: @pytest.mark.skip("This challenge hasn't been beaten yet.") @pytest.mark.vcr @requires_api_key("OPENAI_API_KEY") -@run_multiple_times(3) def test_information_retrieval_challenge_a(kubernetes_agent, monkeypatch) -> None: """ Test the challenge_a function in a given agent by mocking user inputs diff --git a/tests/integration/agent_factory.py b/tests/integration/agent_factory.py index c2f2d4f6..713afb79 100644 --- a/tests/integration/agent_factory.py +++ b/tests/integration/agent_factory.py @@ -145,17 +145,18 @@ def get_company_revenue_agent( ): command_registry = CommandRegistry() command_registry.import_commands("autogpt.commands.file_operations") + command_registry.import_commands("autogpt.commands.google_search") command_registry.import_commands("autogpt.app") + command_registry.import_commands("autogpt.commands.task_statuses") ai_config = AIConfig( - ai_name="Get-CompanyRevenue", - ai_role="an autonomous agent that specializes in finding the reported revenue of a company.", + ai_name="Information Retrieval Agent", + ai_role="an autonomous agent that specializes in retrieving information.", ai_goals=[ - "Write the revenue of Tesla in 2022 to a file. You should write the number without commas and you should not use signs like B for billion and M for million.", + "Search for 'tesla revenue 2022' and write the revenue of Tesla in 2022 to a file called output.txt. You should write the number without commas and you should not use signs like B for billion and M for million.", ], ) ai_config.command_registry = command_registry - system_prompt = ai_config.construct_full_prompt() Config().set_continuous_mode(False) agent = Agent( @@ -168,7 +169,6 @@ def get_company_revenue_agent( triggering_prompt=DEFAULT_TRIGGERING_PROMPT, workspace_directory=workspace.root, ) - return agent diff --git a/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_a.py b/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_a.py index 42e9a993..0a0c634c 100644 --- a/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_a.py +++ b/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_a.py @@ -4,17 +4,15 @@ import pytest from autogpt.commands.file_operations import read_file, write_to_file from autogpt.config import Config -from tests.integration.challenges.utils import run_interaction_loop, run_multiple_times +from tests.integration.challenges.utils import run_interaction_loop from tests.utils import requires_api_key CYCLE_COUNT = 3 from autogpt.agent import Agent -@pytest.mark.skip("This challenge hasn't been beaten yet.") @pytest.mark.vcr @requires_api_key("OPENAI_API_KEY") -@run_multiple_times(3) def test_information_retrieval_challenge_a( get_company_revenue_agent: Agent, monkeypatch: pytest.MonkeyPatch, diff --git a/tests/integration/challenges/kubernetes/test_kubernetes_template_challenge_a.py b/tests/integration/challenges/kubernetes/test_kubernetes_template_challenge_a.py index b84f5018..10bcfb1c 100644 --- a/tests/integration/challenges/kubernetes/test_kubernetes_template_challenge_a.py +++ b/tests/integration/challenges/kubernetes/test_kubernetes_template_challenge_a.py @@ -4,7 +4,7 @@ import yaml from autogpt.agent import Agent from autogpt.commands.file_operations import read_file from autogpt.config import Config -from tests.integration.challenges.utils import run_interaction_loop, run_multiple_times +from tests.integration.challenges.utils import run_interaction_loop from tests.utils import requires_api_key CYCLE_COUNT = 6 @@ -13,7 +13,6 @@ CYCLE_COUNT = 6 @pytest.mark.skip("This challenge hasn't been beaten yet.") @pytest.mark.vcr @requires_api_key("OPENAI_API_KEY") -@run_multiple_times(3) def test_kubernetes_template_challenge_a( kubernetes_agent: Agent, monkeypatch: pytest.MonkeyPatch, config: Config ) -> None: diff --git a/tests/integration/challenges/utils.py b/tests/integration/challenges/utils.py index d80ca977..b7bf83fe 100644 --- a/tests/integration/challenges/utils.py +++ b/tests/integration/challenges/utils.py @@ -48,24 +48,6 @@ def generate_noise(noise_size: int) -> str: ) -def run_multiple_times(times: int) -> Callable: - """ - Decorator that runs a test function multiple times. - - :param times: The number of times the test function should be executed. - """ - - def decorator(test_func: Callable[..., Any]) -> Callable[..., Any]: - @wraps(test_func) - def wrapper(*args: Tuple[Any, ...], **kwargs: Dict[str, Any]) -> None: - for _ in range(times): - test_func(*args, **kwargs) - - return wrapper - - return decorator - - def setup_mock_input(monkeypatch: pytest.MonkeyPatch, cycle_count: int) -> None: """ Sets up the mock input for testing. diff --git a/tests/vcr/vcr_filter.py b/tests/vcr/vcr_filter.py index 3a58bee9..a86f501a 100644 --- a/tests/vcr/vcr_filter.py +++ b/tests/vcr/vcr_filter.py @@ -19,6 +19,7 @@ REPLACEMENTS: List[Dict[str, str]] = [ ALLOWED_HOSTNAMES: List[str] = [ "api.openai.com", "localhost:50337", + "duckduckgo.com", ] if PROXY: