assistant: Add display_name for OpenAI and Gemini (#17508)
This commit is contained in:
parent
85f4c96fef
commit
fb9d01b0d5
8 changed files with 34 additions and 16 deletions
|
@ -304,7 +304,12 @@ pub enum Model {
|
|||
#[serde(rename = "gemini-1.5-flash")]
|
||||
Gemini15Flash,
|
||||
#[serde(rename = "custom")]
|
||||
Custom { name: String, max_tokens: usize },
|
||||
Custom {
|
||||
name: String,
|
||||
/// The name displayed in the UI, such as in the assistant panel model dropdown menu.
|
||||
display_name: Option<String>,
|
||||
max_tokens: usize,
|
||||
},
|
||||
}
|
||||
|
||||
impl Model {
|
||||
|
@ -320,7 +325,9 @@ impl Model {
|
|||
match self {
|
||||
Model::Gemini15Pro => "Gemini 1.5 Pro",
|
||||
Model::Gemini15Flash => "Gemini 1.5 Flash",
|
||||
Model::Custom { name, .. } => name,
|
||||
Self::Custom {
|
||||
name, display_name, ..
|
||||
} => display_name.as_ref().unwrap_or(name),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue