52 lines
1.5 KiB
Bash
52 lines
1.5 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
set -e
|
||
|
|
|
||
|
|
echo "=== BOC Agent Layer API Test ==="
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# Test 1: Agent Status Endpoint
|
||
|
|
echo "Test 1: GET /api/agent/status"
|
||
|
|
curl -s http://localhost:9092/api/agent/status | jq . 2>/dev/null || echo "Failed"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# Test 2: Agent Chat Endpoint - CRM
|
||
|
|
echo "Test 2: POST /api/agent/chat (CRM)"
|
||
|
|
curl -s -X POST http://localhost:9092/api/agent/chat \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-d '{
|
||
|
|
"rum": "crm",
|
||
|
|
"systemPrompt": "Du är CRM Agent. Hjälp användaren med kundrelationer.",
|
||
|
|
"meddelanden": [
|
||
|
|
{"roll": "user", "innehall": "Hur många kunder har vi?"}
|
||
|
|
]
|
||
|
|
}' | jq . 2>/dev/null || echo "Failed"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# Test 3: Agent Chat Endpoint - Finance
|
||
|
|
echo "Test 3: POST /api/agent/chat (Finance)"
|
||
|
|
curl -s -X POST http://localhost:9092/api/agent/chat \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-d '{
|
||
|
|
"rum": "finance",
|
||
|
|
"systemPrompt": "Du är Finance Agent. Hjälp användaren med finansiella frågor.",
|
||
|
|
"meddelanden": [
|
||
|
|
{"roll": "user", "innehall": "Vad är vår cash position?"}
|
||
|
|
]
|
||
|
|
}' | jq . 2>/dev/null || echo "Failed"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# Test 4: Agent Chat Endpoint - HR
|
||
|
|
echo "Test 4: POST /api/agent/chat (HR)"
|
||
|
|
curl -s -X POST http://localhost:9092/api/agent/chat \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-d '{
|
||
|
|
"rum": "hr",
|
||
|
|
"systemPrompt": "Du är HR Agent. Hjälp användaren med personalfrågor.",
|
||
|
|
"meddelanden": [
|
||
|
|
{"roll": "user", "innehall": "Hur många anställda har vi?"}
|
||
|
|
]
|
||
|
|
}' | jq . 2>/dev/null || echo "Failed"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
echo "=== Test Complete ==="
|