adding initial CLI support

This commit is contained in:
João Moura
2024-03-11 16:37:32 -03:00
parent a4e9b9ccfe
commit 47b5cbd211
24 changed files with 417 additions and 7 deletions

View File

@@ -663,3 +663,20 @@ def test_agent_llm_uses_token_calc_handler_with_llm_has_model_name():
assert (
agent1.llm.callbacks[0].token_cost_process.__class__.__name__ == "TokenProcess"
)
def test_agent_definition_based_on_dict():
config = {
"role": "test role",
"goal": "test goal",
"backstory": "test backstory",
"verbose": True,
}
agent = Agent(config=config)
assert agent.role == "test role"
assert agent.goal == "test goal"
assert agent.backstory == "test backstory"
assert agent.verbose == True
assert agent.tools == []

View File

@@ -449,3 +449,16 @@ def test_increment_tool_errors():
increment_tools_errors.return_value = None
crew.kickoff()
increment_tools_errors.assert_called_once
def test_task_definition_based_on_dict():
config = {
"description": "Give me an integer score between 1-5 for the following title: 'The impact of AI in the future of work', check examples to based your evaluation.",
"expected_output": "The score of the title.",
}
task = Task(config=config)
assert task.description == config["description"]
assert task.expected_output == config["expected_output"]
assert task.agent is None