Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions tests/functional/agent/agent_functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_end2end(run_input_map, delete_agents_and_team_agents, AgentFactory):
assert response["completed"] is True
assert response["status"].lower() == "success"
assert "data" in response
assert response["data"]["session_id"] is not None
assert response["data"]["session_id"] is None
assert response["data"]["output"] is not None
agent.delete()

Expand Down Expand Up @@ -520,7 +520,7 @@ def test_instructions(delete_agents_and_team_agents, AgentFactory):
assert response["completed"] is True
assert response["status"].lower() == "success"
assert "data" in response
assert response["data"]["session_id"] is not None
assert response["data"]["session_id"] is None
assert response["data"]["output"] is not None
assert "aixplain" in response["data"]["output"].lower()
agent.delete()
Expand Down Expand Up @@ -734,11 +734,15 @@ def test_agent_with_action_tool():

connector = ModelFactory.get("686432941223092cb4294d3f")
# connect
response = connector.connect(authentication_schema=AuthenticationSchema.BEARER_TOKEN, data={"token": os.getenv("SLACK_TOKEN")})
response = connector.connect(
authentication_schema=AuthenticationSchema.BEARER_TOKEN, data={"token": os.getenv("SLACK_TOKEN")}
)
connection_id = response.data["id"]

connection = ModelFactory.get(connection_id)
connection.action_scope = [action for action in connection.actions if action.code == "SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL"]
connection.action_scope = [
action for action in connection.actions if action.code == "SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL"
]

agent = AgentFactory.create(
name="Test Agent",
Expand All @@ -757,15 +761,22 @@ def test_agent_with_action_tool():
assert response is not None
assert response["status"].lower() == "success"
assert "helsinki" in response.data.output.lower()
assert "SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL" in [step["tool"] for step in response.data.intermediate_steps[0]["tool_steps"]]
assert "SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL" in [
step["tool"] for step in response.data.intermediate_steps[0]["tool_steps"]
]
connection.delete()


def test_agent_with_mcp_tool():
connector = ModelFactory.get("68549a33ba00e44f357896f1")
from aixplain.modules.model.integration import AuthenticationSchema

connector = ModelFactory.get("686eb9cd26480723d0634d3e")
# connect
response = connector.connect(
data="https://mcp.zapier.com/api/mcp/s/OTJiMjVlYjEtMGE4YS00OTVjLWIwMGYtZDJjOGVkNTc4NjFkOjI0MTNjNzg5LWZlNGMtNDZmNC05MDhmLWM0MGRlNDU4ZmU1NA==/mcp"
authentication_schema=AuthenticationSchema.API_KEY,
data={
"url": "https://mcp.zapier.com/api/mcp/s/OTJiMjVlYjEtMGE4YS00OTVjLWIwMGYtZDJjOGVkNTc4NjFkOjI0MTNjNzg5LWZlNGMtNDZmNC05MDhmLWM0MGRlNDU4ZmU1NA==/mcp"
},
)
connection_id = response.data["id"]
connection = ModelFactory.get(connection_id)
Expand Down
10 changes: 7 additions & 3 deletions tests/functional/team_agent/team_agent_functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_end2end(run_input_map, delete_agents_and_team_agents, TeamAgentFactory)
assert response["completed"] is True
assert response["status"].lower() == "success"
assert "data" in response
assert response["data"]["session_id"] is not None
assert response["data"]["session_id"] is None
assert response["data"]["output"] is not None

team_agent.delete()
Expand Down Expand Up @@ -447,11 +447,15 @@ def test_team_agent_with_slack_connector():

connector = ModelFactory.get("686432941223092cb4294d3f")
# connect
response = connector.connect(authentication_schema=AuthenticationSchema.BEARER_TOKEN, data={"token": os.getenv("SLACK_TOKEN")})
response = connector.connect(
authentication_schema=AuthenticationSchema.BEARER_TOKEN, data={"token": os.getenv("SLACK_TOKEN")}
)
connection_id = response.data["id"]

connection = ModelFactory.get(connection_id)
connection.action_scope = [action for action in connection.actions if action.code == "SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL"]
connection.action_scope = [
action for action in connection.actions if action.code == "SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL"
]

agent = AgentFactory.create(
name="Test Agent",
Expand Down