From 9dfbdafe9f2c662c1d9dae96f3b850f4de5bca19 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 13 Feb 2025 19:08:36 +0800 Subject: feat: add model field `patch` (#1169) --- src/client/model.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/client/model.rs') 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 { self.data.max_input_tokens } @@ -313,6 +318,8 @@ pub struct ModelData { pub input_price: Option, #[serde(skip_serializing_if = "Option::is_none")] pub output_price: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub patch: Option, // chat-only properties #[serde(skip_serializing_if = "Option::is_none")] -- cgit v1.2.3