tingwu_new
All checks were successful
Deploy to Server / deploy (push) Successful in 26s

This commit is contained in:
jeremygan2021
2026-03-11 15:03:02 +08:00
parent 7e3600a6d2
commit ea1a5e8c59

View File

@@ -85,7 +85,11 @@ class AliyunTingwuService:
request = CreateTaskRequest.CreateTaskRequest()
# 针对阿里云 SDK 不同版本的兼容性处理
# 优先使用 query param 方式,因为这是更通用的 API 请求方式
# "type" 参数是听悟 API (ROA 风格) 的必填项,用于指定任务类型
# 根据官方文档,离线任务的 type 通常就是 'offline'
request.add_query_param('type', 'offline')
# AppKey
request.add_query_param('AppKey', self.tingwu_app_key)
# 配置 Input
@@ -110,6 +114,9 @@ class AliyunTingwuService:
# 听悟目前主要服务点在北京
request.set_endpoint("tingwu.cn-beijing.aliyuncs.com")
# 显式设置 Method 为 POST因为 SDK 默认可能是 PUT (针对 CreateTask)
request.set_method('PUT')
try:
response = self.client.do_action_with_exception(request)
return json.loads(response)