-
Notifications
You must be signed in to change notification settings - Fork 0
Multimodal embedder #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
76ae433
64f2913
ec8613e
42917f1
bfbd7b7
a54e3c2
9c0a9f4
17a9f1c
1e46b6e
8f49a56
1146514
cf6f84a
2db03ca
7ce73f3
52e86a3
438b957
c664c38
747e28f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2333,3 +2333,17 @@ def _build_url( | |||||||||||||||
| if primary_key is None and csv_delimiter is None: | ||||||||||||||||
| return f"{self.config.paths.index}/{self.uid}/{self.config.paths.document}" | ||||||||||||||||
| return f"{self.config.paths.index}/{self.uid}/{self.config.paths.document}?{parse.urlencode(parameters)}" | ||||||||||||||||
|
|
||||||||||||||||
| def compact(self) -> TaskInfo: | ||||||||||||||||
| """ | ||||||||||||||||
| Trigger the compaction of the index. | ||||||||||||||||
| This is an asynchronous operation in Meilisearch. | ||||||||||||||||
|
|
||||||||||||||||
| Returns | ||||||||||||||||
| ------- | ||||||||||||||||
| task_info: TaskInfo | ||||||||||||||||
| Contains information to track the progress of the compaction task. | ||||||||||||||||
|
||||||||||||||||
| Contains information to track the progress of the compaction task. | |
| Contains information to track the progress of the compaction task. | |
| Raises | |
| ------ | |
| MeilisearchApiError | |
| An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| """Tests for client experimental features methods.""" | ||
|
|
||
| def test_get_experimental_features(client): | ||
| """Test getting experimental features returns a dict including 'multimodal'.""" | ||
| response = client.get_experimental_features() | ||
|
|
||
| assert isinstance(response, dict) | ||
| assert len(response) > 0 | ||
| assert "multimodal" in response | ||
| assert isinstance(response["multimodal"], bool) | ||
|
|
||
|
|
||
| def test_update_experimental_features(client): | ||
| """Test updating experimental features and verify changes persist.""" | ||
| initial = client.get_experimental_features() | ||
| initial_multimodal = initial.get("multimodal", False) | ||
|
|
||
| # Toggle multimodal | ||
| new_value = not initial_multimodal | ||
| response = client.update_experimental_features({"multimodal": new_value}) | ||
|
|
||
| assert isinstance(response, dict) | ||
| assert response.get("multimodal") == new_value | ||
| assert client.get_experimental_features().get("multimodal") == new_value | ||
|
|
||
| # Reset to original value | ||
| client.update_experimental_features({"multimodal": initial_multimodal}) | ||
|
|
||
|
|
||
| def test_multimodal_idempotency_generic(client): | ||
| """Test that updating multimodal via generic method is idempotent.""" | ||
| # Enable twice | ||
| client.update_experimental_features({"multimodal": True}) | ||
| response = client.update_experimental_features({"multimodal": True}) | ||
| assert response.get("multimodal") is True | ||
|
|
||
| # Disable twice | ||
| client.update_experimental_features({"multimodal": False}) | ||
| response = client.update_experimental_features({"multimodal": False}) | ||
| assert response.get("multimodal") is False |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -152,6 +152,79 @@ def index_maker(index_uid=common.INDEX_UID, documents=small_movies): | |||
| return index_maker | ||||
|
|
||||
|
|
||||
| @fixture(scope="function") | ||||
| def mock_embedder_server(): | ||||
| """Fixture that starts a mock HTTP server to act as an embedder. | ||||
|
|
||||
| This server responds to embedding requests with fake vectors, | ||||
| allowing us to test search_with_media without a real AI service. | ||||
| """ | ||||
| from http.server import HTTPServer, BaseHTTPRequestHandler | ||||
| import threading | ||||
| import json | ||||
|
||||
| import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of the code sample is inconsistent with other entries in this YAML file. The code should start with 2 spaces (like other entries) but it starts with 4 spaces. This should be:
instead of: