Skip to content

Commit f06e3d3

Browse files
AlfonsxhclaudeRockChinQ
authored
fix: disabling potential thinking param for model testing (#1733)
* fix: 禁用模型默认思考功能以减少测试延迟 - 调整导入语句顺序 - 为没有显式设置 thinking 参数的模型添加禁用配置 - 避免某些模型厂商默认开启思考功能导致的测试延迟 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: 确保 extra_args 为空时也禁用思考功能 修复条件判断逻辑,当 extra_args 为空字典时也会添加思考功能禁用配置 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * perf(fe): increase default timeout * perf: llm model testing prompt --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Junyan Qin <rockchinq@gmail.com>
1 parent 973e7ba commit f06e3d3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pkg/api/http/service/model.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from __future__ import annotations
22

33
import uuid
4+
45
import sqlalchemy
6+
from langbot_plugin.api.entities.builtin.provider import message as provider_message
57

68
from ....core import app
79
from ....entity.persistence import model as persistence_model
810
from ....entity.persistence import pipeline as persistence_pipeline
911
from ....provider.modelmgr import requester as model_requester
10-
from langbot_plugin.api.entities.builtin.provider import message as provider_message
1112

1213

1314
class LLMModelsService:
@@ -104,12 +105,17 @@ async def test_llm_model(self, model_uuid: str, model_data: dict) -> None:
104105
else:
105106
runtime_llm_model = await self.ap.model_mgr.init_runtime_llm_model(model_data)
106107

108+
# 有些模型厂商默认开启了思考功能,测试容易延迟
109+
extra_args = model_data.get('extra_args', {})
110+
if not extra_args or 'thinking' not in extra_args:
111+
extra_args['thinking'] = {'type': 'disabled'}
112+
107113
await runtime_llm_model.requester.invoke_llm(
108114
query=None,
109115
model=runtime_llm_model,
110-
messages=[provider_message.Message(role='user', content='Hello, world!')],
116+
messages=[provider_message.Message(role='user', content='Hello, world! Please just reply a "Hello".')],
111117
funcs=[],
112-
extra_args=model_data.get('extra_args', {}),
118+
extra_args=extra_args,
113119
)
114120

115121

web/src/app/infra/http/BaseHttpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export abstract class BaseHttpClient {
3838

3939
this.instance = axios.create({
4040
baseURL: baseURL,
41-
timeout: 15000,
41+
timeout: 30000,
4242
headers: {
4343
'Content-Type': 'application/json',
4444
},

0 commit comments

Comments
 (0)