@@ -516,6 +516,9 @@ class AssistantV2 extends BaseService {
516
516
* **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID.
517
517
*
518
518
* To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**.
519
+ * @param {string } params.environmentId - Unique identifier of the environment. To find the environment ID in the
520
+ * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the
521
+ * API does not support creating environments.
519
522
* @param {RequestAnalytics } [params.analytics] - An optional object containing analytics data. Currently, this data
520
523
* is used only for events sent to the Segment extension.
521
524
* @param {OutgoingHttpHeaders } [params.headers] - Custom request headers
@@ -525,8 +528,8 @@ class AssistantV2 extends BaseService {
525
528
params : AssistantV2 . CreateSessionParams
526
529
) : Promise < AssistantV2 . Response < AssistantV2 . SessionResponse > > {
527
530
const _params = { ...params } ;
528
- const _requiredParams = [ 'assistantId' ] ;
529
- const _validParams = [ 'assistantId' , 'analytics' , 'signal' , 'headers' ] ;
531
+ const _requiredParams = [ 'assistantId' , 'environmentId' ] ;
532
+ const _validParams = [ 'assistantId' , 'environmentId' , ' analytics', 'signal' , 'headers' ] ;
530
533
const _validationErrors = validateParams ( _params , _requiredParams , _validParams ) ;
531
534
if ( _validationErrors ) {
532
535
return Promise . reject ( _validationErrors ) ;
@@ -542,13 +545,14 @@ class AssistantV2 extends BaseService {
542
545
543
546
const path = {
544
547
'assistant_id' : _params . assistantId ,
548
+ 'environment_id' : _params . environmentId ,
545
549
} ;
546
550
547
551
const sdkHeaders = getSdkHeaders ( AssistantV2 . DEFAULT_SERVICE_NAME , 'v2' , 'createSession' ) ;
548
552
549
553
const parameters = {
550
554
options : {
551
- url : '/v2/assistants/{assistant_id}/sessions' ,
555
+ url : '/v2/assistants/{assistant_id}/environments/{environment_id}/ sessions' ,
552
556
method : 'POST' ,
553
557
body,
554
558
qs : query ,
@@ -2963,6 +2967,11 @@ namespace AssistantV2 {
2963
2967
* To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**.
2964
2968
*/
2965
2969
assistantId : string ;
2970
+ /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface,
2971
+ * open the environment settings and click **API Details**. **Note:** Currently, the API does not support creating
2972
+ * environments.
2973
+ */
2974
+ environmentId : string ;
2966
2975
/** An optional object containing analytics data. Currently, this data is used only for events sent to the
2967
2976
* Segment extension.
2968
2977
*/
0 commit comments