Allow actually passing dimensions for OpenAI source

-> make sure the settings change is rejected or the settings task fails when the specified model doesn't support
overriding `dimensions` and the passed `dimensions` differs from the model's default dimensions.
This commit is contained in:
Louis Dureuil 2024-02-07 10:39:19 +01:00
parent 9ac5750096
commit 517f5332d6
No known key found for this signature in database
4 changed files with 47 additions and 9 deletions

View file

@ -227,6 +227,13 @@ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and undersco
source_: crate::vector::settings::EmbedderSource,
embedder_name: String,
},
#[error("`.embedders.{embedder_name}.dimensions`: Model `{model}` does not support overriding its native dimensions of {expected_dimensions}. Found {dimensions}")]
InvalidOpenAiModelDimensions {
embedder_name: String,
model: &'static str,
dimensions: usize,
expected_dimensions: usize,
},
}
impl From<crate::vector::Error> for Error {