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