(t *testing.T)
| 262 | } |
| 263 | |
| 264 | func TestInfer_RAG_UnknownKnowledgeBase400(t *testing.T) { |
| 265 | cfg := testConfigWithFileKB(t) |
| 266 | srv := New(cfg) |
| 267 | ts := httptest.NewServer(srv.Routes()) |
| 268 | defer ts.Close() |
| 269 | |
| 270 | status, body := postInfer(t, ts.URL, map[string]any{ |
| 271 | "request_type": "rag", |
| 272 | "tenant_id": "team-a", |
| 273 | "task_type": "simple", |
| 274 | "priority": "high", |
| 275 | "context": map[string]any{ |
| 276 | "knowledge_base": "does-not-exist", |
| 277 | "query": "hello", |
| 278 | }, |
| 279 | "input": map[string]any{"text": "hello"}, |
| 280 | "options": map[string]any{"stream": false, "max_tokens": 128}, |
| 281 | }) |
| 282 | if status != http.StatusBadRequest { |
| 283 | t.Fatalf("expected 400, got %d body=%s", status, string(body)) |
| 284 | } |
| 285 | assertStructuredError(t, body, errCodeRAGNotConfigured) |
| 286 | } |
| 287 | |
| 288 | func TestInfer_RAG_EmptyQuery400(t *testing.T) { |
| 289 | cfg := testConfigWithFileKB(t) |
nothing calls this directly
no test coverage detected