Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Virtual Assistant Client Code Example Errors #51

Open
KEDW02 opened this issue Jan 14, 2025 · 0 comments
Open

Custom Virtual Assistant Client Code Example Errors #51

KEDW02 opened this issue Jan 14, 2025 · 0 comments

Comments

@KEDW02
Copy link

KEDW02 commented Jan 14, 2025

Which topic are you reporting about?

https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-api-client&code=python#api-client-v1-api

What do you think needs to be updated?

The first is that all the examples contain the line:
assistant_id = '{environment_id}' # replace with environment ID
Here although the variable name is assistant_id the comment and assignment value both say environment. Here assistant ID would be correct and the line should read:
assistant_id = '{assistant_id}' # replace with assistant ID

The second error is found in examples 2 and 3. These contain this section:
result = assistant.message_stateless(
assistant_id,
input = message_input,
context=context
).get_result()
the function assistant.message_stateless() requires the positional argument environment_id. The solution to this is to add the line
environment_id = '{environment_id}' # replace with environment ID
next to the assistant ID line from earlier on. Then the section of code in examples 2 and 3 should be changed to read:
result = assistant.message_stateless(
environment_id = environment_id,
assistant_id = assistant_id,
input = message_input,
context = context
).get_result()

The final issue I have found is that the section:
Initialize with empty message to start the conversation.
message_input = {
'message_type:': 'text',
'text': ''
}
context = {}
is repeated in example 3.

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant