From 36dce863c2351f8390df8358f7109ab1e39c8825 Mon Sep 17 00:00:00 2001 From: "zaina.abushaban" Date: Tue, 28 Oct 2025 12:19:37 +0300 Subject: [PATCH 1/3] Fixed non-inspector related tests --- tests/functional/agent/agent_functional_test.py | 4 ++-- .../functional/team_agent/team_agent_functional_test.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/functional/agent/agent_functional_test.py b/tests/functional/agent/agent_functional_test.py index 0d541500..de3c663d 100644 --- a/tests/functional/agent/agent_functional_test.py +++ b/tests/functional/agent/agent_functional_test.py @@ -510,7 +510,7 @@ def test_instructions(delete_agents_and_team_agents, AgentFactory): agent = AgentFactory.create( name="Test Agent", description="Test description", - instructions="Always respond with '{magic_word}' does not matter what you are prompted for.", + instructions="Always respond with 'aixplain' does not matter what you are prompted for.", llm_id="6646261c6eb563165658bbb1", tools=[], ) @@ -519,7 +519,7 @@ def test_instructions(delete_agents_and_team_agents, AgentFactory): agent = AgentFactory.get(agent.id) assert agent is not None - response = agent.run(data={"magic_word": "aixplain", "query": "What is the capital of France?"}) + response = agent.run(data={"query": "What is the capital of France?"}) assert response is not None assert response["completed"] is True assert response["status"].lower() == "success" diff --git a/tests/functional/team_agent/team_agent_functional_test.py b/tests/functional/team_agent/team_agent_functional_test.py index 3709c0f8..34734c90 100644 --- a/tests/functional/team_agent/team_agent_functional_test.py +++ b/tests/functional/team_agent/team_agent_functional_test.py @@ -247,7 +247,7 @@ def test_add_remove_agents_from_team_agent(run_input_map, delete_agents_and_team def test_team_agent_tasks(delete_agents_and_team_agents): assert delete_agents_and_team_agents agent = AgentFactory.create( - name="Teste", + name="Test Sub Agent", description="You are a test agent that always returns the same answer", tools=[ AgentFactory.create_model_tool(function=Function.TRANSLATION, supplier=Supplier.MICROSOFT), @@ -268,13 +268,13 @@ def test_team_agent_tasks(delete_agents_and_team_agents): ) team_agent = TeamAgentFactory.create( - name="Teste", + name="Test Multi Agent", agents=[agent], description="Teste", ) response = team_agent.run(data="Translate 'teste'") assert response.status == "SUCCESS" - assert "teste" in response.data["output"] + assert "test" in response.data["output"] def test_team_agent_with_parameterized_agents(run_input_map, delete_agents_and_team_agents): @@ -538,6 +538,9 @@ def test_team_agent_with_slack_connector(): authentication_schema=AuthenticationSchema.BEARER_TOKEN, data={"token": os.getenv("SLACK_TOKEN")}, ) + import pprint + pprint.pprint(response) + connection_id = response.data["id"] connection = ModelFactory.get(connection_id) From 9b189e9e53cc885f8d80c8ace772fc81d29b480c Mon Sep 17 00:00:00 2001 From: "zaina.abushaban" Date: Tue, 28 Oct 2025 12:22:21 +0300 Subject: [PATCH 2/3] clean up print --- tests/functional/team_agent/team_agent_functional_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/functional/team_agent/team_agent_functional_test.py b/tests/functional/team_agent/team_agent_functional_test.py index 34734c90..c357b8d4 100644 --- a/tests/functional/team_agent/team_agent_functional_test.py +++ b/tests/functional/team_agent/team_agent_functional_test.py @@ -538,8 +538,6 @@ def test_team_agent_with_slack_connector(): authentication_schema=AuthenticationSchema.BEARER_TOKEN, data={"token": os.getenv("SLACK_TOKEN")}, ) - import pprint - pprint.pprint(response) connection_id = response.data["id"] From 00324b8e28646d79f2af48b74f7c54dd4c071e6a Mon Sep 17 00:00:00 2001 From: "zaina.abushaban" Date: Thu, 30 Oct 2025 20:52:26 +0300 Subject: [PATCH 3/3] fixed literal instructions issue --- aixplain/factories/agent_factory/__init__.py | 15 ++------------- aixplain/modules/agent/utils.py | 14 ++++---------- tests/functional/agent/agent_functional_test.py | 4 ++-- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/aixplain/factories/agent_factory/__init__.py b/aixplain/factories/agent_factory/__init__.py index b16761b5..c7f51ae0 100644 --- a/aixplain/factories/agent_factory/__init__.py +++ b/aixplain/factories/agent_factory/__init__.py @@ -48,17 +48,6 @@ from aixplain.enums import DatabaseSourceType -def to_literal_text(x): - """Convert value to literal text, escaping braces for string formatting. - - Args: - x: Value to convert (dict, list, or any other type) - - Returns: - str: Escaped string representation - """ - s = json.dumps(x, ensure_ascii=False, indent=2) if isinstance(x, (dict, list)) else str(x) - return s.replace("{", "{{").replace("}", "}}") class AgentFactory: @@ -157,8 +146,8 @@ def create( payload = { "name": name, "assets": [build_tool_payload(tool) for tool in tools], - "description": to_literal_text(description), - "instructions": to_literal_text(instructions) if instructions is not None else description, + "description": description, + "instructions": instructions if instructions is not None else description, "supplier": supplier, "version": version, "llmId": llm_id, diff --git a/aixplain/modules/agent/utils.py b/aixplain/modules/agent/utils.py index 588a57ea..9da5d787 100644 --- a/aixplain/modules/agent/utils.py +++ b/aixplain/modules/agent/utils.py @@ -38,16 +38,10 @@ def process_variables( variables = re.findall(r"(?