diff options
| author | sigoden <sigoden@gmail.com> | 2025-02-13 19:08:36 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-13 19:08:36 +0800 |
| commit | 9dfbdafe9f2c662c1d9dae96f3b850f4de5bca19 (patch) | |
| tree | 786634906e4c7df7aafe3c2df2ca83a5b93522db /src/client/model.rs | |
| parent | 3c21fac3665698bec860a49a66f5967e4449dc95 (diff) | |
| download | aichat-9dfbdafe9f2c662c1d9dae96f3b850f4de5bca19.tar.gz | |
feat: add model field `patch` (#1169)
Diffstat (limited to 'src/client/model.rs')
| -rw-r--r-- | src/client/model.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/model.rs b/src/client/model.rs index 6681856..a2865ab 100644 --- a/src/client/model.rs +++ b/src/client/model.rs @@ -9,6 +9,7 @@ use crate::utils::{estimate_token_length, strip_think_tag}; use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; +use serde_json::Value; use std::fmt::Display; const PER_MESSAGES_TOKENS: usize = 5; @@ -178,6 +179,10 @@ impl Model { } } + pub fn patch(&self) -> Option<&Value> { + self.data.patch.as_ref() + } + pub fn max_input_tokens(&self) -> Option<usize> { self.data.max_input_tokens } @@ -313,6 +318,8 @@ pub struct ModelData { pub input_price: Option<f64>, #[serde(skip_serializing_if = "Option::is_none")] pub output_price: Option<f64>, + #[serde(skip_serializing_if = "Option::is_none")] + pub patch: Option<Value>, // chat-only properties #[serde(skip_serializing_if = "Option::is_none")] |
