fix(tools): suppress RuntimeWarnings in podcast audio generator (#10182)

This commit is contained in:
-LAN- 2024-11-01 20:59:40 +08:00 committed by GitHub
parent ab127ba92e
commit 86739bea8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,8 @@
import concurrent.futures
import io
import random
import warnings
from typing import Any, Literal, Optional, Union
from warnings import catch_warnings
import openai
@ -10,7 +10,8 @@ from core.tools.entities.tool_entities import ToolInvokeMessage
from core.tools.errors import ToolParameterValidationError, ToolProviderCredentialValidationError
from core.tools.tool.builtin_tool import BuiltinTool
with catch_warnings(action="ignore", category=RuntimeWarning):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from pydub import AudioSegment