feat(agent): activate BOC agent layer
- Add agent orchestrator API (/api/v1/agents/*) - Connect frontend AgentContext to real backend - Add AgentLayerPage with full agent management - Implement specialist agents: finance, sales, hr, crm, legal, marketing, dashboard - Add authentication, RBAC, tenant isolation on agent endpoints - Add rate limiting and audit logging - Update sidebar with Agent Layer navigation - Build fresh web-v2 dist
This commit is contained in:
Executable
+51
@@ -0,0 +1,51 @@
|
||||
#!/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 ==="
|
||||
Reference in New Issue
Block a user