This commit is contained in:
@@ -85,7 +85,11 @@ class AliyunTingwuService:
|
|||||||
request = CreateTaskRequest.CreateTaskRequest()
|
request = CreateTaskRequest.CreateTaskRequest()
|
||||||
|
|
||||||
# 针对阿里云 SDK 不同版本的兼容性处理
|
# 针对阿里云 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)
|
request.add_query_param('AppKey', self.tingwu_app_key)
|
||||||
|
|
||||||
# 配置 Input
|
# 配置 Input
|
||||||
@@ -110,6 +114,9 @@ class AliyunTingwuService:
|
|||||||
# 听悟目前主要服务点在北京
|
# 听悟目前主要服务点在北京
|
||||||
request.set_endpoint("tingwu.cn-beijing.aliyuncs.com")
|
request.set_endpoint("tingwu.cn-beijing.aliyuncs.com")
|
||||||
|
|
||||||
|
# 显式设置 Method 为 POST,因为 SDK 默认可能是 PUT (针对 CreateTask)
|
||||||
|
request.set_method('PUT')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = self.client.do_action_with_exception(request)
|
response = self.client.do_action_with_exception(request)
|
||||||
return json.loads(response)
|
return json.loads(response)
|
||||||
|
|||||||
Reference in New Issue
Block a user