mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-24 01:14:22 +01:00
Pass agent to commands instead of config (#4645)
* Add config as attribute to Agent, rename old config to ai_config * Code review: Pass ai_config * Pass agent to commands instead of config * Lint * Fix merge error * Fix memory challenge a --------- Co-authored-by: Nicholas Tindle <nick@ntindle.com> Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
This commit is contained in:
@@ -1,18 +1,14 @@
|
||||
import pytest
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
from autogpt.agent.agent import Agent
|
||||
from autogpt.commands.web_selenium import browse_website
|
||||
from autogpt.config import Config
|
||||
from tests.utils import requires_api_key
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@requires_api_key("OPENAI_API_KEY")
|
||||
def test_browse_website(config: Config, patched_api_requestor: MockerFixture):
|
||||
def test_browse_website(agent: Agent, patched_api_requestor: MockerFixture):
|
||||
url = "https://barrel-roll.com"
|
||||
question = "How to execute a barrel roll"
|
||||
|
||||
response = browse_website(url, question, config)
|
||||
response = browse_website(url, question, agent)
|
||||
assert "Error" in response
|
||||
# Sanity check that the response is not too long
|
||||
assert len(response) < 200
|
||||
|
||||
Reference in New Issue
Block a user