From a4536b1381d80b9fc9f4283da36cbce8434057a7 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 13 Dec 2023 23:25:38 +0100 Subject: [PATCH] Small adjustments to respect the spec --- milli/src/vector/openai.rs | 2 ++ milli/src/vector/settings.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/milli/src/vector/openai.rs b/milli/src/vector/openai.rs index bab62f5e4..7ae626494 100644 --- a/milli/src/vector/openai.rs +++ b/milli/src/vector/openai.rs @@ -35,6 +35,8 @@ pub struct EmbedderOptions { #[deserr(rename_all = camelCase, deny_unknown_fields)] pub enum EmbeddingModel { #[default] + #[serde(rename = "text-embedding-ada-002")] + #[deserr(rename = "text-embedding-ada-002")] TextEmbeddingAda002, } diff --git a/milli/src/vector/settings.rs b/milli/src/vector/settings.rs index e37b0fde7..a91692613 100644 --- a/milli/src/vector/settings.rs +++ b/milli/src/vector/settings.rs @@ -243,8 +243,8 @@ pub struct OpenAiEmbedderSettings { #[serde(default, skip_serializing_if = "Setting::is_not_set")] #[deserr(default)] pub api_key: Setting, - #[serde(default, skip_serializing_if = "Setting::is_not_set")] - #[deserr(default)] + #[serde(default, skip_serializing_if = "Setting::is_not_set", rename = "model")] + #[deserr(default, rename = "model")] pub embedding_model: Setting, }