# Add tests with assertions
test = client.create_test(suite.id, {
"name": "Post welcome message",
"prompt": "Post a welcome message to #general",
"type": "actionEval",
"environmentTemplate": "slack_default",
"impersonateUserId": "U01AGENBOT9",
"expected_output": {
"assertions": [{
"diff_type": "added",
"entity": "messages",
"where": {
"channel_id": {"eq": "C01GENERAL99"},
"message_text": {"contains": "welcome"}
},
"expected_count": 1
}],
"ignore_fields": {
"global": ["ts", "message_id", "created_at"]
}
}
})
# Add another test
test2 = client.create_test(suite.id, {
"name": "Create thread reply",
"prompt": "Reply 'Got it!' to the latest message in #general",
"type": "actionEval",
"environmentTemplate": "slack_default",
"impersonateUserId": "U01AGENBOT9",
"expected_output": {
"assertions": [{
"diff_type": "added",
"entity": "messages",
"where": {
"parent_id": {"not_null": true},
"message_text": {"eq": "Got it!"}
}
}],
"ignore_fields": {
"global": ["ts", "message_id", "created_at"]
}
}
})