Fix embedding client endpoint paths

The embedding-service exposes endpoints at root level (/chunk, /embed,
/extract-pdf, /rerank) not under /api/v1/. Fix the RAG service's
embedding client to use the correct paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-02-26 23:24:47 +01:00
parent 0ac23089f4
commit 13ba1457b0

View File

@@ -30,7 +30,7 @@ class EmbeddingClient:
""" """
async with httpx.AsyncClient(timeout=_TIMEOUT) as client: async with httpx.AsyncClient(timeout=_TIMEOUT) as client:
response = await client.post( response = await client.post(
self._url("/api/v1/embeddings"), self._url("/embed"),
json={"texts": texts}, json={"texts": texts},
) )
response.raise_for_status() response.raise_for_status()
@@ -60,7 +60,7 @@ class EmbeddingClient:
""" """
async with httpx.AsyncClient(timeout=_TIMEOUT) as client: async with httpx.AsyncClient(timeout=_TIMEOUT) as client:
response = await client.post( response = await client.post(
self._url("/api/v1/rerank"), self._url("/rerank"),
json={ json={
"query": query, "query": query,
"documents": documents, "documents": documents,
@@ -88,7 +88,7 @@ class EmbeddingClient:
""" """
async with httpx.AsyncClient(timeout=_TIMEOUT) as client: async with httpx.AsyncClient(timeout=_TIMEOUT) as client:
response = await client.post( response = await client.post(
self._url("/api/v1/chunk"), self._url("/chunk"),
json={ json={
"text": text, "text": text,
"strategy": strategy, "strategy": strategy,
@@ -111,7 +111,7 @@ class EmbeddingClient:
""" """
async with httpx.AsyncClient(timeout=_TIMEOUT) as client: async with httpx.AsyncClient(timeout=_TIMEOUT) as client:
response = await client.post( response = await client.post(
self._url("/api/v1/extract-pdf"), self._url("/extract-pdf"),
files={"file": ("document.pdf", pdf_bytes, "application/pdf")}, files={"file": ("document.pdf", pdf_bytes, "application/pdf")},
) )
response.raise_for_status() response.raise_for_status()