fix: ai_data_masking add compatibility handling for non-compliant API response structures (#2130)

This commit is contained in:
007gzs
2025-04-27 14:31:02 +08:00
committed by GitHub
parent 52114b37f8
commit e381806ba0
2 changed files with 7 additions and 1 deletions

View File

@@ -202,6 +202,7 @@ pub struct AiDataMaskingConfig {
#[derive(Debug, Deserialize, Clone)]
struct Message {
#[serde(default)]
content: String,
}
#[derive(Debug, Deserialize, Clone)]
@@ -221,8 +222,11 @@ struct ResMessage {
#[derive(Default, Debug, Deserialize, Serialize, Clone)]
struct Usage {
#[serde(default)]
completion_tokens: i32,
#[serde(default)]
prompt_tokens: i32,
#[serde(default)]
total_tokens: i32,
}