zeta2: Add prompt format option to inspector (#38884)
Adds the new prompt format option to the inspector view Release Notes: - N/A Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
co-authored by
Bennet Bo Fenner
parent
c0f56f500e
commit
b2b90b003d
@@ -5,6 +5,7 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
};
|
||||
use strum::EnumIter;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::PredictEditsGitInfo;
|
||||
@@ -42,13 +43,28 @@ pub struct PredictEditsRequest {
|
||||
pub prompt_format: PromptFormat,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
|
||||
#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize, PartialEq, EnumIter)]
|
||||
pub enum PromptFormat {
|
||||
#[default]
|
||||
MarkedExcerpt,
|
||||
LabeledSections,
|
||||
}
|
||||
|
||||
impl PromptFormat {
|
||||
pub fn iter() -> impl Iterator<Item = Self> {
|
||||
<Self as strum::IntoEnumIterator>::iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for PromptFormat {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
PromptFormat::MarkedExcerpt => write!(f, "Marked Excerpt"),
|
||||
PromptFormat::LabeledSections => write!(f, "Labeled Sections"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "test-support"), derive(PartialEq))]
|
||||
#[serde(tag = "event")]
|
||||
|
||||
Reference in New Issue
Block a user