diff --git a/core/server_extract.go b/core/server_extract.go index c057d39..9f77dd3 100644 --- a/core/server_extract.go +++ b/core/server_extract.go @@ -426,14 +426,14 @@ type batchExtractPayload struct { Mode string `json:"mode"` } -// batchExtractItem is the WebUI-compatible response item per URL. +// batchExtractItem is a response item for a single extracted URL, using +// page_content/metadata keys type batchExtractItem struct { PageContent string `json:"page_content"` Metadata map[string]string `json:"metadata"` } func (s *Server) handleBatchExtract(c *fiber.Ctx) error { - startedAt := time.Now() requestCtx := withRequestUsage(c.UserContext(), "extract-batch") c.SetUserContext(requestCtx) defer setNetworkBytesHeader(c, requestCtx) @@ -545,6 +545,5 @@ func (s *Server) handleBatchExtract(c *fiber.Ctx) error { } wg.Wait() - _ = startedAt return c.JSON(results) } diff --git a/core/server_extract_test.go b/core/server_extract_test.go index d8eaaa3..8baad7f 100644 --- a/core/server_extract_test.go +++ b/core/server_extract_test.go @@ -113,7 +113,7 @@ func TestValidateExtractTargetURLNormalizesBarePublicIP(t *testing.T) { } } -func TestBatchExtractReturnsWebUIFormat(t *testing.T) { +func TestBatchExtractSingleURL(t *testing.T) { target := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(`

Test Page

This is a test page with enough content to pass the minimum runes threshold for extraction in batch mode.

`)) diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 703f807..4998eec 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -420,8 +420,6 @@ paths: $ref: "#/components/headers/XRequestID" X-Cache: $ref: "#/components/headers/XCache" - X-Fallback-Engine: - $ref: "#/components/headers/XFallbackEngine" X-Proxy-Mode: $ref: "#/components/headers/XProxyMode" X-Proxy-Tag: @@ -554,12 +552,11 @@ paths: post: tags: [Extract] operationId: extractBatch - summary: Extract content from multiple URLs (WebUI-compatible) + summary: Extract content from multiple URLs description: > - Accepts an array of URLs and returns extracted page content in the - format expected by Open WebUI's ExternalWebLoader. Each result - contains `page_content` (markdown) and `metadata` (title, source, - lang, etc.). + Accepts an array of URLs and returns extracted page content for each + one. Each result contains `page_content` (markdown) and `metadata` + (title, source, lang, etc.). requestBody: required: true content: @@ -2069,7 +2066,7 @@ components: total: type: integer - # ── Batch extract (WebUI) ──────────────────────────────────────── + # ── Batch extract ───────────────────────────────────────────────── BatchExtractRequest: type: object required: [urls]