diff --git a/main/live-agent-api/api/v1/voices.py b/main/live-agent-api/api/v1/voices.py index 1981dbed2..1c7904018 100644 --- a/main/live-agent-api/api/v1/voices.py +++ b/main/live-agent-api/api/v1/voices.py @@ -125,6 +125,10 @@ async def get_my_voices( name=voice.name, desc=voice.desc, created_at=voice.created_at, + samples=[AudioSample( + text=voice.sample_text, + audio=voice.sample_url + )] if voice.sample_text and voice.sample_url else None )) # Build response diff --git a/main/live-agent-api/schemas/voice.py b/main/live-agent-api/schemas/voice.py index 85f15be68..ffcbb3cc9 100644 --- a/main/live-agent-api/schemas/voice.py +++ b/main/live-agent-api/schemas/voice.py @@ -30,9 +30,8 @@ class VoiceAddRequest(BaseModel): class AudioSample(BaseModel): """Audio sample""" - title: str - text: str - audio: str + text: Optional[str] = None + audio: Optional[str] = None class LiveAgentVoice(BaseModel): """Voice Entity for Live Agent""" diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index 7d8c49325..8b16130e2 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -1138,7 +1138,8 @@ class ConnectionHandler: if self.executor is None: continue # 提交任务到线程池 - self.executor.submit(self._process_report, *item) + # self.executor.submit(self._process_report, *item) + self._process_report(*item) except Exception as e: self.logger.bind(tag=TAG).error(f"聊天记录上报线程异常: {e}") except queue.Empty: