Stop hitting the embedder in test_sandbox_toc fixtures

This commit is contained in:
Yiorgis Gozadinos 2026-05-18 15:55:44 +03:00
parent 3b6bef3bfb
commit 84e91097a8
No known key found for this signature in database

View file

@ -16,14 +16,17 @@ from haiku.rag.agents.analysis.dependencies import AnalysisContext
from haiku.rag.agents.analysis.sandbox import Sandbox from haiku.rag.agents.analysis.sandbox import Sandbox
from haiku.rag.client import HaikuRAG from haiku.rag.client import HaikuRAG
from haiku.rag.config.models import AppConfig from haiku.rag.config.models import AppConfig
from haiku.rag.store.models.document import Document
from haiku.rag.store.models.document_item import DocumentItem from haiku.rag.store.models.document_item import DocumentItem
async def _empty_doc(client, *, uri: str, title: str) -> str: async def _empty_doc(client, *, uri: str, title: str) -> str:
"""Create a Document row and drop the auto-extracted items so the test """Create a Document row directly via the repository (no chunking, no
controls the items table exactly. Returns the document id.""" embedder) so these tests can run without a reachable embedding endpoint.
doc = await client.create_document(content="x", uri=uri, title=title) Returns the document id."""
await client.document_item_repository.delete_by_document_id(doc.id) doc = await client.document_repository.create(
Document(content="x", uri=uri, title=title)
)
return doc.id return doc.id