Commit 836491c7 by sunqi02

feat: update send_test.sh to read group and agents from test_request.json for single message

1 parent fb0edc20
...@@ -42,40 +42,37 @@ if [ -z "$1" ]; then ...@@ -42,40 +42,37 @@ if [ -z "$1" ]; then
echo "==========================================" echo "=========================================="
else else
# ── 有参数:发送单条文本消息 ── # ── 有参数:读取 test_request.json 的 group+agents,替换 messages 为单条文本 ──
QUERY="$1" QUERY="$1"
GROUP_ID="${2:-EFD61E74ABE87CE0CE0C8D3529ED8B9E5194F219CF554649F1C4F9C615435A82}"
MSG_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") MSG_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
JSON_FILE="${SCRIPT_DIR}/test_request.json"
if [ ! -f "$JSON_FILE" ]; then
echo "错误: 找不到 ${JSON_FILE}"
exit 1
fi
echo "==========================================" echo "=========================================="
echo " 发送单条测试消息" echo " 发送单条测试消息"
echo "==========================================" echo "=========================================="
echo "" echo ""
echo "提问: ${QUERY}" echo "提问: ${QUERY}"
echo "群组: ${GROUP_ID}"
echo "" echo ""
PAYLOAD=$(python3 -c " PAYLOAD=$(python3 -c "
import json, sys import json, sys
print(json.dumps({ with open('${JSON_FILE}') as f:
'group': { base = json.load(f)
'group_contact_id': '${GROUP_ID}', base['messages'] = [{
'group_name': '测试群' 'msg_id': 'm1',
}, 'msg_time': '${MSG_TIME}',
'agents': [ 'sender_id': 'user_001',
{'agent_id': 11, 'bot_id': 'ABE6E30E3476E955853410C13E38C1065194F219CF554649F1C4F9C615435A82', 'is_steward': True}, 'sender_name': '测试用户',
{'agent_id': 17, 'bot_id': 'd53d00b08f8b4e22844ecfd0bb12e343', 'is_steward': False} 'msg_type': 'text',
], 'msg_content': sys.argv[1],
'messages': [{ 'payload': {}
'msg_id': 'm1', }]
'msg_time': '${MSG_TIME}', print(json.dumps(base, ensure_ascii=False, indent=2))
'sender_id': 'user_001',
'sender_name': '测试用户',
'msg_type': 'text',
'msg_content': sys.argv[1],
'payload': {}
}]
}, ensure_ascii=False, indent=2))
" "$QUERY") " "$QUERY")
echo "--- 请求体 ---" echo "--- 请求体 ---"
......
...@@ -25,15 +25,6 @@ ...@@ -25,15 +25,6 @@
"msg_type": "file", "msg_type": "file",
"msg_content": "https://glsk-agentic-test.oss-cn-shenzhen.aliyuncs.com/meeting-minutes%2Faudio%2F1219%E4%BA%8C%E6%89%8B%E8%BD%A6%E4%BE%8B%E4%BC%9A%EF%BC%88%E8%B5%B5%E6%80%BB%EF%BC%89.mp3", "msg_content": "https://glsk-agentic-test.oss-cn-shenzhen.aliyuncs.com/meeting-minutes%2Faudio%2F1219%E4%BA%8C%E6%89%8B%E8%BD%A6%E4%BE%8B%E4%BC%9A%EF%BC%88%E8%B5%B5%E6%80%BB%EF%BC%89.mp3",
"payload": {} "payload": {}
},
{
"msg_id": "m4",
"msg_time": "2026-05-26T10:00:00Z",
"sender_id": "",
"sender_name": "孙奇",
"msg_type": "text",
"msg_content": "请帮我总结一下这次会议的内容和结论",
"payload": {}
} }
] ]
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!