feat: append concise reply hint to Antaf queries

Ant Afu tends to give long replies which causes TTS queue delays.
Append "请用2-3句话简短回答" to reduce response length.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hailin 2026-04-06 04:30:32 -07:00
parent 5679622996
commit b70c1dd071
2 changed files with 3 additions and 2 deletions

View File

@ -89,6 +89,8 @@ class LLMProvider(LLMProviderBase):
yield "抱歉,我没有收到您的问题。"
return
# 追加简短回答提示避免阿福回复过长导致TTS排队卡顿
query = query + "请用2-3句话简短回答"
logger.bind(tag=TAG).info(f"AntafLLM 请求: {query[:50]}...")
try:

View File

@ -70,8 +70,7 @@ class TTSProvider(TTSProviderBase):
return wav_io.getvalue()
async def text_to_speak(self, text, output_file):
loop = asyncio.get_event_loop()
wav_data = await loop.run_in_executor(None, self._generate_wav, text)
wav_data = self._generate_wav(text)
if output_file:
with open(output_file, "wb") as f: