style: Moved argument parsing statements into a separate function (#503)

* style: moved argument parsing into a separate function

* commito

* Update evaluation/regression/conftest.py

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
This commit is contained in:
Aravind Somaraj 2024-04-01 20:17:58 +05:30 committed by GitHub
parent 64281c4cc4
commit 26c9ce132b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -59,7 +59,6 @@ def workspace_dir(test_cases_dir, request):
test_case_dir = os.path.dirname(request.module.__file__)
workspace_dir = os.path.join(test_case_dir, 'workspace')
return workspace_dir
@pytest.fixture
def model(request):
"""Fixture that provides the model name.

View File

@ -18,8 +18,8 @@ def read_task_from_stdin() -> str:
"""Read task from stdin."""
return sys.stdin.read()
async def main():
"""Main coroutine to run the agent controller with task input flexibility."""
def parse_arguments():
"""Parse command-line arguments."""
parser = argparse.ArgumentParser(description="Run an agent with a specific task")
parser.add_argument("-d", "--directory", required=True, type=str, help="The working directory for the agent")
parser.add_argument("-t", "--task", type=str, default="", help="The task for the agent to perform")
@ -27,7 +27,11 @@ async def main():
parser.add_argument("-c", "--agent-cls", default="LangchainsAgent", type=str, help="The agent class to use")
parser.add_argument("-m", "--model-name", default=config.get_or_default("LLM_MODEL", "gpt-4-0125-preview"), type=str, help="The (litellm) model name to use")
parser.add_argument("-i", "--max-iterations", default=100, type=int, help="The maximum number of iterations to run the agent")
args = parser.parse_args()
return parser.parse_args()
async def main():
"""Main coroutine to run the agent controller with task input flexibility."""
args = parse_arguments()
# Determine the task source
if args.file: