mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-06 04:05:37 +00:00
Support base_api in the settings
This commit is contained in:
parent
9af1a29949
commit
64fe283abc
@ -186,10 +186,9 @@ async fn non_streamed_chat(
|
||||
if let Some(api_key) = chat_settings.api_key.as_ref() {
|
||||
config = config.with_api_key(api_key);
|
||||
}
|
||||
// We cannot change the endpoint
|
||||
// if let Some(endpoint) = chat_settings.endpoint.as_ref() {
|
||||
// config.with_api_base(&endpoint);
|
||||
// }
|
||||
if let Some(base_api) = chat_settings.base_api.as_ref() {
|
||||
config = config.with_api_base(base_api);
|
||||
}
|
||||
let client = Client::with_config(config);
|
||||
|
||||
setup_search_tool(&mut chat_completion, &chat_settings.prompts);
|
||||
@ -257,10 +256,9 @@ async fn streamed_chat(
|
||||
if let Some(api_key) = chat_settings.api_key.as_ref() {
|
||||
config = config.with_api_key(api_key);
|
||||
}
|
||||
// We cannot change the endpoint
|
||||
// if let Some(endpoint) = chat_settings.endpoint.as_ref() {
|
||||
// config.with_api_base(&endpoint);
|
||||
// }
|
||||
if let Some(base_api) = chat_settings.base_api.as_ref() {
|
||||
config = config.with_api_base(base_api);
|
||||
}
|
||||
|
||||
setup_search_tool(&mut chat_completion, &chat_settings.prompts);
|
||||
|
||||
|
@ -48,7 +48,7 @@ async fn patch_settings(
|
||||
#[serde(deny_unknown_fields, rename_all = "camelCase")]
|
||||
pub struct ChatSettings {
|
||||
pub source: String,
|
||||
pub endpoint: Option<String>,
|
||||
pub base_api: Option<String>,
|
||||
pub api_key: Option<String>,
|
||||
pub prompts: ChatPrompts,
|
||||
pub indexes: BTreeMap<String, ChatIndexSettings>,
|
||||
@ -95,7 +95,7 @@ impl Default for ChatSettings {
|
||||
fn default() -> Self {
|
||||
ChatSettings {
|
||||
source: "openai".to_string(),
|
||||
endpoint: None,
|
||||
base_api: None,
|
||||
api_key: None,
|
||||
prompts: ChatPrompts {
|
||||
system: DEFAULT_SYSTEM_MESSAGE.to_string(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user