(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestAdapterConformance_VLLM(t *testing.T) { |
| 32 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 33 | switch r.URL.Path { |
| 34 | case "/health": |
| 35 | w.WriteHeader(http.StatusOK) |
| 36 | _, _ = w.Write([]byte(`{"status":"ok"}`)) |
| 37 | case "/v1/chat/completions": |
| 38 | w.Header().Set("Content-Type", "application/json") |
| 39 | _ = json.NewEncoder(w).Encode(map[string]any{ |
| 40 | "choices": []map[string]any{ |
| 41 | {"message": map[string]any{"content": "hello from vllm"}}, |
| 42 | }, |
| 43 | }) |
| 44 | default: |
| 45 | http.NotFound(w, r) |
| 46 | } |
| 47 | })) |
| 48 | defer srv.Close() |
| 49 | |
| 50 | adapter := vllm.New(config.BackendConfig{ |
| 51 | Name: "vllm-b", |
| 52 | Type: "vllm", |
| 53 | Endpoint: srv.URL, |
| 54 | TimeoutMS: 200, |
| 55 | Capabilities: []string{"chat"}, |
| 56 | Cost: config.CostConfig{Unit: 2}, |
| 57 | }) |
| 58 | assertAdapterConformance(t, adapter) |
| 59 | } |
| 60 | |
| 61 | func TestAdapterConformance_Anthropic(t *testing.T) { |
| 62 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected