Skip to content

Commit 49851ca

Browse files
fix(wa-v2): fix missing path parameter in HTTP request creation for message functions
1 parent f4f2ba9 commit 49851ca

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

ibm_watson/assistant_v2.py

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -641,19 +641,10 @@ def message(
641641
(including context data) stored by watsonx Assistant for the duration of the
642642
session.
643643

644-
:param str assistant_id: The assistant ID or the environment ID of the
645-
environment where the assistant is deployed.
646-
Set the value for this ID depending on the type of request:
647-
- For message, session, and log requests, specify the environment ID of
648-
the environment where the assistant is deployed.
649-
- For all other requests, specify the assistant ID of the assistant.
650-
To get the **assistant ID** and **environment ID** in the watsonx
651-
Assistant interface, open the **Assistant settings** page, and scroll to
652-
the **Assistant IDs and API details** section and click **View Details**.
653-
**Note:** If you are using the classic Watson Assistant experience, always
654-
use the assistant ID.
655-
To find the **assistant ID** in the user interface, open the **Assistant
656-
settings** and click **API Details**.
644+
:param str assistant_id: Unique identifier of the assistant. To get the
645+
**assistant ID** in the watsonx Assistant interface, open the **Assistant
646+
settings** page, and scroll to the **Assistant IDs and API details**
647+
section and click **View Details**.
657648
:param str environment_id: Unique identifier of the environment. To find
658649
the environment ID in the watsonx Assistant user interface, open the
659650
environment settings and click **API Details**. **Note:** Currently, the
@@ -722,7 +713,7 @@ def message(
722713
path_param_values = self.encode_path_vars(assistant_id, environment_id,
723714
session_id)
724715
path_param_dict = dict(zip(path_param_keys, path_param_values))
725-
url = '/v2/assistants/{assistant_id}/sessions/{session_id}/message'.format(
716+
url = '/v2/assistants/{assistant_id}/environments/{environment_id}/sessions/{session_id}/message'.format(
726717
**path_param_dict)
727718
request = self.prepare_request(
728719
method='POST',
@@ -751,19 +742,10 @@ def message_stateless(
751742
Send user input to an assistant and receive a response, with conversation state
752743
(including context data) managed by your application.
753744

754-
:param str assistant_id: The assistant ID or the environment ID of the
755-
environment where the assistant is deployed.
756-
Set the value for this ID depending on the type of request:
757-
- For message, session, and log requests, specify the environment ID of
758-
the environment where the assistant is deployed.
759-
- For all other requests, specify the assistant ID of the assistant.
760-
To get the **assistant ID** and **environment ID** in the watsonx
761-
Assistant interface, open the **Assistant settings** page, and scroll to
762-
the **Assistant IDs and API details** section and click **View Details**.
763-
**Note:** If you are using the classic Watson Assistant experience, always
764-
use the assistant ID.
765-
To find the **assistant ID** in the user interface, open the **Assistant
766-
settings** and click **API Details**.
745+
:param str assistant_id: Unique identifier of the assistant. To get the
746+
**assistant ID** in the watsonx Assistant interface, open the **Assistant
747+
settings** page, and scroll to the **Assistant IDs and API details**
748+
section and click **View Details**.
767749
:param str environment_id: Unique identifier of the environment. To find
768750
the environment ID in the watsonx Assistant user interface, open the
769751
environment settings and click **API Details**. **Note:** Currently, the
@@ -829,7 +811,8 @@ def message_stateless(
829811
path_param_keys = ['assistant_id', 'environment_id']
830812
path_param_values = self.encode_path_vars(assistant_id, environment_id)
831813
path_param_dict = dict(zip(path_param_keys, path_param_values))
832-
url = '/v2/assistants/{assistant_id}/message'.format(**path_param_dict)
814+
url = '/v2/assistants/{assistant_id}/environments/{environment_id}/message'.format(
815+
**path_param_dict)
833816
request = self.prepare_request(
834817
method='POST',
835818
url=url,

0 commit comments

Comments
 (0)