meilisearch / meilisearch-rust

Rust wrapper for the Meilisearch API.
https://www.meilisearch.com
MIT License
350 stars 89 forks source link

[v1.6] support `embedders` setting #541

Open CommanderStorm opened 7 months ago

CommanderStorm commented 7 months ago

Description Currently, the embedders cannot be added via the sdk, only via http.

Basic example

instead of

curl \       
  -X PATCH 'http://localhost:7700/indexes/movies/settings' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "embedders": {
      "default": {
        "source": "huggingFace",
        "model": "bge-base-en-v1.5",
        "documentTemplate": "A movie titled '{{doc.title}}' whose description starts with {{doc.body|truncatewords: 20}}"
      }
    }
  }'
Settings::new().with_embedders(HashSet::from("default", Embedder::HuggingFace{...}))

Other If adding such features to the sdk BEFORE they are out of the experimental stage, I could implement this. If not, that is fine too ^^

CommanderStorm commented 6 months ago

@curquiza You added the enhancement label. Does this mean I can work on this, or do you think that experimental features should only be implemented once stable? ^^

curquiza commented 6 months ago

Sorry, you are right, I was not clear at all. Yes, you can work on this 😊

I'm curious, do you use this feature + rust SDK, or is it only to make an opensource contribution? 😊

CommanderStorm commented 6 months ago

I'm curious, do you use this feature + rust SDK

Yes, but not yet in production (in my uni, not a company). I have toyed with it in an experimental project and thought that adding this to the sdk might be a good excuse to learn how this should be configured.