Dynamic embeddings model (#556)

* Dynamic embeddings model selection

* Added tests

* HF embeddings are skipped, tests don't run with that package currently tests
This commit is contained in:
cybermaggedon 2025-11-10 20:38:01 +00:00 committed by GitHub
parent 6129bb68c1
commit d9d4c91363
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 816 additions and 11 deletions

View file

@ -28,12 +28,14 @@ class Processor(EmbeddingsService):
)
self.client = Client(host=ollama)
self.model = model
self.default_model = model
async def on_embeddings(self, text):
async def on_embeddings(self, text, model=None):
use_model = model or self.default_model
embeds = self.client.embed(
model = self.model,
model = use_model,
input = text
)