mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Make sure to use the system prompt
This commit is contained in:
parent
70670c3be4
commit
717a026fdd
2 changed files with 51 additions and 20 deletions
|
@ -102,16 +102,24 @@ pub enum ChatCompletionSource {
|
|||
VLlm,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum SystemRole {
|
||||
System,
|
||||
Developer,
|
||||
}
|
||||
|
||||
impl ChatCompletionSource {
|
||||
pub fn system_role(&self, model: &str) -> &'static str {
|
||||
pub fn system_role(&self, model: &str) -> SystemRole {
|
||||
use ChatCompletionSource::*;
|
||||
use SystemRole::*;
|
||||
match self {
|
||||
ChatCompletionSource::OpenAi if Self::old_openai_model(model) => "system",
|
||||
ChatCompletionSource::OpenAi => "developer",
|
||||
ChatCompletionSource::AzureOpenAi if Self::old_openai_model(model) => "system",
|
||||
ChatCompletionSource::AzureOpenAi => "developer",
|
||||
ChatCompletionSource::Mistral => "system",
|
||||
ChatCompletionSource::Gemini => "system",
|
||||
ChatCompletionSource::VLlm => "system",
|
||||
OpenAi if Self::old_openai_model(model) => System,
|
||||
OpenAi => Developer,
|
||||
AzureOpenAi if Self::old_openai_model(model) => System,
|
||||
AzureOpenAi => Developer,
|
||||
Mistral => System,
|
||||
Gemini => System,
|
||||
VLlm => System,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue