Stop hitting the embedder in test_sandbox_toc fixtures
This commit is contained in:
parent
3b6bef3bfb
commit
84e91097a8
1 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue