调整 AI 模型不要思考,以及添加 Wolfx 日志详细程度
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
2026-06-09 14:49:37 +08:00
parent 9265c250b3
commit 1d89d80676
2 changed files with 7 additions and 4 deletions

View File

@ -4,7 +4,7 @@ Wolfx 防灾免费 API
import asyncio
import json
from typing import Literal, TypeVar, cast
from typing import TypeVar, cast
import aiohttp
from aiosignal import Signal
from loguru import logger
@ -239,7 +239,8 @@ class WolfxAPIService:
logger.info(f"接收到来自 Wolfx API 的信息:{data}")
await signal.send(obj)
except pydantic.ValidationError as e:
logger.warning(f"解析 Wolfx API 时出错 URL={ws.url}")
data_text = data.decode('utf-8', 'replace')
logger.warning(f"解析 Wolfx API 时出错 URL={ws.url} raw={data_text}")
logger.error(e)
async def start(self): # pragma: no cover

View File

@ -23,7 +23,7 @@ class THQwen(TextHandler):
ostream="你或当前环境没有使用 qwen 的权限。如有疑问请联系管理员",
)
llm = get_llm()
llm = get_llm(llm_model="qwen3.7-plus")
messages = []
if istream is not None:
@ -48,7 +48,9 @@ class THQwen(TextHandler):
"content": "除非用户要求,请尽可能短点回答。另外,当前环境不支持 Markdown 语法,如果可以,请使用纯文本回答",
}
] + messages
result = await llm.chat(cast(Any, messages))
result = await llm.chat(
cast(Any, messages), extra_body={"enable_thinking": False}
)
content = result.content
if content is None:
return TextHandleResult(