summaryrefslogtreecommitdiffstats
path: root/src/config/model_info.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/model_info.rs')
-rw-r--r--src/config/model_info.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/config/model_info.rs b/src/config/model_info.rs
new file mode 100644
index 0000000..1f8d6f0
--- /dev/null
+++ b/src/config/model_info.rs
@@ -0,0 +1,27 @@
+#[derive(Debug, Clone)]
+pub struct ModelInfo {
+ pub client: String,
+ pub name: String,
+ pub max_tokens: Option<usize>,
+ pub index: usize,
+}
+
+impl Default for ModelInfo {
+ fn default() -> Self {
+ ModelInfo::new("", "", None, 0)
+ }
+}
+
+impl ModelInfo {
+ pub fn new(client: &str, name: &str, max_tokens: Option<usize>, index: usize) -> Self {
+ Self {
+ client: client.into(),
+ name: name.into(),
+ max_tokens,
+ index,
+ }
+ }
+ pub fn stringify(&self) -> String {
+ format!("{}:{}", self.client, self.name)
+ }
+}