From 6d148c9c53cd4ac7849f52b956aba87e84cc3d4d Mon Sep 17 00:00:00 2001 From: sigoden Date: Sun, 23 Jun 2024 07:17:26 +0800 Subject: refactor: embedding model add price and dimension (#636) --- src/utils/prompt_input.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/utils') diff --git a/src/utils/prompt_input.rs b/src/utils/prompt_input.rs index e887b9f..26343a2 100644 --- a/src/utils/prompt_input.rs +++ b/src/utils/prompt_input.rs @@ -54,3 +54,21 @@ fn validate_integer(text: &str) -> Validation { Validation::Valid } } + +#[derive(Debug)] +pub struct SelectOption { + pub value: String, + pub description: String, +} + +impl SelectOption { + pub fn new(value: String, description: String) -> Self { + Self { value, description } + } +} + +impl std::fmt::Display for SelectOption { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{} ({})", self.value, self.description) + } +} -- cgit v1.2.3