feat(api): enhance statistics storage management with scope options

- Introduced a new type `StatisticsStorageScope` to specify the scope for clearing statistics.
- Updated the `clearStatisticsStorage` API method to accept a scope parameter, allowing for selective clearing of detailed records or all statistics.
- Modified the demo API to handle the new scope parameter appropriately.
- Updated the SettingsPage component to include a selection for clearing scope, enhancing user control over statistics management.
- Added new translations for the updated messages related to statistics clearing in both English and Chinese.
This commit is contained in:
leookun
2026-08-28 10:18:11 +08:00
parent 217f984112
commit 71ddf71ec1
15 changed files with 514 additions and 111 deletions
+10
View File
@@ -672,7 +672,17 @@ async fn anthropic_raw_stream_uses_explicit_and_default_token_limits() {
server.abort();
assert_eq!(body["max_tokens"], 1234);
assert!(body.get("cache_control").is_none());
assert_eq!(
body["messages"][0]["content"][0]["cache_control"]["type"],
"ephemeral"
);
assert_eq!(default_body["max_tokens"], 65_000);
assert!(default_body.get("cache_control").is_none());
assert_eq!(
default_body["messages"][0]["content"][0]["cache_control"]["type"],
"ephemeral"
);
assert!(body.get("service_tier").is_none());
assert_eq!(body["messages"][0]["content"][1]["type"], "image");
assert_eq!(