model selector and model suggestions

This commit is contained in:
LUIS NOVO 2024-11-13 14:48:00 -03:00
parent 80353a97c9
commit 9ba5709a3c
8 changed files with 182 additions and 115 deletions

View file

@ -112,8 +112,6 @@ class ObjectModel(BaseModel):
from open_notebook.domain.models import model_manager
from open_notebook.models import EmbeddingModel
EMBEDDING_MODEL: EmbeddingModel = model_manager.embedding_model
try:
self.model_validate(self.model_dump(), strict=True)
data = self._prepare_save_data()
@ -122,6 +120,7 @@ class ObjectModel(BaseModel):
if self.needs_embedding():
embedding_content = self.get_embedding_content()
if embedding_content:
EMBEDDING_MODEL: EmbeddingModel = model_manager.embedding_model
data["embedding"] = EMBEDDING_MODEL.embed(embedding_content)
if self.id is None: