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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user