Skip to content

Commit ac75fb2

Browse files
committed
*修复自定义Deepseek服务器地址重启应用失效问题 fix #73
*修复推理过程中,字符统计问题 *修改配置OpenAI自定义服务器地址文案
1 parent d8019d0 commit ac75fb2

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ private void checkPremiumSelf(TLRPC.User oldUser, TLRPC.User newUser) {
522522
apiServerClaude = preferences.getString("apiServerClaude", defaultApiServerClaude);
523523

524524
apiKeyDeepseek = preferences.getString("apiKeyDeepseek", "");
525-
apiServerClaude = preferences.getString("apiServerClaude", defaultApiServerDeepseek);
525+
apiServerDeepseek = preferences.getString("apiServerDeepseek", defaultApiServerDeepseek);
526526
}
527527

528528
configLoaded = true;

TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAvatarContainer.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,18 @@ public void onAnimationEnd(Animator animation) {
917917
}
918918

919919
if (messageOwner.message != null) {
920-
// todo 是否deepseek计算思考的字数
921-
tempWords = tempWords + messageOwner.message.length();
920+
921+
int count = 0;
922+
if (MessageObject.isReasoningMessage(messageOwner.reasoningMessage)) {
923+
// 解决空白更新,导致字符变动
924+
if (!messageOwner.message.isBlank()) {
925+
count = messageOwner.message.length();
926+
}
927+
} else {
928+
count = messageOwner.message.length();
929+
}
930+
931+
tempWords = tempWords + count;
922932
}
923933
}
924934
}

TMessagesProj/src/main/res/values-zh/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4203,7 +4203,7 @@
42034203
<string name="EmailMe">给我发邮件</string>
42044204
<string name="FaqUrl">https://github.com/flyun/chatAir/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98</string>
42054205
<string name="ChangeApiServerMoreInfo">查看配置自定义Server教程</string>
4206-
<string name="ChangeApiServerTips">符合OpenAI协议,可配置自定义Server。输入聊天请求接口网址,会自动匹配自定义Server。\n\nOpenAI可配置 https://api.openai.com/v1/chat/completions/ 或者 https://api.openai.com/</string>
4206+
<string name="ChangeApiServerTips">符合OpenAI协议,可配置自定义Server。输入聊天请求接口网址,会自动匹配自定义Server。\n\n例如聊天请求接口网址 https://a.b.com/chat/completions/ 可配置 https://a.b.com/chat/completions/\n\nOpenAI可配置 https://api.openai.com/v1/chat/completions/ 或者 https://api.openai.com/</string>
42074207
<string name="ChangeApiServerMoreInfoUrl">https://github.com/flyun/chatAir/wiki/%E9%85%8D%E7%BD%AE%E8%87%AA%E5%AE%9A%E4%B9%89%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%95%99%E7%A8%8B</string>
42084208
<string name="ChangeClaudeApiServerTips">符合Claude协议,可配置自定义Server。输入聊天请求接口网址,会自动匹配自定义Server。\n\nClaude可配置 https://api.anthropic.com/v1/ 或者 https://api.anthropic.com/</string>
42094209
<string name="ChangeDeepseekApiServerTips">符合DeepSeek协议,可配置自定义Server。输入聊天请求接口网址,会自动匹配自定义Server。\n\nDeepSeek可配置 https://api.deepseek.com/v1/chat/completions/ 或者 https://api.deepseek.com/</string>

TMessagesProj/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3608,7 +3608,7 @@
36083608
<string name="AskAQuestionUrl">https://github.com/flyun/chatAir/discussions</string>
36093609
<string name="FaqUrl">https://github.com/flyun/chatAir/wiki/Common-problem</string>
36103610
<string name="ChangeApiServerMoreInfo">View the Configuring a Custom Server tutorial</string>
3611-
<string name="ChangeApiServerTips">Complies with the OpenAI protocol and can configure a custom Server.Enter the chat request interface URL and it will automatically match the custom Server.\n\nOpenAI can be configured with https://api.openai.com/v1/chat/completions/ or https://api.openai.com/</string>
3611+
<string name="ChangeApiServerTips">Complies with the OpenAI protocol and can configure a custom Server.Enter the chat request interface URL and it will automatically match the custom Server.\n\nFor example, the chat request interface URL is https://a.b.com/chat/completions/ and can be configured as https://a.b.com/chat/completions/\n\nOpenAI can be configured with https://api.openai.com/v1/chat/completions/ or https://api.openai.com/</string>
36123612
<string name="ChangeApiServerMoreInfoUrl">https://github.com/flyun/chatAir/wiki/Configuring-a-custom-server-tutorial</string>
36133613
<string name="ChangeClaudeApiServerTips">Complies with the Calude protocol and can configure a custom Server.Enter the chat request interface URL and it will automatically match the custom Server.\n\nCalude can be configured with https://api.anthropic.com/v1/ messages or https://api.anthropic.com/</string>
36143614
<string name="ChangeDeepseekApiServerTips">Complies with the DeepSeek protocol and can configure a custom Server.Enter the chat request interface URL and it will automatically match the custom Server.\n\nDeepSeek can be configured with https://api.deepseek.com/v1/chat/completions/ or https://api.deepseek.com/</string>

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1414
# org.gradle.parallel=true
1515
#Sat Mar 12 05:53:50 MSK 2016
16-
APP_VERSION_CODE=21
17-
APP_VERSION_NAME=1.2.1
16+
APP_VERSION_CODE=22
17+
APP_VERSION_NAME=1.2.2
1818
APP_PACKAGE=info.flyun.chatair
1919
RELEASE_KEY_PASSWORD=android
2020
RELEASE_KEY_ALIAS=androidkey

0 commit comments

Comments
 (0)