Skip to content

Commit 2d1c0b5

Browse files
authored
Fix tests by passing embedder (#1020)
* Add new settings to model * Specify "embedder": "default" as is now required
1 parent e948e72 commit 2d1c0b5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

meilisearch/models/index.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,19 @@ class ProximityPrecision(str, Enum):
5656

5757
class OpenAiEmbedder(CamelBase):
5858
source: str = "openAi"
59-
model: Optional[str] = None # Defaults to text-embedding-ada-002
59+
model: Optional[str] = None # Defaults to text-embedding-3-small
6060
dimensions: Optional[int] = None # Uses the model default
6161
api_key: Optional[str] = None # Can be provided through a CLI option or environment variable
6262
document_template: Optional[str] = None
63+
document_template_max_bytes: Optional[int] = None # Default to 400
6364

6465

6566
class HuggingFaceEmbedder(CamelBase):
6667
source: str = "huggingFace"
6768
model: Optional[str] = None # Defaults to BAAI/bge-base-en-v1.5
6869
revision: Optional[str] = None
6970
document_template: Optional[str] = None
71+
document_template_max_bytes: Optional[int] = None # Default to 400
7072

7173

7274
class UserProvidedEmbedder(CamelBase):

tests/index/test_index_search_meilisearch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ def test_show_ranking_score(index_with_documents):
505505
@pytest.mark.usefixtures("enable_vector_search")
506506
def test_vector_search(index_with_documents_and_vectors):
507507
response = index_with_documents_and_vectors().search(
508-
"", opt_params={"vector": [0.1, 0.2], "hybrid": {"semanticRatio": 1.0}}
508+
"",
509+
opt_params={"vector": [0.1, 0.2], "hybrid": {"semanticRatio": 1.0, "embedder": "default"}},
509510
)
510511
assert len(response["hits"]) > 0
511512

0 commit comments

Comments
 (0)