Files
lcbp3/specs/200-fullstacks/225-ai-tool-layer-architecture/quickstart.md
T
admin ea5499123e
CI / CD Pipeline / build (push) Failing after 3m57s
CI / CD Pipeline / deploy (push) Has been skipped
690519:1631 224 to 226 AI #01
2026-05-19 16:31:50 +07:00

966 B

Quickstart: AI Tool Layer Architecture

Testing the Tool Layer Manually

You can test the tool registry directly through the NestJS REPL or by hitting the POST /ai/intent endpoint once the gateway is connected.

Example Request (Simulated)

POST /ai/intent
{
  "query": "Get the latest RFA for project A",
  "context": {
    "type": "project",
    "publicId": "019505a1-7c3e-7000-8000-abc123def456"
  }
}

Expected Response

If user is authorized:

{
  "intent": "GET_RFA",
  "confidence": 0.95,
  "result": {
    "ok": true,
    "data": [
      {
        "publicId": "019505a1-8d2b-7000-8000-112233445566",
        "rfaNumber": "RFA-001",
        "statusCode": "PENDING",
        ...
      }
    ]
  }
}

If user is unauthorized:

{
  "intent": "GET_RFA",
  "confidence": 0.95,
  "result": {
    "ok": false,
    "reason": "FORBIDDEN",
    "message": "ไม่มีสิทธิ์เข้าถึง RFA"
  }
}