mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-02-06 02:23:27 +01:00
Merge #5306
5306: Fix internal error when passing `documentTemplateMaxBytes` to a source that doesn't support it r=ManyTheFish a=dureuill # Pull Request ## Related issue Fixes #5305 ## What does this PR do? - add `DOCUMENT_TEMPLATE_MAX_BYTES` to `allowed_sources_for_field` and `allowed_fields_for_source` to prevent a panic Co-authored-by: Louis Dureuil <louis@meilisearch.com>
This commit is contained in:
commit
ede74ccc42
@ -32,7 +32,7 @@ async fn field_unavailable_for_source() {
|
|||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
snapshot!(response, @r###"
|
snapshot!(response, @r###"
|
||||||
{
|
{
|
||||||
"message": "`.embedders.default`: Field `revision` unavailable for source `openAi` (only available for sources: `huggingFace`). Available fields: `source`, `model`, `apiKey`, `documentTemplate`, `dimensions`, `distribution`, `url`, `binaryQuantized`",
|
"message": "`.embedders.default`: Field `revision` unavailable for source `openAi` (only available for sources: `huggingFace`). Available fields: `source`, `model`, `apiKey`, `documentTemplate`, `documentTemplateMaxBytes`, `dimensions`, `distribution`, `url`, `binaryQuantized`",
|
||||||
"code": "invalid_settings_embedders",
|
"code": "invalid_settings_embedders",
|
||||||
"type": "invalid_request",
|
"type": "invalid_request",
|
||||||
"link": "https://docs.meilisearch.com/errors#invalid_settings_embedders"
|
"link": "https://docs.meilisearch.com/errors#invalid_settings_embedders"
|
||||||
|
@ -455,7 +455,7 @@ impl EmbeddingSettings {
|
|||||||
EmbedderSource::Ollama,
|
EmbedderSource::Ollama,
|
||||||
EmbedderSource::Rest,
|
EmbedderSource::Rest,
|
||||||
],
|
],
|
||||||
Self::DOCUMENT_TEMPLATE => &[
|
Self::DOCUMENT_TEMPLATE | Self::DOCUMENT_TEMPLATE_MAX_BYTES => &[
|
||||||
EmbedderSource::HuggingFace,
|
EmbedderSource::HuggingFace,
|
||||||
EmbedderSource::OpenAi,
|
EmbedderSource::OpenAi,
|
||||||
EmbedderSource::Ollama,
|
EmbedderSource::Ollama,
|
||||||
@ -490,6 +490,7 @@ impl EmbeddingSettings {
|
|||||||
Self::MODEL,
|
Self::MODEL,
|
||||||
Self::API_KEY,
|
Self::API_KEY,
|
||||||
Self::DOCUMENT_TEMPLATE,
|
Self::DOCUMENT_TEMPLATE,
|
||||||
|
Self::DOCUMENT_TEMPLATE_MAX_BYTES,
|
||||||
Self::DIMENSIONS,
|
Self::DIMENSIONS,
|
||||||
Self::DISTRIBUTION,
|
Self::DISTRIBUTION,
|
||||||
Self::URL,
|
Self::URL,
|
||||||
@ -500,6 +501,7 @@ impl EmbeddingSettings {
|
|||||||
Self::MODEL,
|
Self::MODEL,
|
||||||
Self::REVISION,
|
Self::REVISION,
|
||||||
Self::DOCUMENT_TEMPLATE,
|
Self::DOCUMENT_TEMPLATE,
|
||||||
|
Self::DOCUMENT_TEMPLATE_MAX_BYTES,
|
||||||
Self::DISTRIBUTION,
|
Self::DISTRIBUTION,
|
||||||
Self::BINARY_QUANTIZED,
|
Self::BINARY_QUANTIZED,
|
||||||
],
|
],
|
||||||
@ -507,6 +509,7 @@ impl EmbeddingSettings {
|
|||||||
Self::SOURCE,
|
Self::SOURCE,
|
||||||
Self::MODEL,
|
Self::MODEL,
|
||||||
Self::DOCUMENT_TEMPLATE,
|
Self::DOCUMENT_TEMPLATE,
|
||||||
|
Self::DOCUMENT_TEMPLATE_MAX_BYTES,
|
||||||
Self::URL,
|
Self::URL,
|
||||||
Self::API_KEY,
|
Self::API_KEY,
|
||||||
Self::DIMENSIONS,
|
Self::DIMENSIONS,
|
||||||
@ -521,6 +524,7 @@ impl EmbeddingSettings {
|
|||||||
Self::API_KEY,
|
Self::API_KEY,
|
||||||
Self::DIMENSIONS,
|
Self::DIMENSIONS,
|
||||||
Self::DOCUMENT_TEMPLATE,
|
Self::DOCUMENT_TEMPLATE,
|
||||||
|
Self::DOCUMENT_TEMPLATE_MAX_BYTES,
|
||||||
Self::URL,
|
Self::URL,
|
||||||
Self::REQUEST,
|
Self::REQUEST,
|
||||||
Self::RESPONSE,
|
Self::RESPONSE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user