feat(agent-platform): productize bot event route testing

This commit is contained in:
huanghuoguoguo
2026-07-11 10:44:50 +08:00
parent 4cbb9415bf
commit 00fb6f8236
17 changed files with 1313 additions and 376 deletions
@@ -69,6 +69,18 @@ class BotsRouterGroup(group.RouterGroup):
auth_type=group.AuthType.USER_TOKEN_OR_API_KEY,
)(_dry_run_event_route)
@self.route('/<bot_uuid>/event-routes/test', methods=['POST'], auth_type=group.AuthType.USER_TOKEN_OR_API_KEY)
async def _(bot_uuid: str) -> str:
json_data = await quart.request.json
if not isinstance(json_data, dict):
return self.http_status(400, -1, 'invalid request body')
result = await self.ap.bot_service.dispatch_test_event_route(
bot_uuid=bot_uuid,
event_type=json_data.get('event_type'),
payload=json_data.get('event_data', json_data.get('payload')),
)
return self.success(data=result)
@self.route('/<bot_uuid>/send_message', methods=['POST'], auth_type=group.AuthType.API_KEY)
async def _(bot_uuid: str) -> str:
json_data = await quart.request.json