Complete local hybrid search and improve agent reliability

This commit is contained in:
Hamza Ayed
2026-10-02 23:38:02 +03:00
parent 3563a104a3
commit 140f6eb287
62 changed files with 7546 additions and 314 deletions
@@ -0,0 +1,19 @@
import unittest
from unittest.mock import patch
from app.embeddings import EmbeddingUnavailable, embed_texts
class EmbeddingTests(unittest.IsolatedAsyncioTestCase):
async def test_empty_model_setting_reports_disabled_embedding(self) -> None:
with patch.dict("os.environ", {"KNOWLEDGE_EMBEDDING_MODEL": ""}):
with self.assertRaises(EmbeddingUnavailable):
await embed_texts(["sample"])
async def test_empty_input_needs_no_embedding_model(self) -> None:
with patch.dict("os.environ", {"KNOWLEDGE_EMBEDDING_MODEL": ""}):
self.assertEqual(await embed_texts([]), [])
if __name__ == "__main__":
unittest.main()