我正在尝试在Watson发现中更新文档,但收到INVALID请求错误。我想更新发现集合中的文档。
authenticator = IAMAuthenticator('***')
discovery = DiscoveryV1(
version='2019-04-30',
authenticator=authenticator
)
collection_id = "***"
config_id = "***"
env_id = "***"
res = discovery.query(environment_id=env_id, collection_id=collection_id, count=200)
response = discovery.update_document(environment_id=env_id , collection_id=collection_id , document_id="cos_7c6c60-7928-5bc7-8445-4d3f1c23b6")
print(response)
我得到的答复。
ERROR:root:The request is invalid.
Traceback (most recent call last):
File "C:\Users\shiva_burade\AppData\Local\Programs\Python\Python36\lib\site-packages\ibm_cloud_sdk_core\base_service.py", line 157, in send
response.status_code, error_message, http_response=response)
ibm_cloud_sdk_core.api_exception.ApiException: Error: The request is invalid., Code: 400 , X-global-transaction-id: a65576f5306e0a619e2cf7ca3272ca29
Traceback (most recent call last):
File "update_doc.py", line 21, in <module>
response = discovery.update_document(environment_id="303d6a2e-e001-42b7-97d1-ad364e49bcb1", collection_id="e0bc5127-05bb-4c5f-a216-47f1f43b47a3", document_id="cos_7c644c60-7928-5bc7-8445-4d3f1c23b650")
File "C:\Users\shiva_burade\AppData\Local\Programs\Python\Python36\lib\site-packages\ibm_watson\discovery_v1.py", line 1442, in update_document
response = self.send(request)
File "C:\Users\shiva_burade\AppData\Local\Programs\Python\Python36\lib\site-packages\ibm_cloud_sdk_core\base_service.py", line 157, in send
response.status_code, error_message, http_response=response)
ibm_cloud_sdk_core.api_exception.ApiException: Error: The request is invalid., Code: 400 , X-global-transaction-id: a65576f5306e0a619e2cf7ca3272ca29