mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-07 12:45:40 +00:00
Expose a well defined set of sources
This commit is contained in:
parent
1e67a47a8f
commit
bf3286ba41
@ -68,11 +68,17 @@ async fn patch_settings(
|
|||||||
Ok(HttpResponse::Ok().finish())
|
Ok(HttpResponse::Ok().finish())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields, rename_all = "camelCase")]
|
||||||
|
pub enum ChatSource {
|
||||||
|
OpenAi,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
#[serde(deny_unknown_fields, rename_all = "camelCase")]
|
#[serde(deny_unknown_fields, rename_all = "camelCase")]
|
||||||
pub struct GlobalChatSettings {
|
pub struct GlobalChatSettings {
|
||||||
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
|
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
|
||||||
pub source: Setting<String>,
|
pub source: Setting<ChatSource>,
|
||||||
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
|
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
|
||||||
pub base_api: Setting<String>,
|
pub base_api: Setting<String>,
|
||||||
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
|
#[serde(default, skip_serializing_if = "Setting::is_not_set")]
|
||||||
@ -146,7 +152,7 @@ Selecting the right index ensures the most relevant results for the user query";
|
|||||||
impl Default for GlobalChatSettings {
|
impl Default for GlobalChatSettings {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
GlobalChatSettings {
|
GlobalChatSettings {
|
||||||
source: Setting::Set("openAi".to_string()),
|
source: Setting::NotSet,
|
||||||
base_api: Setting::NotSet,
|
base_api: Setting::NotSet,
|
||||||
api_key: Setting::NotSet,
|
api_key: Setting::NotSet,
|
||||||
prompts: Setting::Set(ChatPrompts::default()),
|
prompts: Setting::Set(ChatPrompts::default()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user