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:
parent
5679622996
commit
b70c1dd071
|
|
@ -89,6 +89,8 @@ class LLMProvider(LLMProviderBase):
|
||||||
yield "抱歉,我没有收到您的问题。"
|
yield "抱歉,我没有收到您的问题。"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# 追加简短回答提示,避免阿福回复过长导致TTS排队卡顿
|
||||||
|
query = query + "(请用2-3句话简短回答)"
|
||||||
logger.bind(tag=TAG).info(f"AntafLLM 请求: {query[:50]}...")
|
logger.bind(tag=TAG).info(f"AntafLLM 请求: {query[:50]}...")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,7 @@ class TTSProvider(TTSProviderBase):
|
||||||
return wav_io.getvalue()
|
return wav_io.getvalue()
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
async def text_to_speak(self, text, output_file):
|
||||||
loop = asyncio.get_event_loop()
|
wav_data = self._generate_wav(text)
|
||||||
wav_data = await loop.run_in_executor(None, self._generate_wav, text)
|
|
||||||
|
|
||||||
if output_file:
|
if output_file:
|
||||||
with open(output_file, "wb") as f:
|
with open(output_file, "wb") as f:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue