I'm trying to use Watson Assistant from the CLI with a Python script, similar to the demo Building a custom client. The Python script is:
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
# Create Assistant service object.
authenticator = IAMAuthenticator(api_key_for_wa_service) # replace with API key
assistant = AssistantV2(
version = '2020-09-24',
authenticator = authenticator
)
assistant.set_service_url('https://api.au-syd.assistant.watson.cloud.ibm.com')
assistant_id = '00965b15-eb3f-4d83-8983-3df0c7da9c4f'
# Start conversation with empty message:
response = assistant.message_stateless(assistant_id,
).get_result()
I think it's connecting okay, but the request is failing with status code 422:
c:\Runnable>python create_watson_assistant_service_object.py
Method failed with status code 422: Unknown error
I've tried passing an input argument after the assistant_id argument in the request:
input = {'message_type': 'text', 'text': 'Hello'}
This gives the same result (code 422).
I don't know what to try next.