mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-12 16:02:35 +08:00
fix: implement tool execution timeout handling and improve blocking call management
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
"""发送语音消息工具。"""
|
||||
|
||||
import asyncio
|
||||
from typing import Optional, Type
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
@@ -74,7 +72,8 @@ class SendVoiceMessageTool(MoviePilotTool):
|
||||
reply_mode == AgentCapabilityManager.REPLY_MODE_NATIVE
|
||||
and AgentCapabilityManager.is_audio_output_available()
|
||||
):
|
||||
voice_file = await asyncio.to_thread(
|
||||
voice_file = await self.run_blocking(
|
||||
"default",
|
||||
AgentCapabilityManager.synthesize_speech, message
|
||||
)
|
||||
if voice_file:
|
||||
|
||||
Reference in New Issue
Block a user