From 593c5b992cc95bb337306201a1c8b629cea68dc5 Mon Sep 17 00:00:00 2001 From: lucas-aixplain Date: Thu, 17 Apr 2025 14:05:57 -0300 Subject: [PATCH 1/2] Fix agent and team agent parametrized functional test --- tests/functional/agent/agent_functional_test.py | 5 ++++- tests/functional/team_agent/team_agent_functional_test.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/functional/agent/agent_functional_test.py b/tests/functional/agent/agent_functional_test.py index b1a9d453..966bd7a6 100644 --- a/tests/functional/agent/agent_functional_test.py +++ b/tests/functional/agent/agent_functional_test.py @@ -300,7 +300,8 @@ def test_update_tools_of_agent(run_input_map, delete_agents_and_team_agents, Age }, ], ) -def test_specific_model_parameters_e2e(tool_config): +def test_specific_model_parameters_e2e(tool_config, delete_agents_and_team_agents): + assert delete_agents_and_team_agents """Test end-to-end agent execution with specific model parameters""" # Create tool based on config if tool_config["type"] == "search": @@ -327,6 +328,7 @@ def test_specific_model_parameters_e2e(tool_config): tools=[tool], llm_id="6626a3a8c8f1d089790cf5a2", # Using LLM ID from test data ) + agent.deploy() # Run agent response = agent.run(data=tool_config["query"]) @@ -345,6 +347,7 @@ def test_specific_model_parameters_e2e(tool_config): tool_used = True break assert tool_used, "Tool was not used in execution" + agent.delete() @pytest.mark.parametrize("AgentFactory", [AgentFactory, v2.Agent]) diff --git a/tests/functional/team_agent/team_agent_functional_test.py b/tests/functional/team_agent/team_agent_functional_test.py index 3cabad8c..cb5f80a9 100644 --- a/tests/functional/team_agent/team_agent_functional_test.py +++ b/tests/functional/team_agent/team_agent_functional_test.py @@ -301,6 +301,7 @@ def test_team_agent_with_parameterized_agents(run_input_map, delete_agents_and_t llm_id=run_input_map["llm_id"], tools=[search_tool], ) + search_agent.deploy() # Create second agent with translation tool translation_function = Function.TRANSLATION @@ -318,7 +319,7 @@ def test_team_agent_with_parameterized_agents(run_input_map, delete_agents_and_t llm_id=run_input_map["llm_id"], tools=[translation_tool], ) - + translation_agent.deploy() team_agent = create_team_agent( TeamAgentFactory, [search_agent, translation_agent], run_input_map, use_mentalist=True, use_inspector=True ) From 0813beff8288b8a0bbafe348bff847c79d80856e Mon Sep 17 00:00:00 2001 From: lucas-aixplain Date: Thu, 17 Apr 2025 17:59:57 -0300 Subject: [PATCH 2/2] Update to use draft agent --- tests/functional/agent/agent_functional_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/functional/agent/agent_functional_test.py b/tests/functional/agent/agent_functional_test.py index 966bd7a6..5df56d13 100644 --- a/tests/functional/agent/agent_functional_test.py +++ b/tests/functional/agent/agent_functional_test.py @@ -328,7 +328,6 @@ def test_specific_model_parameters_e2e(tool_config, delete_agents_and_team_agent tools=[tool], llm_id="6626a3a8c8f1d089790cf5a2", # Using LLM ID from test data ) - agent.deploy() # Run agent response = agent.run(data=tool_config["query"]) @@ -347,7 +346,6 @@ def test_specific_model_parameters_e2e(tool_config, delete_agents_and_team_agent tool_used = True break assert tool_used, "Tool was not used in execution" - agent.delete() @pytest.mark.parametrize("AgentFactory", [AgentFactory, v2.Agent])