Complete local hybrid search and improve agent reliability
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user