Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(ai): enable temperature for Kimi models and default to 1.0

t8y2dc90a80468a3
diff --git a/crates/dbx-core/src/ai.rs b/crates/dbx-core/src/ai.rs
index 4478bbef7f..0495ef876e 100644
--- a/crates/dbx-core/src/ai.rs
+++ b/crates/dbx-core/src/ai.rs
@@ -436,12 +436,13 @@ fn is_kimi_model(model: &str) -> bool {
}
pub fn supports_temperature(config: &AiConfig) -> bool {
- !(is_openai_api_config(config) && is_openai_reasoning_model(&config.model)) && !is_kimi_model(&config.model)
+ !(is_openai_api_config(config) && is_openai_reasoning_model(&config.model))
}
pub fn add_temperature_if_supported(body: &mut serde_json::Value, request: &AiCompletionRequest) {
if supports_temperature(&request.config) {
- body["temperature"] = json!(request.temperature.unwrap_or(0.2));
+ let default_temp = if is_kimi_model(&request.config.model) { 1.0 } else { 0.2 };
+ body["temperature"] = json!(request.temperature.unwrap_or(default_temp));
}
}