From cb67841ebfbded51102ac0062950975366087e9e Mon Sep 17 00:00:00 2001 From: Nataliia Kirinovych Date: Fri, 13 Jun 2025 15:10:10 +0100 Subject: [PATCH 1/7] feat(wav1&discv2): add signal to axios options --- assistant/v1.ts | 451 ++++++++++++++++++++++++++++-------------- discovery/v2.ts | 517 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 651 insertions(+), 317 deletions(-) diff --git a/assistant/v1.ts b/assistant/v1.ts index 90e8f805a8..5e5886f077 100644 --- a/assistant/v1.ts +++ b/assistant/v1.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2018, 2024. + * (C) Copyright IBM Corp. 2018, 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ import * as extend from 'extend'; import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { + AbortSignal, Authenticator, BaseService, UserOptions, @@ -129,7 +130,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'input', 'intents', 'entities', 'alternateIntents', 'context', 'output', 'userId', 'nodesVisitedDetails', 'headers']; + const _validParams = ['workspaceId', 'input', 'intents', 'entities', 'alternateIntents', 'context', 'output', 'userId', 'nodesVisitedDetails', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -168,12 +169,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -202,7 +207,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'input', 'headers']; + const _validParams = ['workspaceId', 'input', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -234,12 +239,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -272,7 +281,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -299,11 +308,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -346,7 +359,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'includeAudit', 'headers']; + const _validParams = ['name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -384,12 +397,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -419,7 +436,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', '_export', 'includeAudit', 'sort', 'headers']; + const _validParams = ['workspaceId', '_export', 'includeAudit', 'sort', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -449,11 +466,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -504,7 +525,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'append', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'append', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -548,12 +569,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -575,7 +600,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'headers']; + const _validParams = ['workspaceId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -602,11 +627,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -648,7 +677,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'headers']; + const _validParams = ['name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -685,12 +714,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -740,7 +773,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'append', 'headers']; + const _validParams = ['workspaceId', 'name', 'description', 'language', 'dialogNodes', 'counterexamples', 'metadata', 'learningOptOut', 'systemSettings', 'webhooks', 'intents', 'entities', 'append', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -783,12 +816,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -821,7 +858,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'includeAudit', 'sort', 'verbose', 'headers']; + const _validParams = ['workspaceId', 'includeAudit', 'sort', 'verbose', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -851,11 +888,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -892,7 +933,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', '_export', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', '_export', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -925,11 +966,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -962,7 +1007,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent']; - const _validParams = ['workspaceId', 'intent', 'description', 'examples', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', 'description', 'examples', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -997,12 +1042,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1030,7 +1079,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent']; - const _validParams = ['workspaceId', 'intent', '_export', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', '_export', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1060,11 +1109,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1107,7 +1160,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent']; - const _validParams = ['workspaceId', 'intent', 'newIntent', 'newDescription', 'newExamples', 'append', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', 'newIntent', 'newDescription', 'newExamples', 'append', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1144,12 +1197,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1172,7 +1229,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent']; - const _validParams = ['workspaceId', 'intent', 'headers']; + const _validParams = ['workspaceId', 'intent', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1200,11 +1257,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1239,7 +1300,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent']; - const _validParams = ['workspaceId', 'intent', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1272,11 +1333,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1309,7 +1374,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent', 'text']; - const _validParams = ['workspaceId', 'intent', 'text', 'mentions', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', 'text', 'mentions', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1344,12 +1409,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1375,7 +1444,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent', 'text']; - const _validParams = ['workspaceId', 'intent', 'text', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', 'text', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1405,11 +1474,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1443,7 +1516,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent', 'text']; - const _validParams = ['workspaceId', 'intent', 'text', 'newText', 'newMentions', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'intent', 'text', 'newText', 'newMentions', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1479,12 +1552,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1508,7 +1585,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'intent', 'text']; - const _validParams = ['workspaceId', 'intent', 'text', 'headers']; + const _validParams = ['workspaceId', 'intent', 'text', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1537,11 +1614,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1575,7 +1656,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1607,11 +1688,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1642,7 +1727,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'text']; - const _validParams = ['workspaceId', 'text', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'text', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1675,12 +1760,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1705,7 +1794,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'text']; - const _validParams = ['workspaceId', 'text', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'text', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1734,11 +1823,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1767,7 +1860,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'text']; - const _validParams = ['workspaceId', 'text', 'newText', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'text', 'newText', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1801,12 +1894,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1829,7 +1926,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'text']; - const _validParams = ['workspaceId', 'text', 'headers']; + const _validParams = ['workspaceId', 'text', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1857,11 +1954,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1898,7 +1999,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', '_export', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', '_export', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1931,11 +2032,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1971,7 +2076,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity']; - const _validParams = ['workspaceId', 'entity', 'description', 'metadata', 'fuzzyMatch', 'values', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'description', 'metadata', 'fuzzyMatch', 'values', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2008,12 +2113,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2041,7 +2150,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity']; - const _validParams = ['workspaceId', 'entity', '_export', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', '_export', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2071,11 +2180,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2120,7 +2233,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity']; - const _validParams = ['workspaceId', 'entity', 'newEntity', 'newDescription', 'newMetadata', 'newFuzzyMatch', 'newValues', 'append', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'newEntity', 'newDescription', 'newMetadata', 'newFuzzyMatch', 'newValues', 'append', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2159,12 +2272,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2187,7 +2304,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity']; - const _validParams = ['workspaceId', 'entity', 'headers']; + const _validParams = ['workspaceId', 'entity', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2215,11 +2332,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2251,7 +2372,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity']; - const _validParams = ['workspaceId', 'entity', '_export', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', '_export', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2281,11 +2402,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2323,7 +2448,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity']; - const _validParams = ['workspaceId', 'entity', '_export', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', '_export', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2357,11 +2482,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2404,7 +2533,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value']; - const _validParams = ['workspaceId', 'entity', 'value', 'metadata', 'type', 'synonyms', 'patterns', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'metadata', 'type', 'synonyms', 'patterns', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2442,12 +2571,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2476,7 +2609,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value']; - const _validParams = ['workspaceId', 'entity', 'value', '_export', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', '_export', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2507,11 +2640,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2563,7 +2700,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value']; - const _validParams = ['workspaceId', 'entity', 'value', 'newValue', 'newMetadata', 'newType', 'newSynonyms', 'newPatterns', 'append', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'newValue', 'newMetadata', 'newType', 'newSynonyms', 'newPatterns', 'append', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2603,12 +2740,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2632,7 +2773,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value']; - const _validParams = ['workspaceId', 'entity', 'value', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2661,11 +2802,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2701,7 +2846,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value']; - const _validParams = ['workspaceId', 'entity', 'value', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2735,11 +2880,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2771,7 +2920,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value', 'synonym']; - const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2806,12 +2955,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2838,7 +2991,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value', 'synonym']; - const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2869,11 +3022,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2907,7 +3064,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value', 'synonym']; - const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'newSynonym', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'newSynonym', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2943,12 +3100,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2973,7 +3134,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'entity', 'value', 'synonym']; - const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'headers']; + const _validParams = ['workspaceId', 'entity', 'value', 'synonym', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3003,11 +3164,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3041,7 +3206,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3073,11 +3238,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3141,7 +3310,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'dialogNode']; - const _validParams = ['workspaceId', 'dialogNode', 'description', 'conditions', 'parent', 'previousSibling', 'output', 'context', 'metadata', 'nextStep', 'title', 'type', 'eventName', 'variable', 'actions', 'digressIn', 'digressOut', 'digressOutSlots', 'userLabel', 'disambiguationOptOut', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'dialogNode', 'description', 'conditions', 'parent', 'previousSibling', 'output', 'context', 'metadata', 'nextStep', 'title', 'type', 'eventName', 'variable', 'actions', 'digressIn', 'digressOut', 'digressOutSlots', 'userLabel', 'disambiguationOptOut', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3192,12 +3361,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3222,7 +3395,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'dialogNode']; - const _validParams = ['workspaceId', 'dialogNode', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'dialogNode', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3251,11 +3424,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3321,7 +3498,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'dialogNode']; - const _validParams = ['workspaceId', 'dialogNode', 'newDialogNode', 'newDescription', 'newConditions', 'newParent', 'newPreviousSibling', 'newOutput', 'newContext', 'newMetadata', 'newNextStep', 'newTitle', 'newType', 'newEventName', 'newVariable', 'newActions', 'newDigressIn', 'newDigressOut', 'newDigressOutSlots', 'newUserLabel', 'newDisambiguationOptOut', 'includeAudit', 'headers']; + const _validParams = ['workspaceId', 'dialogNode', 'newDialogNode', 'newDescription', 'newConditions', 'newParent', 'newPreviousSibling', 'newOutput', 'newContext', 'newMetadata', 'newNextStep', 'newTitle', 'newType', 'newEventName', 'newVariable', 'newActions', 'newDigressIn', 'newDigressOut', 'newDigressOutSlots', 'newUserLabel', 'newDisambiguationOptOut', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3373,12 +3550,16 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3401,7 +3582,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId', 'dialogNode']; - const _validParams = ['workspaceId', 'dialogNode', 'headers']; + const _validParams = ['workspaceId', 'dialogNode', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3429,11 +3610,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3473,7 +3658,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['workspaceId']; - const _validParams = ['workspaceId', 'sort', 'filter', 'pageLimit', 'cursor', 'headers']; + const _validParams = ['workspaceId', 'sort', 'filter', 'pageLimit', 'cursor', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3504,11 +3689,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3542,7 +3731,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['filter']; - const _validParams = ['filter', 'sort', 'pageLimit', 'cursor', 'headers']; + const _validParams = ['filter', 'sort', 'pageLimit', 'cursor', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3568,11 +3757,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3607,7 +3800,7 @@ class AssistantV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customerId']; - const _validParams = ['customerId', 'headers']; + const _validParams = ['customerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3630,11 +3823,15 @@ class AssistantV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3678,8 +3875,13 @@ namespace AssistantV1 { * request interfaces ************************/ + interface DefaultParams { + headers?: OutgoingHttpHeaders; + signal?: AbortSignal; + } + /** Parameters for the `message` operation. */ - export interface MessageParams { + export interface MessageParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** An input object that includes the input text. */ @@ -3714,20 +3916,18 @@ namespace AssistantV1 { * processing of the message. */ nodesVisitedDetails?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `bulkClassify` operation. */ - export interface BulkClassifyParams { + export interface BulkClassifyParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** An array of input utterances to classify. */ input?: BulkClassifyUtterance[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listWorkspaces` operation. */ - export interface ListWorkspacesParams { + export interface ListWorkspacesParams extends DefaultParams { /** The number of records to return in each page of results. */ pageLimit?: number; /** Whether to include information about the number of records that satisfy the request, regardless of the page @@ -3742,7 +3942,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listWorkspaces` operation. */ @@ -3755,7 +3954,7 @@ namespace AssistantV1 { } /** Parameters for the `createWorkspace` operation. */ - export interface CreateWorkspaceParams { + export interface CreateWorkspaceParams extends DefaultParams { /** The name of the workspace. This string cannot contain carriage return, newline, or tab characters. */ name?: string; /** The description of the workspace. This string cannot contain carriage return, newline, or tab characters. */ @@ -3781,11 +3980,10 @@ namespace AssistantV1 { entities?: CreateEntity[]; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getWorkspace` operation. */ - export interface GetWorkspaceParams { + export interface GetWorkspaceParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** Whether to include all element content in the returned data. If **export**=`false`, the returned data @@ -3799,7 +3997,6 @@ namespace AssistantV1 { * Specify `sort=stable` to sort all workspace objects by unique identifier, in ascending alphabetical order. */ sort?: GetWorkspaceConstants.Sort | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `getWorkspace` operation. */ @@ -3811,7 +4008,7 @@ namespace AssistantV1 { } /** Parameters for the `updateWorkspace` operation. */ - export interface UpdateWorkspaceParams { + export interface UpdateWorkspaceParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the workspace. This string cannot contain carriage return, newline, or tab characters. */ @@ -3848,18 +4045,16 @@ namespace AssistantV1 { append?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteWorkspace` operation. */ - export interface DeleteWorkspaceParams { + export interface DeleteWorkspaceParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createWorkspaceAsync` operation. */ - export interface CreateWorkspaceAsyncParams { + export interface CreateWorkspaceAsyncParams extends DefaultParams { /** The name of the workspace. This string cannot contain carriage return, newline, or tab characters. */ name?: string; /** The description of the workspace. This string cannot contain carriage return, newline, or tab characters. */ @@ -3883,11 +4078,10 @@ namespace AssistantV1 { intents?: CreateIntent[]; /** An array of objects describing the entities for the workspace. */ entities?: CreateEntity[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateWorkspaceAsync` operation. */ - export interface UpdateWorkspaceAsyncParams { + export interface UpdateWorkspaceAsyncParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the workspace. This string cannot contain carriage return, newline, or tab characters. */ @@ -3922,11 +4116,10 @@ namespace AssistantV1 { * new data collide with existing elements, the update request fails. */ append?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `exportWorkspaceAsync` operation. */ - export interface ExportWorkspaceAsyncParams { + export interface ExportWorkspaceAsyncParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ @@ -3939,7 +4132,6 @@ namespace AssistantV1 { * as intents and entities) the workspace contains. */ verbose?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `exportWorkspaceAsync` operation. */ @@ -3951,7 +4143,7 @@ namespace AssistantV1 { } /** Parameters for the `listIntents` operation. */ - export interface ListIntentsParams { + export interface ListIntentsParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** Whether to include all element content in the returned data. If **export**=`false`, the returned data @@ -3973,7 +4165,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listIntents` operation. */ @@ -3986,7 +4177,7 @@ namespace AssistantV1 { } /** Parameters for the `createIntent` operation. */ - export interface CreateIntentParams { + export interface CreateIntentParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the intent. This string must conform to the following restrictions: @@ -4000,11 +4191,10 @@ namespace AssistantV1 { examples?: Example[]; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getIntent` operation. */ - export interface GetIntentParams { + export interface GetIntentParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ @@ -4016,11 +4206,10 @@ namespace AssistantV1 { _export?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateIntent` operation. */ - export interface UpdateIntentParams { + export interface UpdateIntentParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ @@ -4045,20 +4234,18 @@ namespace AssistantV1 { append?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteIntent` operation. */ - export interface DeleteIntentParams { + export interface DeleteIntentParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ intent: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listExamples` operation. */ - export interface ListExamplesParams { + export interface ListExamplesParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ @@ -4077,7 +4264,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listExamples` operation. */ @@ -4090,7 +4276,7 @@ namespace AssistantV1 { } /** Parameters for the `createExample` operation. */ - export interface CreateExampleParams { + export interface CreateExampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ @@ -4104,11 +4290,10 @@ namespace AssistantV1 { mentions?: Mention[]; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getExample` operation. */ - export interface GetExampleParams { + export interface GetExampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ @@ -4117,11 +4302,10 @@ namespace AssistantV1 { text: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateExample` operation. */ - export interface UpdateExampleParams { + export interface UpdateExampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ @@ -4137,22 +4321,20 @@ namespace AssistantV1 { newMentions?: Mention[]; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteExample` operation. */ - export interface DeleteExampleParams { + export interface DeleteExampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The intent name. */ intent: string; /** The text of the user input example. */ text: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listCounterexamples` operation. */ - export interface ListCounterexamplesParams { + export interface ListCounterexamplesParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The number of records to return in each page of results. */ @@ -4169,7 +4351,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listCounterexamples` operation. */ @@ -4182,7 +4363,7 @@ namespace AssistantV1 { } /** Parameters for the `createCounterexample` operation. */ - export interface CreateCounterexampleParams { + export interface CreateCounterexampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The text of a user input marked as irrelevant input. This string must conform to the following restrictions: @@ -4192,22 +4373,20 @@ namespace AssistantV1 { text: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getCounterexample` operation. */ - export interface GetCounterexampleParams { + export interface GetCounterexampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The text of a user input counterexample (for example, `What are you wearing?`). */ text: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateCounterexample` operation. */ - export interface UpdateCounterexampleParams { + export interface UpdateCounterexampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The text of a user input counterexample (for example, `What are you wearing?`). */ @@ -4219,20 +4398,18 @@ namespace AssistantV1 { newText?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteCounterexample` operation. */ - export interface DeleteCounterexampleParams { + export interface DeleteCounterexampleParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The text of a user input counterexample (for example, `What are you wearing?`). */ text: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listEntities` operation. */ - export interface ListEntitiesParams { + export interface ListEntitiesParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** Whether to include all element content in the returned data. If **export**=`false`, the returned data @@ -4254,7 +4431,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listEntities` operation. */ @@ -4267,7 +4443,7 @@ namespace AssistantV1 { } /** Parameters for the `createEntity` operation. */ - export interface CreateEntityParams { + export interface CreateEntityParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. This string must conform to the following restrictions: @@ -4286,11 +4462,10 @@ namespace AssistantV1 { values?: CreateValue[]; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getEntity` operation. */ - export interface GetEntityParams { + export interface GetEntityParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4302,11 +4477,10 @@ namespace AssistantV1 { _export?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateEntity` operation. */ - export interface UpdateEntityParams { + export interface UpdateEntityParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4335,20 +4509,18 @@ namespace AssistantV1 { append?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteEntity` operation. */ - export interface DeleteEntityParams { + export interface DeleteEntityParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ entity: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listMentions` operation. */ - export interface ListMentionsParams { + export interface ListMentionsParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4360,11 +4532,10 @@ namespace AssistantV1 { _export?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listValues` operation. */ - export interface ListValuesParams { + export interface ListValuesParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4388,7 +4559,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listValues` operation. */ @@ -4401,7 +4571,7 @@ namespace AssistantV1 { } /** Parameters for the `createValue` operation. */ - export interface CreateValueParams { + export interface CreateValueParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4429,7 +4599,6 @@ namespace AssistantV1 { patterns?: string[]; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `createValue` operation. */ @@ -4442,7 +4611,7 @@ namespace AssistantV1 { } /** Parameters for the `getValue` operation. */ - export interface GetValueParams { + export interface GetValueParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4456,11 +4625,10 @@ namespace AssistantV1 { _export?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateValue` operation. */ - export interface UpdateValueParams { + export interface UpdateValueParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4499,7 +4667,6 @@ namespace AssistantV1 { append?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `updateValue` operation. */ @@ -4512,18 +4679,17 @@ namespace AssistantV1 { } /** Parameters for the `deleteValue` operation. */ - export interface DeleteValueParams { + export interface DeleteValueParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ entity: string; /** The text of the entity value. */ value: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listSynonyms` operation. */ - export interface ListSynonymsParams { + export interface ListSynonymsParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4544,7 +4710,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listSynonyms` operation. */ @@ -4557,7 +4722,7 @@ namespace AssistantV1 { } /** Parameters for the `createSynonym` operation. */ - export interface CreateSynonymParams { + export interface CreateSynonymParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4571,11 +4736,10 @@ namespace AssistantV1 { synonym: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getSynonym` operation. */ - export interface GetSynonymParams { + export interface GetSynonymParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4586,11 +4750,10 @@ namespace AssistantV1 { synonym: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateSynonym` operation. */ - export interface UpdateSynonymParams { + export interface UpdateSynonymParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4606,11 +4769,10 @@ namespace AssistantV1 { newSynonym?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteSynonym` operation. */ - export interface DeleteSynonymParams { + export interface DeleteSynonymParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The name of the entity. */ @@ -4619,11 +4781,10 @@ namespace AssistantV1 { value: string; /** The text of the synonym. */ synonym: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listDialogNodes` operation. */ - export interface ListDialogNodesParams { + export interface ListDialogNodesParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The number of records to return in each page of results. */ @@ -4640,7 +4801,6 @@ namespace AssistantV1 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listDialogNodes` operation. */ @@ -4653,7 +4813,7 @@ namespace AssistantV1 { } /** Parameters for the `createDialogNode` operation. */ - export interface CreateDialogNodeParams { + export interface CreateDialogNodeParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The unique ID of the dialog node. This is an internal identifier used to refer to the dialog node from other @@ -4716,7 +4876,6 @@ namespace AssistantV1 { disambiguationOptOut?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `createDialogNode` operation. */ @@ -4763,18 +4922,17 @@ namespace AssistantV1 { } /** Parameters for the `getDialogNode` operation. */ - export interface GetDialogNodeParams { + export interface GetDialogNodeParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The dialog node ID (for example, `node_1_1479323581900`). */ dialogNode: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateDialogNode` operation. */ - export interface UpdateDialogNodeParams { + export interface UpdateDialogNodeParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The dialog node ID (for example, `node_1_1479323581900`). */ @@ -4839,7 +4997,6 @@ namespace AssistantV1 { newDisambiguationOptOut?: boolean; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `updateDialogNode` operation. */ @@ -4886,16 +5043,15 @@ namespace AssistantV1 { } /** Parameters for the `deleteDialogNode` operation. */ - export interface DeleteDialogNodeParams { + export interface DeleteDialogNodeParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** The dialog node ID (for example, `node_1_1479323581900`). */ dialogNode: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listLogs` operation. */ - export interface ListLogsParams { + export interface ListLogsParams extends DefaultParams { /** Unique identifier of the workspace. */ workspaceId: string; /** How to sort the returned log events. You can sort by **request_timestamp**. To reverse the sort order, @@ -4913,11 +5069,10 @@ namespace AssistantV1 { pageLimit?: number; /** A token identifying the page of results to retrieve. */ cursor?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listAllLogs` operation. */ - export interface ListAllLogsParams { + export interface ListAllLogsParams extends DefaultParams { /** A cacheable parameter that limits the results to those matching the specified filter. You must specify a * filter query that includes a value for `language`, as well as a value for `request.context.system.assistant_id`, * `workspace_id`, or `request.context.metadata.deployment`. These required filters must be specified using the @@ -4933,14 +5088,12 @@ namespace AssistantV1 { pageLimit?: number; /** A token identifying the page of results to retrieve. */ cursor?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteUserData` operation. */ - export interface DeleteUserDataParams { + export interface DeleteUserDataParams extends DefaultParams { /** The customer ID for which all data is to be deleted. */ customerId: string; - headers?: OutgoingHttpHeaders; } /************************* diff --git a/discovery/v2.ts b/discovery/v2.ts index 926f458389..eed4c28af9 100644 --- a/discovery/v2.ts +++ b/discovery/v2.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2019, 2024. + * (C) Copyright IBM Corp. 2019, 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ import * as extend from 'extend'; import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { + AbortSignal, Authenticator, BaseService, UserOptions, @@ -103,7 +104,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -125,11 +126,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -161,7 +166,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['name', 'type']; - const _validParams = ['name', 'type', 'defaultQueryParameters', 'headers']; + const _validParams = ['name', 'type', 'defaultQueryParameters', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -190,12 +195,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -218,7 +227,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -245,11 +254,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -273,7 +286,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'name', 'headers']; + const _validParams = ['projectId', 'name', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -305,12 +318,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -336,7 +353,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -363,10 +380,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -391,7 +412,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'collectionIds', 'headers']; + const _validParams = ['projectId', 'collectionIds', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -419,11 +440,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -449,7 +474,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -476,11 +501,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -515,7 +544,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'name']; - const _validParams = ['projectId', 'name', 'description', 'language', 'ocrEnabled', 'enrichments', 'headers']; + const _validParams = ['projectId', 'name', 'description', 'language', 'ocrEnabled', 'enrichments', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -551,12 +580,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -580,7 +613,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -608,11 +641,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -652,7 +689,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'name', 'description', 'ocrEnabled', 'enrichments', 'headers']; + const _validParams = ['projectId', 'collectionId', 'name', 'description', 'ocrEnabled', 'enrichments', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -688,12 +725,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -718,7 +759,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -746,10 +787,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -812,7 +857,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'count', 'status', 'hasNotices', 'isParent', 'parentDocumentId', 'sha256', 'headers']; + const _validParams = ['projectId', 'collectionId', 'count', 'status', 'hasNotices', 'isParent', 'parentDocumentId', 'sha256', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -846,11 +891,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -920,7 +969,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'file', 'filename', 'fileContentType', 'metadata', 'xWatsonDiscoveryForce', 'headers']; + const _validParams = ['projectId', 'collectionId', 'file', 'filename', 'fileContentType', 'metadata', 'xWatsonDiscoveryForce', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -952,12 +1001,13 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', @@ -965,6 +1015,9 @@ class DiscoveryV2 extends BaseService { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -993,7 +1046,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId', 'documentId']; - const _validParams = ['projectId', 'collectionId', 'documentId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'documentId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1022,11 +1075,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1087,7 +1144,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId', 'documentId']; - const _validParams = ['projectId', 'collectionId', 'documentId', 'file', 'filename', 'fileContentType', 'metadata', 'xWatsonDiscoveryForce', 'headers']; + const _validParams = ['projectId', 'collectionId', 'documentId', 'file', 'filename', 'fileContentType', 'metadata', 'xWatsonDiscoveryForce', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1120,12 +1177,13 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', @@ -1133,6 +1191,9 @@ class DiscoveryV2 extends BaseService { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1152,6 +1213,22 @@ class DiscoveryV2 extends BaseService { * collection. To remove subdocuments that are generated by an uploaded file, delete the original document instead. * You can get the document ID of the original document from the `parent_document_id` of the subdocument result. * + * If the document with the given document ID exists, Watson Discovery first marks or tags the document as deleted + * when it sends the 200 response code. At a later time (within a couple of minutes unless the document has many child + * documents), it removes the document from the collection. + * + * There is no bulk document delete API. Documents must be deleted one at a time using this API. However, you can + * delete a collection, and all the documents from the collection are removed along with the collection. + * + * The document will be deleted from the given collection only, not from the corresponding data source. Wherever + * relevant, an incremental crawl will not bring back the document into Watson Discovery from the data source. Only a + * full crawl will retrieve the deleted document back from the data source provided it is still present in the same + * data source. + * + * Finally, if multiple collections share the same dataset, deleting a document from a collection will remove it from + * that collection only (in other remaining collections the document will still exist). The document will be removed + * from the dataset, if this document is deleted from all the collections that share the same dataset. + * * @param {Object} params - The parameters to send to the service. * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be * found from the *Integrate and Deploy* page in Discovery. @@ -1167,7 +1244,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId', 'documentId']; - const _validParams = ['projectId', 'collectionId', 'documentId', 'xWatsonDiscoveryForce', 'headers']; + const _validParams = ['projectId', 'collectionId', 'documentId', 'xWatsonDiscoveryForce', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1196,12 +1273,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'X-Watson-Discovery-Force': _params.xWatsonDiscoveryForce, }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1283,7 +1364,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'collectionIds', 'filter', 'query', 'naturalLanguageQuery', 'aggregation', 'count', '_return', 'offset', 'sort', 'highlight', 'spellingSuggestions', 'tableResults', 'suggestedRefinements', 'passages', 'similar', 'headers']; + const _validParams = ['projectId', 'collectionIds', 'filter', 'query', 'naturalLanguageQuery', 'aggregation', 'count', '_return', 'offset', 'sort', 'highlight', 'spellingSuggestions', 'tableResults', 'suggestedRefinements', 'passages', 'similar', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1329,12 +1410,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1367,7 +1452,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'prefix']; - const _validParams = ['projectId', 'prefix', 'collectionIds', 'field', 'count', 'headers']; + const _validParams = ['projectId', 'prefix', 'collectionIds', 'field', 'count', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1398,11 +1483,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1442,7 +1531,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'filter', 'query', 'naturalLanguageQuery', 'count', 'offset', 'headers']; + const _validParams = ['projectId', 'collectionId', 'filter', 'query', 'naturalLanguageQuery', 'count', 'offset', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1475,11 +1564,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1519,7 +1612,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'filter', 'query', 'naturalLanguageQuery', 'count', 'offset', 'headers']; + const _validParams = ['projectId', 'filter', 'query', 'naturalLanguageQuery', 'count', 'offset', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1551,11 +1644,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1584,7 +1681,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1612,11 +1709,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1650,7 +1751,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'stopwords', 'headers']; + const _validParams = ['projectId', 'collectionId', 'stopwords', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1683,12 +1784,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1713,7 +1818,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1741,10 +1846,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1769,7 +1878,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1797,11 +1906,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1839,7 +1952,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId', 'expansions']; - const _validParams = ['projectId', 'collectionId', 'expansions', 'headers']; + const _validParams = ['projectId', 'collectionId', 'expansions', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1872,12 +1985,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1902,7 +2019,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1930,10 +2047,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1959,7 +2080,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1986,11 +2107,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2016,7 +2141,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2043,11 +2168,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2070,7 +2199,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2097,10 +2226,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2131,7 +2264,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'naturalLanguageQuery', 'examples']; - const _validParams = ['projectId', 'naturalLanguageQuery', 'examples', 'filter', 'headers']; + const _validParams = ['projectId', 'naturalLanguageQuery', 'examples', 'filter', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2165,12 +2298,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2194,7 +2331,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'queryId']; - const _validParams = ['projectId', 'queryId', 'headers']; + const _validParams = ['projectId', 'queryId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2222,11 +2359,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2256,7 +2397,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'queryId', 'naturalLanguageQuery', 'examples']; - const _validParams = ['projectId', 'queryId', 'naturalLanguageQuery', 'examples', 'filter', 'headers']; + const _validParams = ['projectId', 'queryId', 'naturalLanguageQuery', 'examples', 'filter', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2291,12 +2432,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2323,7 +2468,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'queryId']; - const _validParams = ['projectId', 'queryId', 'headers']; + const _validParams = ['projectId', 'queryId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2351,10 +2496,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2381,7 +2530,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2408,11 +2557,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2445,7 +2598,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'enrichment']; - const _validParams = ['projectId', 'enrichment', 'file', 'headers']; + const _validParams = ['projectId', 'enrichment', 'file', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2475,18 +2628,22 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2510,7 +2667,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'enrichmentId']; - const _validParams = ['projectId', 'enrichmentId', 'headers']; + const _validParams = ['projectId', 'enrichmentId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2538,11 +2695,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2568,7 +2729,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'enrichmentId', 'name']; - const _validParams = ['projectId', 'enrichmentId', 'name', 'description', 'headers']; + const _validParams = ['projectId', 'enrichmentId', 'name', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2602,12 +2763,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2633,7 +2798,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'enrichmentId']; - const _validParams = ['projectId', 'enrichmentId', 'headers']; + const _validParams = ['projectId', 'enrichmentId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2661,10 +2826,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2702,7 +2871,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2730,11 +2899,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2762,7 +2935,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId', 'batchId']; - const _validParams = ['projectId', 'collectionId', 'batchId', 'headers']; + const _validParams = ['projectId', 'collectionId', 'batchId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2791,11 +2964,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2830,7 +3007,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId', 'batchId']; - const _validParams = ['projectId', 'collectionId', 'batchId', 'file', 'filename', 'headers']; + const _validParams = ['projectId', 'collectionId', 'batchId', 'file', 'filename', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2862,18 +3039,22 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2900,7 +3081,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId']; - const _validParams = ['projectId', 'headers']; + const _validParams = ['projectId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2927,11 +3108,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2969,7 +3154,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'trainingData', 'classifier']; - const _validParams = ['projectId', 'trainingData', 'classifier', 'testData', 'headers']; + const _validParams = ['projectId', 'trainingData', 'classifier', 'testData', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3003,18 +3188,22 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3038,7 +3227,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId']; - const _validParams = ['projectId', 'classifierId', 'headers']; + const _validParams = ['projectId', 'classifierId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3066,11 +3255,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3104,7 +3297,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId', 'classifier']; - const _validParams = ['projectId', 'classifierId', 'classifier', 'trainingData', 'testData', 'headers']; + const _validParams = ['projectId', 'classifierId', 'classifier', 'trainingData', 'testData', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3139,18 +3332,22 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3174,7 +3371,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId']; - const _validParams = ['projectId', 'classifierId', 'headers']; + const _validParams = ['projectId', 'classifierId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3202,10 +3399,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3233,7 +3434,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId']; - const _validParams = ['projectId', 'classifierId', 'headers']; + const _validParams = ['projectId', 'classifierId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3261,11 +3462,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3309,7 +3514,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId', 'name']; - const _validParams = ['projectId', 'classifierId', 'name', 'description', 'learningRate', 'l1RegularizationStrengths', 'l2RegularizationStrengths', 'trainingMaxSteps', 'improvementRatio', 'headers']; + const _validParams = ['projectId', 'classifierId', 'name', 'description', 'learningRate', 'l1RegularizationStrengths', 'l2RegularizationStrengths', 'trainingMaxSteps', 'improvementRatio', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3348,12 +3553,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3378,7 +3587,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId', 'modelId']; - const _validParams = ['projectId', 'classifierId', 'modelId', 'headers']; + const _validParams = ['projectId', 'classifierId', 'modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3407,11 +3616,15 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3438,7 +3651,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId', 'modelId']; - const _validParams = ['projectId', 'classifierId', 'modelId', 'name', 'description', 'headers']; + const _validParams = ['projectId', 'classifierId', 'modelId', 'name', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3473,12 +3686,16 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3503,7 +3720,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'classifierId', 'modelId']; - const _validParams = ['projectId', 'classifierId', 'modelId', 'headers']; + const _validParams = ['projectId', 'classifierId', 'modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3532,10 +3749,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3594,7 +3815,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'file', 'filename', 'fileContentType', 'metadata', 'headers']; + const _validParams = ['projectId', 'collectionId', 'file', 'filename', 'fileContentType', 'metadata', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3626,18 +3847,22 @@ class DiscoveryV2 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3669,7 +3894,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customerId']; - const _validParams = ['customerId', 'headers']; + const _validParams = ['customerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3692,10 +3917,14 @@ class DiscoveryV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3739,13 +3968,17 @@ namespace DiscoveryV2 { * request interfaces ************************/ + interface DefaultParams { + headers?: OutgoingHttpHeaders; + signal?: AbortSignal; + } + /** Parameters for the `listProjects` operation. */ - export interface ListProjectsParams { - headers?: OutgoingHttpHeaders; + export interface ListProjectsParams extends DefaultParams { } /** Parameters for the `createProject` operation. */ - export interface CreateProjectParams { + export interface CreateProjectParams extends DefaultParams { /** The human readable name of this project. */ name: string; /** The type of project. @@ -3761,7 +3994,6 @@ namespace DiscoveryV2 { type: CreateProjectConstants.Type | string; /** Default query parameters for this project. */ defaultQueryParameters?: DefaultQueryParams; - headers?: OutgoingHttpHeaders; } /** Constants for the `createProject` operation. */ @@ -3778,36 +4010,33 @@ namespace DiscoveryV2 { } /** Parameters for the `getProject` operation. */ - export interface GetProjectParams { + export interface GetProjectParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateProject` operation. */ - export interface UpdateProjectParams { + export interface UpdateProjectParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The new name to give this project. */ name?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteProject` operation. */ - export interface DeleteProjectParams { + export interface DeleteProjectParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listFields` operation. */ - export interface ListFieldsParams { + export interface ListFieldsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -3816,20 +4045,18 @@ namespace DiscoveryV2 { * project are used. */ collectionIds?: string[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listCollections` operation. */ - export interface ListCollectionsParams { + export interface ListCollectionsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createCollection` operation. */ - export interface CreateCollectionParams { + export interface CreateCollectionParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -3854,22 +4081,20 @@ namespace DiscoveryV2 { * documentation](/docs/discovery-data?topic=discovery-data-project-defaults). */ enrichments?: CollectionEnrichment[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getCollection` operation. */ - export interface GetCollectionParams { + export interface GetCollectionParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateCollection` operation. */ - export interface UpdateCollectionParams { + export interface UpdateCollectionParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -3886,22 +4111,20 @@ namespace DiscoveryV2 { ocrEnabled?: boolean; /** An array of enrichments that are applied to this collection. */ enrichments?: CollectionEnrichment[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteCollection` operation. */ - export interface DeleteCollectionParams { + export interface DeleteCollectionParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listDocuments` operation. */ - export interface ListDocumentsParams { + export interface ListDocumentsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -3951,11 +4174,10 @@ namespace DiscoveryV2 { * hexadecimal string. */ sha256?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addDocument` operation. */ - export interface AddDocumentParams { + export interface AddDocumentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -3992,7 +4214,6 @@ namespace DiscoveryV2 { * with other collections. */ xWatsonDiscoveryForce?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `addDocument` operation. */ @@ -4009,7 +4230,7 @@ namespace DiscoveryV2 { } /** Parameters for the `getDocument` operation. */ - export interface GetDocumentParams { + export interface GetDocumentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4018,11 +4239,10 @@ namespace DiscoveryV2 { collectionId: string; /** The ID of the document. */ documentId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateDocument` operation. */ - export interface UpdateDocumentParams { + export interface UpdateDocumentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4061,7 +4281,6 @@ namespace DiscoveryV2 { * with other collections. */ xWatsonDiscoveryForce?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `updateDocument` operation. */ @@ -4078,7 +4297,7 @@ namespace DiscoveryV2 { } /** Parameters for the `deleteDocument` operation. */ - export interface DeleteDocumentParams { + export interface DeleteDocumentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4091,11 +4310,10 @@ namespace DiscoveryV2 { * with other collections. */ xWatsonDiscoveryForce?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `query` operation. */ - export interface QueryParams { + export interface QueryParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4171,11 +4389,10 @@ namespace DiscoveryV2 { * **natural_language_query** parameter. */ similar?: QueryLargeSimilar; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getAutocompletion` operation. */ - export interface GetAutocompletionParams { + export interface GetAutocompletionParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4192,11 +4409,10 @@ namespace DiscoveryV2 { field?: string; /** The number of autocompletion suggestions to return. */ count?: number; - headers?: OutgoingHttpHeaders; } /** Parameters for the `queryCollectionNotices` operation. */ - export interface QueryCollectionNoticesParams { + export interface QueryCollectionNoticesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4228,11 +4444,10 @@ namespace DiscoveryV2 { * **offset** values together in any one query is **10000**. */ offset?: number; - headers?: OutgoingHttpHeaders; } /** Parameters for the `queryNotices` operation. */ - export interface QueryNoticesParams { + export interface QueryNoticesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4262,22 +4477,20 @@ namespace DiscoveryV2 { * **offset** values together in any one query is **10000**. */ offset?: number; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getStopwordList` operation. */ - export interface GetStopwordListParams { + export interface GetStopwordListParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createStopwordList` operation. */ - export interface CreateStopwordListParams { + export interface CreateStopwordListParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4286,33 +4499,30 @@ namespace DiscoveryV2 { collectionId: string; /** List of stop words. */ stopwords?: string[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteStopwordList` operation. */ - export interface DeleteStopwordListParams { + export interface DeleteStopwordListParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listExpansions` operation. */ - export interface ListExpansionsParams { + export interface ListExpansionsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createExpansions` operation. */ - export interface CreateExpansionsParams { + export interface CreateExpansionsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4333,49 +4543,44 @@ namespace DiscoveryV2 { * in the expanded terms list. */ expansions: Expansion[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteExpansions` operation. */ - export interface DeleteExpansionsParams { + export interface DeleteExpansionsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getComponentSettings` operation. */ - export interface GetComponentSettingsParams { + export interface GetComponentSettingsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listTrainingQueries` operation. */ - export interface ListTrainingQueriesParams { + export interface ListTrainingQueriesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteTrainingQueries` operation. */ - export interface DeleteTrainingQueriesParams { + export interface DeleteTrainingQueriesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createTrainingQuery` operation. */ - export interface CreateTrainingQueryParams { + export interface CreateTrainingQueryParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4390,22 +4595,20 @@ namespace DiscoveryV2 { * for optimal ranking results. */ filter?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getTrainingQuery` operation. */ - export interface GetTrainingQueryParams { + export interface GetTrainingQueryParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The ID of the query used for training. */ queryId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateTrainingQuery` operation. */ - export interface UpdateTrainingQueryParams { + export interface UpdateTrainingQueryParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4422,31 +4625,28 @@ namespace DiscoveryV2 { * for optimal ranking results. */ filter?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteTrainingQuery` operation. */ - export interface DeleteTrainingQueryParams { + export interface DeleteTrainingQueryParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The ID of the query used for training. */ queryId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listEnrichments` operation. */ - export interface ListEnrichmentsParams { + export interface ListEnrichmentsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createEnrichment` operation. */ - export interface CreateEnrichmentParams { + export interface CreateEnrichmentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4462,22 +4662,20 @@ namespace DiscoveryV2 { * * ZIP for `watson_knowledge_studio_model` and `rule_based` (Studio Advanced Rule Editor). */ file?: NodeJS.ReadableStream | Buffer; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getEnrichment` operation. */ - export interface GetEnrichmentParams { + export interface GetEnrichmentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the enrichment. */ enrichmentId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateEnrichment` operation. */ - export interface UpdateEnrichmentParams { + export interface UpdateEnrichmentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4488,33 +4686,30 @@ namespace DiscoveryV2 { name: string; /** A new description for the enrichment. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteEnrichment` operation. */ - export interface DeleteEnrichmentParams { + export interface DeleteEnrichmentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the enrichment. */ enrichmentId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listBatches` operation. */ - export interface ListBatchesParams { + export interface ListBatchesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `pullBatches` operation. */ - export interface PullBatchesParams { + export interface PullBatchesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4523,11 +4718,10 @@ namespace DiscoveryV2 { collectionId: string; /** The Universally Unique Identifier (UUID) of the document batch that is being requested from Discovery. */ batchId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `pushBatches` operation. */ - export interface PushBatchesParams { + export interface PushBatchesParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4546,20 +4740,18 @@ namespace DiscoveryV2 { file?: NodeJS.ReadableStream | Buffer; /** The filename for file. */ filename?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listDocumentClassifiers` operation. */ - export interface ListDocumentClassifiersParams { + export interface ListDocumentClassifiersParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createDocumentClassifier` operation. */ - export interface CreateDocumentClassifierParams { + export interface CreateDocumentClassifierParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4578,22 +4770,20 @@ namespace DiscoveryV2 { * training and test data. */ testData?: NodeJS.ReadableStream | Buffer; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getDocumentClassifier` operation. */ - export interface GetDocumentClassifierParams { + export interface GetDocumentClassifierParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateDocumentClassifier` operation. */ - export interface UpdateDocumentClassifierParams { + export interface UpdateDocumentClassifierParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4616,33 +4806,30 @@ namespace DiscoveryV2 { * training and test data. */ testData?: NodeJS.ReadableStream | Buffer; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteDocumentClassifier` operation. */ - export interface DeleteDocumentClassifierParams { + export interface DeleteDocumentClassifierParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listDocumentClassifierModels` operation. */ - export interface ListDocumentClassifierModelsParams { + export interface ListDocumentClassifierModelsParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ projectId: string; /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createDocumentClassifierModel` operation. */ - export interface CreateDocumentClassifierModelParams { + export interface CreateDocumentClassifierModelParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4676,11 +4863,10 @@ namespace DiscoveryV2 { * point. The default value is `0.00001`. */ improvementRatio?: number; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getDocumentClassifierModel` operation. */ - export interface GetDocumentClassifierModelParams { + export interface GetDocumentClassifierModelParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4689,11 +4875,10 @@ namespace DiscoveryV2 { classifierId: string; /** The Universally Unique Identifier (UUID) of the classifier model. */ modelId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateDocumentClassifierModel` operation. */ - export interface UpdateDocumentClassifierModelParams { + export interface UpdateDocumentClassifierModelParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4706,11 +4891,10 @@ namespace DiscoveryV2 { name?: string; /** A new description for the enrichment. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteDocumentClassifierModel` operation. */ - export interface DeleteDocumentClassifierModelParams { + export interface DeleteDocumentClassifierModelParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4719,11 +4903,10 @@ namespace DiscoveryV2 { classifierId: string; /** The Universally Unique Identifier (UUID) of the classifier model. */ modelId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `analyzeDocument` operation. */ - export interface AnalyzeDocumentParams { + export interface AnalyzeDocumentParams extends DefaultParams { /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate * and Deploy* page in Discovery. */ @@ -4756,7 +4939,6 @@ namespace DiscoveryV2 { * }. */ metadata?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `analyzeDocument` operation. */ @@ -4773,10 +4955,9 @@ namespace DiscoveryV2 { } /** Parameters for the `deleteUserData` operation. */ - export interface DeleteUserDataParams { + export interface DeleteUserDataParams extends DefaultParams { /** The customer ID for which all data is to be deleted. */ customerId: string; - headers?: OutgoingHttpHeaders; } /************************* From 98d2bd0206e680db29ab8c560892624fe5790b9c Mon Sep 17 00:00:00 2001 From: Nataliia Kirinovych Date: Fri, 13 Jun 2025 15:11:07 +0100 Subject: [PATCH 2/7] feat(sdk-core): update the ibm-cloud-sdk-core to 5.4.0 --- package-lock.json | 43 +++++++++++++++++++++++-------------------- package.json | 2 +- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a64e44240..69c2f5eac1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "async": "^3.2.0", "camelcase": "^6.2.0", "extend": "~3.0.2", - "ibm-cloud-sdk-core": "^5.1.0", + "ibm-cloud-sdk-core": "^5.4.0", "isstream": "~0.1.2", "websocket": "^1.0.33" }, @@ -1923,9 +1923,10 @@ } }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", + "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -5094,14 +5095,15 @@ } }, "node_modules/ibm-cloud-sdk-core": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ibm-cloud-sdk-core/-/ibm-cloud-sdk-core-5.1.0.tgz", - "integrity": "sha512-KJCbPz3tiXB1NGAD7cL4JtwpWV8yd/C7jsaHsxvedMo2ZblNG8emMyvSpGhiKAQVZmi3c0ujz6eJdy22NHuUWQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/ibm-cloud-sdk-core/-/ibm-cloud-sdk-core-5.4.0.tgz", + "integrity": "sha512-c4cwOuUDbMiFROYM/Ti1aC+Umi1v3TdvC2DO5zR7w44FYY/3xrs79+3DVPXt/nRhJeaMHN2L9XwlXsPSoVDHJA==", + "license": "Apache-2.0", "dependencies": { "@types/debug": "^4.1.12", - "@types/node": "~10.14.19", + "@types/node": "^18.19.80", "@types/tough-cookie": "^4.0.0", - "axios": "1.7.4", + "axios": "^1.8.2", "camelcase": "^6.3.0", "debug": "^4.3.4", "dotenv": "^16.4.5", @@ -5119,24 +5121,19 @@ } }, "node_modules/ibm-cloud-sdk-core/node_modules/@types/node": { - "version": "10.14.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.22.tgz", - "integrity": "sha512-9taxKC944BqoTVjE+UT3pQH0nHZlTvITwfsOZqyc+R3sfJuxaTtxWjfn1K2UlxyPcKHf0rnaXcVFrS9F9vf0bw==" - }, - "node_modules/ibm-cloud-sdk-core/node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "version": "18.19.111", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.111.tgz", + "integrity": "sha512-90sGdgA+QLJr1F9X79tQuEut0gEYIfkX9pydI4XGRgvFo9g2JWswefI+WUSUHPYVBHYSEfTEqBxA5hQvAZB3Mw==", + "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" + "undici-types": "~5.26.4" } }, "node_modules/ibm-cloud-sdk-core/node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -12909,6 +12906,12 @@ "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", "dev": true }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, "node_modules/unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", diff --git a/package.json b/package.json index 962a54c868..928de16c59 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "async": "^3.2.0", "camelcase": "^6.2.0", "extend": "~3.0.2", - "ibm-cloud-sdk-core": "^5.1.0", + "ibm-cloud-sdk-core": "^5.4.0", "isstream": "~0.1.2", "websocket": "^1.0.33" }, From 947c38fb55a52fa32ceef161f1251a2b10592580 Mon Sep 17 00:00:00 2001 From: Nataliia Kirinovych Date: Fri, 13 Jun 2025 15:12:07 +0100 Subject: [PATCH 3/7] feat(tts&stt): Add new model enum values; add signal to axios --- speech-to-text/v1-generated.ts | 386 ++++++++++++++++++++++----------- text-to-speech/v1-generated.ts | 249 ++++++++++++++------- 2 files changed, 430 insertions(+), 205 deletions(-) diff --git a/speech-to-text/v1-generated.ts b/speech-to-text/v1-generated.ts index bba5da64f2..4a869f8379 100644 --- a/speech-to-text/v1-generated.ts +++ b/speech-to-text/v1-generated.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ import * as extend from 'extend'; import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { + AbortSignal, Authenticator, BaseService, UserOptions, @@ -118,7 +119,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -135,11 +136,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -166,7 +171,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId']; - const _validParams = ['modelId', 'headers']; + const _validParams = ['modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -188,11 +193,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -552,7 +561,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['audio']; - const _validParams = ['audio', 'contentType', 'model', 'speechBeginEvent', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'headers']; + const _validParams = ['audio', 'contentType', 'model', 'speechBeginEvent', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -601,12 +610,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': _params.contentType, }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -664,7 +677,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['callbackUrl']; - const _validParams = ['callbackUrl', 'userSecret', 'headers']; + const _validParams = ['callbackUrl', 'userSecret', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -687,11 +700,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -718,7 +735,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['callbackUrl']; - const _validParams = ['callbackUrl', 'headers']; + const _validParams = ['callbackUrl', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -740,10 +757,14 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1148,7 +1169,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['audio']; - const _validParams = ['audio', 'contentType', 'model', 'callbackUrl', 'events', 'userToken', 'resultsTtl', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'processingMetrics', 'processingMetricsInterval', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'headers']; + const _validParams = ['audio', 'contentType', 'model', 'callbackUrl', 'events', 'userToken', 'resultsTtl', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'processingMetrics', 'processingMetricsInterval', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1202,12 +1223,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': _params.contentType, }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1236,7 +1261,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1253,11 +1278,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1290,7 +1319,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['id']; - const _validParams = ['id', 'headers']; + const _validParams = ['id', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1312,11 +1341,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1343,7 +1376,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['id']; - const _validParams = ['id', 'headers']; + const _validParams = ['id', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1365,10 +1398,14 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1472,7 +1509,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['name', 'baseModelName']; - const _validParams = ['name', 'baseModelName', 'dialect', 'description', 'headers']; + const _validParams = ['name', 'baseModelName', 'dialect', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1497,12 +1534,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1539,7 +1580,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['language', 'headers']; + const _validParams = ['language', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1561,11 +1602,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1596,7 +1641,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1618,11 +1663,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1654,7 +1703,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1676,11 +1725,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1782,7 +1835,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'wordTypeToAdd', 'customizationWeight', 'strict', 'force', 'headers']; + const _validParams = ['customizationId', 'wordTypeToAdd', 'customizationWeight', 'strict', 'force', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1812,11 +1865,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1849,7 +1906,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1871,11 +1928,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1923,7 +1984,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1945,11 +2006,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1982,7 +2047,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2004,11 +2069,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2104,7 +2173,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'corpusName', 'corpusFile']; - const _validParams = ['customizationId', 'corpusName', 'corpusFile', 'allowOverwrite', 'headers']; + const _validParams = ['customizationId', 'corpusName', 'corpusFile', 'allowOverwrite', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2134,18 +2203,22 @@ class SpeechToTextV1 extends BaseService { method: 'POST', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2176,7 +2249,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'corpusName']; - const _validParams = ['customizationId', 'corpusName', 'headers']; + const _validParams = ['customizationId', 'corpusName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2199,11 +2272,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2240,7 +2317,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'corpusName']; - const _validParams = ['customizationId', 'corpusName', 'headers']; + const _validParams = ['customizationId', 'corpusName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2263,11 +2340,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2319,7 +2400,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'wordType', 'sort', 'headers']; + const _validParams = ['customizationId', 'wordType', 'sort', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2347,11 +2428,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2438,7 +2523,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'words']; - const _validParams = ['customizationId', 'words', 'headers']; + const _validParams = ['customizationId', 'words', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2465,12 +2550,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2568,7 +2657,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'wordName']; - const _validParams = ['customizationId', 'wordName', 'word', 'mappingOnly', 'soundsLike', 'displayAs', 'headers']; + const _validParams = ['customizationId', 'wordName', 'word', 'mappingOnly', 'soundsLike', 'displayAs', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2599,12 +2688,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2635,7 +2728,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'wordName']; - const _validParams = ['customizationId', 'wordName', 'headers']; + const _validParams = ['customizationId', 'wordName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2658,11 +2751,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2696,7 +2793,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'wordName']; - const _validParams = ['customizationId', 'wordName', 'headers']; + const _validParams = ['customizationId', 'wordName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2719,11 +2816,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2758,7 +2859,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2780,11 +2881,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2867,7 +2972,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'grammarName', 'grammarFile', 'contentType']; - const _validParams = ['customizationId', 'grammarName', 'grammarFile', 'contentType', 'allowOverwrite', 'headers']; + const _validParams = ['customizationId', 'grammarName', 'grammarFile', 'contentType', 'allowOverwrite', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2897,12 +3002,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': _params.contentType, }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2935,7 +3044,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'grammarName']; - const _validParams = ['customizationId', 'grammarName', 'headers']; + const _validParams = ['customizationId', 'grammarName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2958,11 +3067,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2998,7 +3111,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'grammarName']; - const _validParams = ['customizationId', 'grammarName', 'headers']; + const _validParams = ['customizationId', 'grammarName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3021,11 +3134,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3080,7 +3197,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['name', 'baseModelName']; - const _validParams = ['name', 'baseModelName', 'description', 'headers']; + const _validParams = ['name', 'baseModelName', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3104,12 +3221,16 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3146,7 +3267,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['language', 'headers']; + const _validParams = ['language', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3168,11 +3289,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3203,7 +3328,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3225,11 +3350,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3261,7 +3390,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3283,11 +3412,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3373,7 +3506,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'customLanguageModelId', 'strict', 'headers']; + const _validParams = ['customizationId', 'customLanguageModelId', 'strict', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3401,11 +3534,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3440,7 +3577,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3462,11 +3599,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3524,7 +3665,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'customLanguageModelId', 'force', 'headers']; + const _validParams = ['customizationId', 'customLanguageModelId', 'force', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3552,11 +3693,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3593,7 +3738,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3615,11 +3760,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3765,7 +3914,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'audioName', 'audioResource']; - const _validParams = ['customizationId', 'audioName', 'audioResource', 'contentType', 'containedContentType', 'allowOverwrite', 'headers']; + const _validParams = ['customizationId', 'audioName', 'audioResource', 'contentType', 'containedContentType', 'allowOverwrite', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3795,6 +3944,7 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': _params.contentType, @@ -3802,6 +3952,9 @@ class SpeechToTextV1 extends BaseService { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3846,7 +3999,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'audioName']; - const _validParams = ['customizationId', 'audioName', 'headers']; + const _validParams = ['customizationId', 'audioName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3869,11 +4022,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3910,7 +4067,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'audioName']; - const _validParams = ['customizationId', 'audioName', 'headers']; + const _validParams = ['customizationId', 'audioName', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3933,11 +4090,15 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -3974,7 +4135,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customerId']; - const _validParams = ['customerId', 'headers']; + const _validParams = ['customerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -3996,10 +4157,14 @@ class SpeechToTextV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -4035,18 +4200,21 @@ namespace SpeechToTextV1 { * request interfaces ************************/ + interface DefaultParams { + headers?: OutgoingHttpHeaders; + signal?: AbortSignal; + } + /** Parameters for the `listModels` operation. */ - export interface ListModelsParams { - headers?: OutgoingHttpHeaders; + export interface ListModelsParams extends DefaultParams { } /** Parameters for the `getModel` operation. */ - export interface GetModelParams { + export interface GetModelParams extends DefaultParams { /** The identifier of the model in the form of its name from the output of the [List models](#listmodels) * method. */ modelId: GetModelConstants.ModelId | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `getModel` operation. */ @@ -4056,6 +4224,7 @@ namespace SpeechToTextV1 { AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel', AR_MS_TELEPHONY = 'ar-MS_Telephony', CS_CZ_TELEPHONY = 'cs-CZ_Telephony', + DE_DE = 'de-DE', DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel', DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', @@ -4142,7 +4311,7 @@ namespace SpeechToTextV1 { } /** Parameters for the `recognize` operation. */ - export interface RecognizeParams { + export interface RecognizeParams extends DefaultParams { /** The audio to transcribe. */ audio: NodeJS.ReadableStream | Buffer; /** The format (MIME type) of the audio. For more information about specifying an audio format, see **Audio @@ -4422,7 +4591,6 @@ namespace SpeechToTextV1 { * bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#insertion-bias). */ characterInsertionBias?: number; - headers?: OutgoingHttpHeaders; } /** Constants for the `recognize` operation. */ @@ -4451,6 +4619,7 @@ namespace SpeechToTextV1 { AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel', AR_MS_TELEPHONY = 'ar-MS_Telephony', CS_CZ_TELEPHONY = 'cs-CZ_Telephony', + DE_DE = 'de-DE', DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel', DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', @@ -4537,7 +4706,7 @@ namespace SpeechToTextV1 { } /** Parameters for the `registerCallback` operation. */ - export interface RegisterCallbackParams { + export interface RegisterCallbackParams extends DefaultParams { /** An HTTP or HTTPS URL to which callback notifications are to be sent. To be allowlisted, the URL must * successfully echo the challenge string during URL verification. During verification, the client can also check * the signature that the service sends in the `X-Callback-Signature` header to verify the origin of the request. @@ -4549,18 +4718,16 @@ namespace SpeechToTextV1 { * omit the parameter, the service does not send the header. */ userSecret?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `unregisterCallback` operation. */ - export interface UnregisterCallbackParams { + export interface UnregisterCallbackParams extends DefaultParams { /** The callback URL that is to be unregistered. */ callbackUrl: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createJob` operation. */ - export interface CreateJobParams { + export interface CreateJobParams extends DefaultParams { /** The audio to transcribe. */ audio: NodeJS.ReadableStream | Buffer; /** The format (MIME type) of the audio. For more information about specifying an audio format, see **Audio @@ -4892,7 +5059,6 @@ namespace SpeechToTextV1 { * bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#insertion-bias). */ characterInsertionBias?: number; - headers?: OutgoingHttpHeaders; } /** Constants for the `createJob` operation. */ @@ -4921,6 +5087,7 @@ namespace SpeechToTextV1 { AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel', AR_MS_TELEPHONY = 'ar-MS_Telephony', CS_CZ_TELEPHONY = 'cs-CZ_Telephony', + DE_DE = 'de-DE', DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel', DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', @@ -5014,30 +5181,27 @@ namespace SpeechToTextV1 { } /** Parameters for the `checkJobs` operation. */ - export interface CheckJobsParams { - headers?: OutgoingHttpHeaders; + export interface CheckJobsParams extends DefaultParams { } /** Parameters for the `checkJob` operation. */ - export interface CheckJobParams { + export interface CheckJobParams extends DefaultParams { /** The identifier of the asynchronous job that is to be used for the request. You must make the request with * credentials for the instance of the service that owns the job. */ id: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteJob` operation. */ - export interface DeleteJobParams { + export interface DeleteJobParams extends DefaultParams { /** The identifier of the asynchronous job that is to be used for the request. You must make the request with * credentials for the instance of the service that owns the job. */ id: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createLanguageModel` operation. */ - export interface CreateLanguageModelParams { + export interface CreateLanguageModelParams extends DefaultParams { /** A user-defined name for the new custom language model. Use a localized name that matches the language of the * custom model. Use a name that describes the domain of the custom model, such as `Medical custom model` or `Legal * custom model`. Use a name that is unique among all custom language models that you own. @@ -5073,7 +5237,6 @@ namespace SpeechToTextV1 { * language of the custom model. Include a maximum of 128 characters in the description. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `createLanguageModel` operation. */ @@ -5082,6 +5245,7 @@ namespace SpeechToTextV1 { export enum BaseModelName { AR_MS_TELEPHONY = 'ar-MS_Telephony', CS_CZ_TELEPHONY = 'cs-CZ_Telephony', + DE_DE = 'de-DE', DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel', DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', @@ -5166,7 +5330,7 @@ namespace SpeechToTextV1 { } /** Parameters for the `listLanguageModels` operation. */ - export interface ListLanguageModelsParams { + export interface ListLanguageModelsParams extends DefaultParams { /** The identifier of the language for which custom language or custom acoustic models are to be returned. * Specify the five-character language identifier; for example, specify `en-US` to see all custom language or * custom acoustic models that are based on US English models. Omit the parameter to see all custom language or @@ -5176,7 +5340,6 @@ namespace SpeechToTextV1 { * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support). */ language?: ListLanguageModelsConstants.Language | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `listLanguageModels` operation. */ @@ -5213,25 +5376,23 @@ namespace SpeechToTextV1 { } /** Parameters for the `getLanguageModel` operation. */ - export interface GetLanguageModelParams { + export interface GetLanguageModelParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteLanguageModel` operation. */ - export interface DeleteLanguageModelParams { + export interface DeleteLanguageModelParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `trainLanguageModel` operation. */ - export interface TrainLanguageModelParams { + export interface TrainLanguageModelParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5282,7 +5443,6 @@ namespace SpeechToTextV1 { * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-language-ng). */ force?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `trainLanguageModel` operation. */ @@ -5295,34 +5455,31 @@ namespace SpeechToTextV1 { } /** Parameters for the `resetLanguageModel` operation. */ - export interface ResetLanguageModelParams { + export interface ResetLanguageModelParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `upgradeLanguageModel` operation. */ - export interface UpgradeLanguageModelParams { + export interface UpgradeLanguageModelParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listCorpora` operation. */ - export interface ListCorporaParams { + export interface ListCorporaParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addCorpus` operation. */ - export interface AddCorpusParams { + export interface AddCorpusParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5355,33 +5512,30 @@ namespace SpeechToTextV1 { * does not already exist. */ allowOverwrite?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getCorpus` operation. */ - export interface GetCorpusParams { + export interface GetCorpusParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; /** The name of the corpus for the custom language model. */ corpusName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteCorpus` operation. */ - export interface DeleteCorpusParams { + export interface DeleteCorpusParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; /** The name of the corpus for the custom language model. */ corpusName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listWords` operation. */ - export interface ListWordsParams { + export interface ListWordsParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5405,7 +5559,6 @@ namespace SpeechToTextV1 { * `%2B`. */ sort?: ListWordsConstants.Sort | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `listWords` operation. */ @@ -5425,7 +5578,7 @@ namespace SpeechToTextV1 { } /** Parameters for the `addWords` operation. */ - export interface AddWordsParams { + export interface AddWordsParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5434,11 +5587,10 @@ namespace SpeechToTextV1 { * updated in the custom language model. */ words: CustomWord[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addWord` operation. */ - export interface AddWordParams { + export interface AddWordParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5488,11 +5640,10 @@ namespace SpeechToTextV1 { * display-as value if you omit the field. */ displayAs?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getWord` operation. */ - export interface GetWordParams { + export interface GetWordParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5502,11 +5653,10 @@ namespace SpeechToTextV1 { * encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#charEncoding). */ wordName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteWord` operation. */ - export interface DeleteWordParams { + export interface DeleteWordParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5516,20 +5666,18 @@ namespace SpeechToTextV1 { * encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#charEncoding). */ wordName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listGrammars` operation. */ - export interface ListGrammarsParams { + export interface ListGrammarsParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addGrammar` operation. */ - export interface AddGrammarParams { + export interface AddGrammarParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5566,7 +5714,6 @@ namespace SpeechToTextV1 { * name does not already exist. */ allowOverwrite?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `addGrammar` operation. */ @@ -5579,29 +5726,27 @@ namespace SpeechToTextV1 { } /** Parameters for the `getGrammar` operation. */ - export interface GetGrammarParams { + export interface GetGrammarParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; /** The name of the grammar for the custom language model. */ grammarName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteGrammar` operation. */ - export interface DeleteGrammarParams { + export interface DeleteGrammarParams extends DefaultParams { /** The customization ID (GUID) of the custom language model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; /** The name of the grammar for the custom language model. */ grammarName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createAcousticModel` operation. */ - export interface CreateAcousticModelParams { + export interface CreateAcousticModelParams extends DefaultParams { /** A user-defined name for the new custom acoustic model. Use a localized name that matches the language of the * custom model. Use a name that describes the acoustic environment of the custom model, such as `Mobile custom * model` or `Noisy car custom model`. Use a name that is unique among all custom acoustic models that you own. @@ -5621,7 +5766,6 @@ namespace SpeechToTextV1 { * language of the custom model. Include a maximum of 128 characters in the description. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `createAcousticModel` operation. */ @@ -5629,6 +5773,7 @@ namespace SpeechToTextV1 { /** The name of the base language model that is to be customized by the new custom acoustic model. The new custom model can be used only with the base model that it customizes. To determine whether a base model supports acoustic model customization, refer to [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support). */ export enum BaseModelName { AR_MS_BROADBANDMODEL = 'ar-MS_BroadbandModel', + DE_DE = 'de-DE', DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel', @@ -5677,7 +5822,7 @@ namespace SpeechToTextV1 { } /** Parameters for the `listAcousticModels` operation. */ - export interface ListAcousticModelsParams { + export interface ListAcousticModelsParams extends DefaultParams { /** The identifier of the language for which custom language or custom acoustic models are to be returned. * Specify the five-character language identifier; for example, specify `en-US` to see all custom language or * custom acoustic models that are based on US English models. Omit the parameter to see all custom language or @@ -5687,7 +5832,6 @@ namespace SpeechToTextV1 { * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support). */ language?: ListAcousticModelsConstants.Language | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `listAcousticModels` operation. */ @@ -5724,25 +5868,23 @@ namespace SpeechToTextV1 { } /** Parameters for the `getAcousticModel` operation. */ - export interface GetAcousticModelParams { + export interface GetAcousticModelParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteAcousticModel` operation. */ - export interface DeleteAcousticModelParams { + export interface DeleteAcousticModelParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `trainAcousticModel` operation. */ - export interface TrainAcousticModelParams { + export interface TrainAcousticModelParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5761,20 +5903,18 @@ namespace SpeechToTextV1 { * contains one or more invalid audio resources. */ strict?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `resetAcousticModel` operation. */ - export interface ResetAcousticModelParams { + export interface ResetAcousticModelParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `upgradeAcousticModel` operation. */ - export interface UpgradeAcousticModelParams { + export interface UpgradeAcousticModelParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5792,20 +5932,18 @@ namespace SpeechToTextV1 { * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-acoustic). */ force?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listAudio` operation. */ - export interface ListAudioParams { + export interface ListAudioParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addAudio` operation. */ - export interface AddAudioParams { + export interface AddAudioParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ @@ -5852,7 +5990,6 @@ namespace SpeechToTextV1 { * if an audio resource with the same name does not already exist. */ allowOverwrite?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `addAudio` operation. */ @@ -5898,32 +6035,29 @@ namespace SpeechToTextV1 { } /** Parameters for the `getAudio` operation. */ - export interface GetAudioParams { + export interface GetAudioParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; /** The name of the audio resource for the custom acoustic model. */ audioName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteAudio` operation. */ - export interface DeleteAudioParams { + export interface DeleteAudioParams extends DefaultParams { /** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make * the request with credentials for the instance of the service that owns the custom model. */ customizationId: string; /** The name of the audio resource for the custom acoustic model. */ audioName: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteUserData` operation. */ - export interface DeleteUserDataParams { + export interface DeleteUserDataParams extends DefaultParams { /** The customer ID for which all data is to be deleted. */ customerId: string; - headers?: OutgoingHttpHeaders; } /************************* diff --git a/text-to-speech/v1-generated.ts b/text-to-speech/v1-generated.ts index ef319bf723..6dc7dffb43 100644 --- a/text-to-speech/v1-generated.ts +++ b/text-to-speech/v1-generated.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ import * as extend from 'extend'; import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { + AbortSignal, Authenticator, BaseService, UserOptions, @@ -111,7 +112,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -128,11 +129,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -163,7 +168,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['voice']; - const _validParams = ['voice', 'customizationId', 'headers']; + const _validParams = ['voice', 'customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -190,11 +195,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -231,25 +240,29 @@ class TextToSpeechV1 extends BaseService { * (`audio/ogg;codecs=opus`). The service always returns single-channel audio. * * `audio/alaw` - You must specify the `rate` of the audio. * * `audio/basic` - The service returns audio with a sampling rate of 8000 Hz. - * * `audio/flac` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. + * * `audio/flac` - You can optionally specify the `rate` of the audio. The default sampling rate is 24,000 Hz for + * Natural voices and 22,050 Hz for all other voices. * * `audio/l16` - You must specify the `rate` of the audio. You can optionally specify the `endianness` of the audio. * The default endianness is `little-endian`. - * * `audio/mp3` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. - * * `audio/mpeg` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. + * * `audio/mp3` - You can optionally specify the `rate` of the audio. The default sampling rate is 24,000 Hz for + * Natural voices and 22,050 Hz for for all other voices. + * * `audio/mpeg` - You can optionally specify the `rate` of the audio. The default sampling rate is 24,000 Hz for + * Natural voices and 22,050 Hz for all other voices. * * `audio/mulaw` - You must specify the `rate` of the audio. * * `audio/ogg` - The service returns the audio in the `vorbis` codec. You can optionally specify the `rate` of the - * audio. The default sampling rate is 22,050 Hz. + * audio. The default sampling rate is 48,000 Hz. * * `audio/ogg;codecs=opus` - You can optionally specify the `rate` of the audio. Only the following values are valid * sampling rates: `48000`, `24000`, `16000`, `12000`, or `8000`. If you specify a value other than one of these, the * service returns an error. The default sampling rate is 48,000 Hz. * * `audio/ogg;codecs=vorbis` - You can optionally specify the `rate` of the audio. The default sampling rate is - * 22,050 Hz. - * * `audio/wav` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. + * 48,000 Hz. + * * `audio/wav` - You can optionally specify the `rate` of the audio. The default sampling rate is 24,000 Hz for + * Natural voices and 22,050 Hz for all other voices. * * `audio/webm` - The service returns the audio in the `opus` codec. The service returns audio with a sampling rate * of 48,000 Hz. * * `audio/webm;codecs=opus` - The service returns audio with a sampling rate of 48,000 Hz. * * `audio/webm;codecs=vorbis` - You can optionally specify the `rate` of the audio. The default sampling rate is - * 22,050 Hz. + * 48,000 Hz. * * For more information about specifying an audio format, including additional details about some of the formats, see * [Using audio formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audio-formats). @@ -329,7 +342,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['text']; - const _validParams = ['text', 'accept', 'voice', 'customizationId', 'spellOutMode', 'ratePercentage', 'pitchPercentage', 'headers']; + const _validParams = ['text', 'accept', 'voice', 'customizationId', 'spellOutMode', 'ratePercentage', 'pitchPercentage', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -361,12 +374,16 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Content-Type': 'application/json', 'Accept': _params.accept, }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -412,7 +429,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['text']; - const _validParams = ['text', 'voice', 'format', 'customizationId', 'headers']; + const _validParams = ['text', 'voice', 'format', 'customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -437,11 +454,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -481,7 +502,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['name']; - const _validParams = ['name', 'language', 'description', 'headers']; + const _validParams = ['name', 'language', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -505,12 +526,16 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -539,7 +564,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['language', 'headers']; + const _validParams = ['language', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -561,11 +586,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -613,7 +642,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'name', 'description', 'words', 'headers']; + const _validParams = ['customizationId', 'name', 'description', 'words', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -642,12 +671,16 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -676,7 +709,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -698,11 +731,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -729,7 +766,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -751,10 +788,14 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -807,7 +848,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'words']; - const _validParams = ['customizationId', 'words', 'headers']; + const _validParams = ['customizationId', 'words', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -834,12 +875,16 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -867,7 +912,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -889,11 +934,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -946,7 +995,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'word', 'translation']; - const _validParams = ['customizationId', 'word', 'translation', 'partOfSpeech', 'headers']; + const _validParams = ['customizationId', 'word', 'translation', 'partOfSpeech', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -975,11 +1024,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1008,7 +1061,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'word']; - const _validParams = ['customizationId', 'word', 'headers']; + const _validParams = ['customizationId', 'word', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1031,11 +1084,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1063,7 +1120,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'word']; - const _validParams = ['customizationId', 'word', 'headers']; + const _validParams = ['customizationId', 'word', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1086,10 +1143,14 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1123,7 +1184,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId']; - const _validParams = ['customizationId', 'headers']; + const _validParams = ['customizationId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1145,11 +1206,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1254,7 +1319,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'promptId', 'metadata', 'file']; - const _validParams = ['customizationId', 'promptId', 'metadata', 'file', 'headers']; + const _validParams = ['customizationId', 'promptId', 'metadata', 'file', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1280,18 +1345,22 @@ class TextToSpeechV1 extends BaseService { url: '/v1/customizations/{customization_id}/prompts/{prompt_id}', method: 'POST', path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1321,7 +1390,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'promptId']; - const _validParams = ['customizationId', 'promptId', 'headers']; + const _validParams = ['customizationId', 'promptId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1344,11 +1413,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1381,7 +1454,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customizationId', 'promptId']; - const _validParams = ['customizationId', 'promptId', 'headers']; + const _validParams = ['customizationId', 'promptId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1404,10 +1477,14 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1437,7 +1514,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1454,11 +1531,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1526,7 +1607,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['speakerName', 'audio']; - const _validParams = ['speakerName', 'audio', 'headers']; + const _validParams = ['speakerName', 'audio', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1550,12 +1631,16 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'audio/wav', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1586,7 +1671,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['speakerId']; - const _validParams = ['speakerId', 'headers']; + const _validParams = ['speakerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1608,11 +1693,15 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1646,7 +1735,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['speakerId']; - const _validParams = ['speakerId', 'headers']; + const _validParams = ['speakerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1668,10 +1757,14 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1707,7 +1800,7 @@ class TextToSpeechV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customerId']; - const _validParams = ['customerId', 'headers']; + const _validParams = ['customerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1729,10 +1822,14 @@ class TextToSpeechV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1768,13 +1865,17 @@ namespace TextToSpeechV1 { * request interfaces ************************/ + interface DefaultParams { + headers?: OutgoingHttpHeaders; + signal?: AbortSignal; + } + /** Parameters for the `listVoices` operation. */ - export interface ListVoicesParams { - headers?: OutgoingHttpHeaders; + export interface ListVoicesParams extends DefaultParams { } /** Parameters for the `getVoice` operation. */ - export interface GetVoiceParams { + export interface GetVoiceParams extends DefaultParams { /** The voice for which information is to be returned. */ voice: GetVoiceConstants.Voice | string; /** The customization ID (GUID) of a custom model for which information is to be returned. You must make the @@ -1782,7 +1883,6 @@ namespace TextToSpeechV1 { * information about the specified voice with no customization. */ customizationId?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `getVoice` operation. */ @@ -1795,10 +1895,12 @@ namespace TextToSpeechV1 { EN_AU_HEIDIEXPRESSIVE = 'en-AU_HeidiExpressive', EN_AU_JACKEXPRESSIVE = 'en-AU_JackExpressive', EN_GB_CHARLOTTEV3VOICE = 'en-GB_CharlotteV3Voice', + EN_GB_GEORGEEXPRESSIVE = 'en-GB_GeorgeExpressive', EN_GB_JAMESV3VOICE = 'en-GB_JamesV3Voice', EN_GB_KATEV3VOICE = 'en-GB_KateV3Voice', EN_US_ALLISONEXPRESSIVE = 'en-US_AllisonExpressive', EN_US_ALLISONV3VOICE = 'en-US_AllisonV3Voice', + EN_US_ELLIENATURAL = 'en-US_EllieNatural', EN_US_EMILYV3VOICE = 'en-US_EmilyV3Voice', EN_US_EMMAEXPRESSIVE = 'en-US_EmmaExpressive', EN_US_HENRYV3VOICE = 'en-US_HenryV3Voice', @@ -1810,6 +1912,7 @@ namespace TextToSpeechV1 { EN_US_OLIVIAV3VOICE = 'en-US_OliviaV3Voice', ES_ES_ENRIQUEV3VOICE = 'es-ES_EnriqueV3Voice', ES_ES_LAURAV3VOICE = 'es-ES_LauraV3Voice', + ES_LA_DANIELAEXPRESSIVE = 'es-LA_DanielaExpressive', ES_LA_SOFIAV3VOICE = 'es-LA_SofiaV3Voice', ES_US_SOFIAV3VOICE = 'es-US_SofiaV3Voice', FR_CA_LOUISEV3VOICE = 'fr-CA_LouiseV3Voice', @@ -1820,11 +1923,12 @@ namespace TextToSpeechV1 { KO_KR_JINV3VOICE = 'ko-KR_JinV3Voice', NL_NL_MERELV3VOICE = 'nl-NL_MerelV3Voice', PT_BR_ISABELAV3VOICE = 'pt-BR_IsabelaV3Voice', + PT_BR_LUCASEXPRESSIVE = 'pt-BR_LucasExpressive', } } /** Parameters for the `synthesize` operation. */ - export interface SynthesizeParams { + export interface SynthesizeParams extends DefaultParams { /** The text to synthesize. */ text: string; /** The requested format (MIME type) of the audio. You can use the `Accept` header or the `accept` parameter to @@ -1892,7 +1996,6 @@ namespace TextToSpeechV1 { * pitch](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis-params#params-pitch-percentage). */ pitchPercentage?: number; - headers?: OutgoingHttpHeaders; } /** Constants for the `synthesize` operation. */ @@ -1922,10 +2025,12 @@ namespace TextToSpeechV1 { EN_AU_HEIDIEXPRESSIVE = 'en-AU_HeidiExpressive', EN_AU_JACKEXPRESSIVE = 'en-AU_JackExpressive', EN_GB_CHARLOTTEV3VOICE = 'en-GB_CharlotteV3Voice', + EN_GB_GEORGEEXPRESSIVE = 'en-GB_GeorgeExpressive', EN_GB_JAMESV3VOICE = 'en-GB_JamesV3Voice', EN_GB_KATEV3VOICE = 'en-GB_KateV3Voice', EN_US_ALLISONEXPRESSIVE = 'en-US_AllisonExpressive', EN_US_ALLISONV3VOICE = 'en-US_AllisonV3Voice', + EN_US_ELLIENATURAL = 'en-US_EllieNatural', EN_US_EMILYV3VOICE = 'en-US_EmilyV3Voice', EN_US_EMMAEXPRESSIVE = 'en-US_EmmaExpressive', EN_US_HENRYV3VOICE = 'en-US_HenryV3Voice', @@ -1937,6 +2042,7 @@ namespace TextToSpeechV1 { EN_US_OLIVIAV3VOICE = 'en-US_OliviaV3Voice', ES_ES_ENRIQUEV3VOICE = 'es-ES_EnriqueV3Voice', ES_ES_LAURAV3VOICE = 'es-ES_LauraV3Voice', + ES_LA_DANIELAEXPRESSIVE = 'es-LA_DanielaExpressive', ES_LA_SOFIAV3VOICE = 'es-LA_SofiaV3Voice', ES_US_SOFIAV3VOICE = 'es-US_SofiaV3Voice', FR_CA_LOUISEV3VOICE = 'fr-CA_LouiseV3Voice', @@ -1947,6 +2053,7 @@ namespace TextToSpeechV1 { KO_KR_JINV3VOICE = 'ko-KR_JinV3Voice', NL_NL_MERELV3VOICE = 'nl-NL_MerelV3Voice', PT_BR_ISABELAV3VOICE = 'pt-BR_IsabelaV3Voice', + PT_BR_LUCASEXPRESSIVE = 'pt-BR_LucasExpressive', } /** *For German voices,* indicates how the service is to spell out strings of individual letters. To indicate the pace of the spelling, specify one of the following values: * `default` - The service reads the characters at the rate at which it synthesizes speech for the request. You can also omit the parameter entirely to achieve the default behavior. * `singles` - The service reads the characters one at a time, with a brief pause between each character. * `pairs` - The service reads the characters two at a time, with a brief pause between each pair. * `triples` - The service reads the characters three at a time, with a brief pause between each triplet. For more information, see [Specifying how strings are spelled out](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis-params#params-spell-out-mode). */ export enum SpellOutMode { @@ -1958,7 +2065,7 @@ namespace TextToSpeechV1 { } /** Parameters for the `getPronunciation` operation. */ - export interface GetPronunciationParams { + export interface GetPronunciationParams extends DefaultParams { /** The word for which the pronunciation is requested. */ text: string; /** A voice that specifies the language in which the pronunciation is to be returned. If you omit the `voice` @@ -1983,7 +2090,6 @@ namespace TextToSpeechV1 { * to see the translation for the specified voice with no customization. */ customizationId?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `getPronunciation` operation. */ @@ -1996,10 +2102,12 @@ namespace TextToSpeechV1 { EN_AU_HEIDIEXPRESSIVE = 'en-AU_HeidiExpressive', EN_AU_JACKEXPRESSIVE = 'en-AU_JackExpressive', EN_GB_CHARLOTTEV3VOICE = 'en-GB_CharlotteV3Voice', + EN_GB_GEORGEEXPRESSIVE = 'en-GB_GeorgeExpressive', EN_GB_JAMESV3VOICE = 'en-GB_JamesV3Voice', EN_GB_KATEV3VOICE = 'en-GB_KateV3Voice', EN_US_ALLISONEXPRESSIVE = 'en-US_AllisonExpressive', EN_US_ALLISONV3VOICE = 'en-US_AllisonV3Voice', + EN_US_ELLIENATURAL = 'en-US_EllieNatural', EN_US_EMILYV3VOICE = 'en-US_EmilyV3Voice', EN_US_EMMAEXPRESSIVE = 'en-US_EmmaExpressive', EN_US_HENRYV3VOICE = 'en-US_HenryV3Voice', @@ -2011,6 +2119,7 @@ namespace TextToSpeechV1 { EN_US_OLIVIAV3VOICE = 'en-US_OliviaV3Voice', ES_ES_ENRIQUEV3VOICE = 'es-ES_EnriqueV3Voice', ES_ES_LAURAV3VOICE = 'es-ES_LauraV3Voice', + ES_LA_DANIELAEXPRESSIVE = 'es-LA_DanielaExpressive', ES_LA_SOFIAV3VOICE = 'es-LA_SofiaV3Voice', ES_US_SOFIAV3VOICE = 'es-US_SofiaV3Voice', FR_CA_LOUISEV3VOICE = 'fr-CA_LouiseV3Voice', @@ -2021,6 +2130,7 @@ namespace TextToSpeechV1 { KO_KR_JINV3VOICE = 'ko-KR_JinV3Voice', NL_NL_MERELV3VOICE = 'nl-NL_MerelV3Voice', PT_BR_ISABELAV3VOICE = 'pt-BR_IsabelaV3Voice', + PT_BR_LUCASEXPRESSIVE = 'pt-BR_LucasExpressive', } /** The phoneme format in which to return the pronunciation. Omit the parameter to obtain the pronunciation in the default format. */ export enum Format { @@ -2030,7 +2140,7 @@ namespace TextToSpeechV1 { } /** Parameters for the `createCustomModel` operation. */ - export interface CreateCustomModelParams { + export interface CreateCustomModelParams extends DefaultParams { /** The name of the new custom model. Use a localized name that matches the language of the custom model. Use a * name that describes the purpose of the custom model, such as `Medical custom model` or `Legal custom model`. Use * a name that is unique among all custom models that you own. @@ -2048,7 +2158,6 @@ namespace TextToSpeechV1 { * the custom model. Include a maximum of 128 characters in the description. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `createCustomModel` operation. */ @@ -2072,12 +2181,11 @@ namespace TextToSpeechV1 { } /** Parameters for the `listCustomModels` operation. */ - export interface ListCustomModelsParams { + export interface ListCustomModelsParams extends DefaultParams { /** The language for which custom models that are owned by the requesting credentials are to be returned. Omit * the parameter to see all custom models that are owned by the requester. */ language?: ListCustomModelsConstants.Language | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `listCustomModels` operation. */ @@ -2101,7 +2209,7 @@ namespace TextToSpeechV1 { } /** Parameters for the `updateCustomModel` operation. */ - export interface UpdateCustomModelParams { + export interface UpdateCustomModelParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ @@ -2114,29 +2222,26 @@ namespace TextToSpeechV1 { * for the custom model. Pass an empty array to make no additions or updates. */ words?: Word[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getCustomModel` operation. */ - export interface GetCustomModelParams { + export interface GetCustomModelParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteCustomModel` operation. */ - export interface DeleteCustomModelParams { + export interface DeleteCustomModelParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addWords` operation. */ - export interface AddWordsParams { + export interface AddWordsParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ @@ -2149,20 +2254,18 @@ namespace TextToSpeechV1 { * before lowercase letters. The array is empty if the custom model contains no words. */ words: Word[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listWords` operation. */ - export interface ListWordsParams { + export interface ListWordsParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addWord` operation. */ - export interface AddWordParams { + export interface AddWordParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ @@ -2181,7 +2284,6 @@ namespace TextToSpeechV1 { * entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes). */ partOfSpeech?: AddWordConstants.PartOfSpeech | string; - headers?: OutgoingHttpHeaders; } /** Constants for the `addWord` operation. */ @@ -2209,38 +2311,35 @@ namespace TextToSpeechV1 { } /** Parameters for the `getWord` operation. */ - export interface GetWordParams { + export interface GetWordParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; /** The word that is to be queried from the custom model. */ word: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteWord` operation. */ - export interface DeleteWordParams { + export interface DeleteWordParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; /** The word that is to be deleted from the custom model. */ word: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listCustomPrompts` operation. */ - export interface ListCustomPromptsParams { + export interface ListCustomPromptsParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `addCustomPrompt` operation. */ - export interface AddCustomPromptParams { + export interface AddCustomPromptParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ @@ -2267,38 +2366,34 @@ namespace TextToSpeechV1 { * * The length of the prompt audio is limited to 30 seconds. */ file: NodeJS.ReadableStream | Buffer; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getCustomPrompt` operation. */ - export interface GetCustomPromptParams { + export interface GetCustomPromptParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; /** The identifier (name) of the prompt. */ promptId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteCustomPrompt` operation. */ - export interface DeleteCustomPromptParams { + export interface DeleteCustomPromptParams extends DefaultParams { /** The customization ID (GUID) of the custom model. You must make the request with credentials for the instance * of the service that owns the custom model. */ customizationId: string; /** The identifier (name) of the prompt that is to be deleted. */ promptId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listSpeakerModels` operation. */ - export interface ListSpeakerModelsParams { - headers?: OutgoingHttpHeaders; + export interface ListSpeakerModelsParams extends DefaultParams { } /** Parameters for the `createSpeakerModel` operation. */ - export interface CreateSpeakerModelParams { + export interface CreateSpeakerModelParams extends DefaultParams { /** The name of the speaker that is to be added to the service instance. * * Include a maximum of 49 characters in the name. * * Include only alphanumeric characters and `_` (underscores) in the name. @@ -2314,32 +2409,28 @@ namespace TextToSpeechV1 { * five to ten sentences is recommended. */ audio: NodeJS.ReadableStream | Buffer; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getSpeakerModel` operation. */ - export interface GetSpeakerModelParams { + export interface GetSpeakerModelParams extends DefaultParams { /** The speaker ID (GUID) of the speaker model. You must make the request with service credentials for the * instance of the service that owns the speaker model. */ speakerId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteSpeakerModel` operation. */ - export interface DeleteSpeakerModelParams { + export interface DeleteSpeakerModelParams extends DefaultParams { /** The speaker ID (GUID) of the speaker model. You must make the request with service credentials for the * instance of the service that owns the speaker model. */ speakerId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteUserData` operation. */ - export interface DeleteUserDataParams { + export interface DeleteUserDataParams extends DefaultParams { /** The customer ID for which all data is to be deleted. */ customerId: string; - headers?: OutgoingHttpHeaders; } /************************* From f030424810fe29461c11de0813a75d686e3fad22 Mon Sep 17 00:00:00 2001 From: Nataliia Kirinovych Date: Fri, 13 Jun 2025 15:13:16 +0100 Subject: [PATCH 4/7] feat(wav2): Add turn events and required properties; add signal to axios properties BREAKING CHANGE: add required conversational_search param to SearchSettings interface --- assistant/v2.ts | 2012 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 1500 insertions(+), 512 deletions(-) diff --git a/assistant/v2.ts b/assistant/v2.ts index 928c714d04..08ea901cf7 100644 --- a/assistant/v2.ts +++ b/assistant/v2.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ import * as extend from 'extend'; import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { + AbortSignal, Authenticator, BaseService, UserOptions, @@ -48,7 +49,7 @@ class AssistantV2 extends BaseService { static DEFAULT_SERVICE_NAME: string = 'conversation'; /** Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is - * `2023-06-15`. + * `2024-08-25`. */ version: string; @@ -57,7 +58,7 @@ class AssistantV2 extends BaseService { * * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD - * format. The current version is `2023-06-15`. + * format. The current version is `2024-08-25`. * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure @@ -109,7 +110,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['providerId', 'specification', '_private']; - const _validParams = ['providerId', 'specification', '_private', 'headers']; + const _validParams = ['providerId', 'specification', '_private', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -138,12 +139,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -173,7 +178,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -200,11 +205,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -228,7 +237,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['providerId', 'specification', '_private']; - const _validParams = ['providerId', 'specification', '_private', 'headers']; + const _validParams = ['providerId', 'specification', '_private', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -261,12 +270,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -295,7 +308,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['language', 'name', 'description', 'headers']; + const _validParams = ['language', 'name', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -324,12 +337,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -359,7 +376,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -386,11 +403,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -404,16 +425,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -422,7 +447,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'headers']; + const _validParams = ['assistantId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -449,11 +474,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -473,16 +502,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {RequestAnalytics} [params.analytics] - An optional object containing analytics data. Currently, this data * is used only for events sent to the Segment extension. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -493,7 +526,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'analytics', 'headers']; + const _validParams = ['assistantId', 'analytics', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -525,12 +558,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -545,16 +582,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.sessionId - Unique identifier of the session. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -564,7 +605,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'sessionId']; - const _validParams = ['assistantId', 'sessionId', 'headers']; + const _validParams = ['assistantId', 'sessionId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -592,11 +633,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -614,16 +659,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. @@ -650,7 +699,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'environmentId', 'sessionId']; - const _validParams = ['assistantId', 'environmentId', 'sessionId', 'input', 'context', 'userId', 'headers']; + const _validParams = ['assistantId', 'environmentId', 'sessionId', 'input', 'context', 'userId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -686,12 +735,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -706,16 +759,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. @@ -741,7 +798,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'environmentId']; - const _validParams = ['assistantId', 'environmentId', 'input', 'context', 'userId', 'headers']; + const _validParams = ['assistantId', 'environmentId', 'input', 'context', 'userId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -776,12 +833,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -799,16 +860,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. @@ -835,7 +900,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'environmentId', 'sessionId']; - const _validParams = ['assistantId', 'environmentId', 'sessionId', 'input', 'context', 'userId', 'headers']; + const _validParams = ['assistantId', 'environmentId', 'sessionId', 'input', 'context', 'userId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -872,12 +937,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'text/event-stream', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -892,16 +961,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. @@ -927,7 +1000,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'environmentId']; - const _validParams = ['assistantId', 'environmentId', 'input', 'context', 'userId', 'headers']; + const _validParams = ['assistantId', 'environmentId', 'input', 'context', 'userId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -963,12 +1036,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'text/event-stream', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -988,8 +1065,10 @@ class AssistantV2 extends BaseService { * This method is available only with Enterprise with Data Isolation plans. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.skillId - Unique identifier of the skill. To find the skill ID in the watsonx Assistant user - * interface, open the skill settings and click **API Details**. + * @param {string} params.skillId - Unique identifier of the skill. To find the action or dialog skill ID in the + * watsonx Assistant user interface, open the skill settings and click **API Details**. To find the search skill ID, + * use the Get environment API to retrieve the skill references for an environment and it will include the search + * skill info, if available. * @param {BulkClassifyUtterance[]} params.input - An array of input utterances to classify. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -999,7 +1078,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['skillId', 'input']; - const _validParams = ['skillId', 'input', 'headers']; + const _validParams = ['skillId', 'input', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1031,12 +1110,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1059,16 +1142,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} [params.sort] - How to sort the returned log events. You can sort by **request_timestamp**. To * reverse the sort order, prefix the parameter value with a minus sign (`-`). * @param {string} [params.filter] - A cacheable parameter that limits the results to those matching the specified @@ -1086,7 +1173,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'sort', 'filter', 'pageLimit', 'cursor', 'headers']; + const _validParams = ['assistantId', 'sort', 'filter', 'pageLimit', 'cursor', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1117,11 +1204,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1156,7 +1247,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['customerId']; - const _validParams = ['customerId', 'headers']; + const _validParams = ['customerId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1179,11 +1270,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1200,16 +1295,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - Whether to include information about the number of records that satisfy * the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response @@ -1227,7 +1326,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1259,11 +1358,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1278,16 +1381,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. @@ -1301,7 +1408,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'environmentId']; - const _validParams = ['assistantId', 'environmentId', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'environmentId', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1330,11 +1437,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1349,16 +1460,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. @@ -1377,7 +1492,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'environmentId']; - const _validParams = ['assistantId', 'environmentId', 'name', 'description', 'orchestration', 'sessionTimeout', 'skillReferences', 'headers']; + const _validParams = ['assistantId', 'environmentId', 'name', 'description', 'orchestration', 'sessionTimeout', 'skillReferences', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1414,12 +1529,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1437,16 +1556,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} [params.description] - The description of the release. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -1456,7 +1579,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'description', 'headers']; + const _validParams = ['assistantId', 'description', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1488,12 +1611,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1508,16 +1635,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - Whether to include information about the number of records that satisfy * the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response @@ -1535,7 +1666,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'pageLimit', 'includeCount', 'sort', 'cursor', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1567,11 +1698,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1589,16 +1724,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.release - Unique identifier of the release. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. @@ -1610,7 +1749,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'release']; - const _validParams = ['assistantId', 'release', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'release', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1639,11 +1778,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1657,16 +1800,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.release - Unique identifier of the release. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -1676,7 +1823,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'release']; - const _validParams = ['assistantId', 'release', 'headers']; + const _validParams = ['assistantId', 'release', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1704,11 +1851,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1723,16 +1874,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.release - Unique identifier of the release. * @param {string} params.environmentId - The environment ID of the environment where the release is to be deployed. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` @@ -1745,7 +1900,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'release', 'environmentId']; - const _validParams = ['assistantId', 'release', 'environmentId', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'release', 'environmentId', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1779,12 +1934,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1803,16 +1962,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.release - Unique identifier of the release. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. @@ -1824,7 +1987,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'release']; - const _validParams = ['assistantId', 'release', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'release', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1853,11 +2016,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1881,16 +2048,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.release - Unique identifier of the release. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. @@ -1902,7 +2073,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'release']; - const _validParams = ['assistantId', 'release', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'release', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1931,11 +2102,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -1959,16 +2134,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {string} params.release - Unique identifier of the release. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. @@ -1980,7 +2159,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'release']; - const _validParams = ['assistantId', 'release', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'release', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2010,11 +2189,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/octet-stream', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2039,16 +2222,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {NodeJS.ReadableStream | Buffer} params.body - Request body is an Octet-stream of the artifact Zip file that * is being imported. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` @@ -2061,7 +2248,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'body']; - const _validParams = ['assistantId', 'body', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'body', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2091,12 +2278,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/octet-stream', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2111,16 +2302,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -2131,7 +2326,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2159,11 +2354,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2180,18 +2379,24 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. - * @param {string} params.skillId - Unique identifier of the skill. To find the skill ID in the watsonx Assistant user - * interface, open the skill settings and click **API Details**. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. + * @param {string} params.skillId - Unique identifier of the skill. To find the action or dialog skill ID in the + * watsonx Assistant user interface, open the skill settings and click **API Details**. To find the search skill ID, + * use the Get environment API to retrieve the skill references for an environment and it will include the search + * skill info, if available. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2200,7 +2405,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'skillId']; - const _validParams = ['assistantId', 'skillId', 'headers']; + const _validParams = ['assistantId', 'skillId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2228,11 +2433,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2249,18 +2458,24 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. - * @param {string} params.skillId - Unique identifier of the skill. To find the skill ID in the watsonx Assistant user - * interface, open the skill settings and click **API Details**. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. + * @param {string} params.skillId - Unique identifier of the skill. To find the action or dialog skill ID in the + * watsonx Assistant user interface, open the skill settings and click **API Details**. To find the search skill ID, + * use the Get environment API to retrieve the skill references for an environment and it will include the search + * skill info, if available. * @param {string} [params.name] - The name of the skill. This string cannot contain carriage return, newline, or tab * characters. * @param {string} [params.description] - The description of the skill. This string cannot contain carriage return, @@ -2280,7 +2495,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'skillId']; - const _validParams = ['assistantId', 'skillId', 'name', 'description', 'workspace', 'dialogSettings', 'searchSettings', 'headers']; + const _validParams = ['assistantId', 'skillId', 'name', 'description', 'workspace', 'dialogSettings', 'searchSettings', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2317,12 +2532,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2333,7 +2552,8 @@ class AssistantV2 extends BaseService { * Export skills. * * Asynchronously export the action skill and dialog skill (if enabled) for the assistant. Use this method to save all - * skill data so that you can import it to a different assistant using the **Import skills** method. + * skill data from the draft environment so that you can import it to a different assistant using the **Import + * skills** method. Use `assistant_id` instead of `environment_id` to call this endpoint. * * A successful call to this method only initiates an asynchronous export. The exported JSON data is not available * until processing completes. @@ -2348,16 +2568,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -2368,7 +2592,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2396,11 +2620,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2410,7 +2638,8 @@ class AssistantV2 extends BaseService { /** * Import skills. * - * Asynchronously import skills into an existing assistant from a previously exported file. + * Asynchronously import skills into an existing assistant from a previously exported file. This method only imports + * assistants into a draft environment. Use `assistant_id` instead of `environment_id` to call this endpoint. * * The request body for this method should contain the response data that was received from a previous call to the * **Export skills** method, without modification. @@ -2421,16 +2650,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {SkillImport[]} params.assistantSkills - An array of objects describing the skills for the assistant. * Included in responses only if **status**=`Available`. * @param {AssistantState} params.assistantState - Status information about the skills for the assistant. Included in @@ -2445,7 +2678,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId', 'assistantSkills', 'assistantState']; - const _validParams = ['assistantId', 'assistantSkills', 'assistantState', 'includeAudit', 'headers']; + const _validParams = ['assistantId', 'assistantSkills', 'assistantState', 'includeAudit', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2479,12 +2712,16 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2498,16 +2735,20 @@ class AssistantV2 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant - * is deployed, depending on the type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + * is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2516,7 +2757,7 @@ class AssistantV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['assistantId']; - const _validParams = ['assistantId', 'headers']; + const _validParams = ['assistantId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -2543,11 +2784,15 @@ class AssistantV2 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -2563,7 +2808,7 @@ namespace AssistantV2 { /** Options for the `AssistantV2` constructor. */ export interface Options extends UserOptions { /** Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is - * `2023-06-15`. + * `2024-08-25`. */ version: string; } @@ -2591,19 +2836,23 @@ namespace AssistantV2 { * request interfaces ************************/ + interface DefaultParams { + headers?: OutgoingHttpHeaders; + signal?: AbortSignal; + } + /** Parameters for the `createProvider` operation. */ - export interface CreateProviderParams { + export interface CreateProviderParams extends DefaultParams { /** The unique identifier of the provider. */ providerId: string; /** The specification of the provider. */ specification: ProviderSpecification; /** Private information of the provider. */ _private: ProviderPrivate; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listProviders` operation. */ - export interface ListProvidersParams { + export interface ListProvidersParams extends DefaultParams { /** The number of records to return in each page of results. */ pageLimit?: number; /** Whether to include information about the number of records that satisfy the request, regardless of the page @@ -2618,7 +2867,6 @@ namespace AssistantV2 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listProviders` operation. */ @@ -2631,29 +2879,27 @@ namespace AssistantV2 { } /** Parameters for the `updateProvider` operation. */ - export interface UpdateProviderParams { + export interface UpdateProviderParams extends DefaultParams { /** Unique identifier of the conversational skill provider. */ providerId: string; /** The specification of the provider. */ specification: ProviderSpecification; /** Private information of the provider. */ _private: ProviderPrivate; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createAssistant` operation. */ - export interface CreateAssistantParams { + export interface CreateAssistantParams extends DefaultParams { /** The language of the assistant. */ language?: string; /** The name of the assistant. This string cannot contain carriage return, newline, or tab characters. */ name?: string; /** The description of the assistant. This string cannot contain carriage return, newline, or tab characters. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listAssistants` operation. */ - export interface ListAssistantsParams { + export interface ListAssistantsParams extends DefaultParams { /** The number of records to return in each page of results. */ pageLimit?: number; /** Whether to include information about the number of records that satisfy the request, regardless of the page @@ -2668,7 +2914,6 @@ namespace AssistantV2 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listAssistants` operation. */ @@ -2681,78 +2926,87 @@ namespace AssistantV2 { } /** Parameters for the `deleteAssistant` operation. */ - export interface DeleteAssistantParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface DeleteAssistantParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createSession` operation. */ - export interface CreateSessionParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface CreateSessionParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** An optional object containing analytics data. Currently, this data is used only for events sent to the * Segment extension. */ analytics?: RequestAnalytics; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteSession` operation. */ - export interface DeleteSessionParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface DeleteSessionParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the session. */ sessionId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `message` operation. */ - export interface MessageParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface MessageParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -2780,22 +3034,24 @@ namespace AssistantV2 { * specified in both locations, the value specified at the root is used. */ userId?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `messageStateless` operation. */ - export interface MessageStatelessParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface MessageStatelessParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -2822,22 +3078,24 @@ namespace AssistantV2 { * specified in both locations in a message request, the value specified at the root is used. */ userId?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `messageStream` operation. */ - export interface MessageStreamParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface MessageStreamParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -2865,22 +3123,24 @@ namespace AssistantV2 { * specified in both locations, the value specified at the root is used. */ userId?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `messageStreamStateless` operation. */ - export interface MessageStreamStatelessParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface MessageStreamStatelessParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -2906,33 +3166,36 @@ namespace AssistantV2 { * specified in both locations, the value specified at the root is used. */ userId?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `bulkClassify` operation. */ - export interface BulkClassifyParams { - /** Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill - * settings and click **API Details**. + export interface BulkClassifyParams extends DefaultParams { + /** Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user + * interface, open the skill settings and click **API Details**. To find the search skill ID, use the Get + * environment API to retrieve the skill references for an environment and it will include the search skill info, + * if available. */ skillId: string; /** An array of input utterances to classify. */ input: BulkClassifyUtterance[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listLogs` operation. */ - export interface ListLogsParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface ListLogsParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** How to sort the returned log events. You can sort by **request_timestamp**. To reverse the sort order, @@ -2950,29 +3213,30 @@ namespace AssistantV2 { pageLimit?: number; /** A token identifying the page of results to retrieve. */ cursor?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteUserData` operation. */ - export interface DeleteUserDataParams { + export interface DeleteUserDataParams extends DefaultParams { /** The customer ID for which all data is to be deleted. */ customerId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listEnvironments` operation. */ - export interface ListEnvironmentsParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface ListEnvironmentsParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** The number of records to return in each page of results. */ @@ -2989,7 +3253,6 @@ namespace AssistantV2 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listEnvironments` operation. */ @@ -3002,18 +3265,21 @@ namespace AssistantV2 { } /** Parameters for the `getEnvironment` operation. */ - export interface GetEnvironmentParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface GetEnvironmentParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3023,22 +3289,24 @@ namespace AssistantV2 { environmentId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateEnvironment` operation. */ - export interface UpdateEnvironmentParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface UpdateEnvironmentParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3056,42 +3324,46 @@ namespace AssistantV2 { sessionTimeout?: number; /** An array of objects identifying the skills (such as action and dialog) that exist in the environment. */ skillReferences?: EnvironmentSkill[]; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createRelease` operation. */ - export interface CreateReleaseParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface CreateReleaseParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** The description of the release. */ description?: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listReleases` operation. */ - export interface ListReleasesParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface ListReleasesParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** The number of records to return in each page of results. */ @@ -3108,7 +3380,6 @@ namespace AssistantV2 { cursor?: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Constants for the `listReleases` operation. */ @@ -3121,60 +3392,67 @@ namespace AssistantV2 { } /** Parameters for the `getRelease` operation. */ - export interface GetReleaseParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface GetReleaseParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the release. */ release: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteRelease` operation. */ - export interface DeleteReleaseParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface DeleteReleaseParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the release. */ release: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `deployRelease` operation. */ - export interface DeployReleaseParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface DeployReleaseParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3183,156 +3461,174 @@ namespace AssistantV2 { environmentId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createReleaseExport` operation. */ - export interface CreateReleaseExportParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface CreateReleaseExportParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the release. */ release: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `downloadReleaseExport` operation. */ - export interface DownloadReleaseExportParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface DownloadReleaseExportParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the release. */ release: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `downloadReleaseExportAsStream` operation. */ - export interface DownloadReleaseExportAsStreamParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface DownloadReleaseExportAsStreamParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Unique identifier of the release. */ release: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createReleaseImport` operation. */ - export interface CreateReleaseImportParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface CreateReleaseImportParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Request body is an Octet-stream of the artifact Zip file that is being imported. */ body: NodeJS.ReadableStream | Buffer; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getReleaseImportStatus` operation. */ - export interface GetReleaseImportStatusParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface GetReleaseImportStatusParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `getSkill` operation. */ - export interface GetSkillParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface GetSkillParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; - /** Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill - * settings and click **API Details**. + /** Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user + * interface, open the skill settings and click **API Details**. To find the search skill ID, use the Get + * environment API to retrieve the skill references for an environment and it will include the search skill info, + * if available. */ skillId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateSkill` operation. */ - export interface UpdateSkillParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface UpdateSkillParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; - /** Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill - * settings and click **API Details**. + /** Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user + * interface, open the skill settings and click **API Details**. To find the search skill ID, use the Get + * environment API to retrieve the skill references for an environment and it will include the search skill info, + * if available. */ skillId: string; /** The name of the skill. This string cannot contain carriage return, newline, or tab characters. */ @@ -3349,42 +3645,46 @@ namespace AssistantV2 { * skills** responses. */ searchSettings?: SearchSettings; - headers?: OutgoingHttpHeaders; } /** Parameters for the `exportSkills` operation. */ - export interface ExportSkillsParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface ExportSkillsParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `importSkills` operation. */ - export interface ImportSkillsParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface ImportSkillsParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. + * + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; /** An array of objects describing the skills for the assistant. Included in responses only if @@ -3395,25 +3695,26 @@ namespace AssistantV2 { assistantState: AssistantState; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ includeAudit?: boolean; - headers?: OutgoingHttpHeaders; } /** Parameters for the `importSkillsStatus` operation. */ - export interface ImportSkillsStatusParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the - * type of request: - * - For message, session, and log requests, specify the environment ID of the environment where the assistant is + export interface ImportSkillsStatusParams extends DefaultParams { + /** The assistant ID or the environment ID of the environment where the assistant is deployed. + * Set the value for this ID depending on the type of request: + * + * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. - * - For all other requests, specify the assistant ID of the assistant. * - * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings - * and scroll to the **Environments** section. + * - For all other requests, specify the assistant ID of the assistant. + * + * To get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant + * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. * - * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the - * assistant ID in the user interface, open the assistant settings and click API Details. + * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. + * + * To find the **assistant ID** in the user interface, open the **Assistant settings** and click **API Details**. */ assistantId: string; - headers?: OutgoingHttpHeaders; } /************************* @@ -3574,6 +3875,31 @@ namespace AssistantV2 { url?: string; } + /** + * ClientAction. + */ + export interface ClientAction { + /** The name of the client action. */ + name?: string; + /** The name of the variable that the results are stored in. */ + result_variable?: string; + /** The type of turn event. */ + type?: string; + /** The skill that is requesting the action. Included only if **type**=`client`. */ + skill?: ClientAction.Constants.Skill | string; + /** An object containing arbitrary variables that are included in the turn event. */ + parameters?: JsonObject; + } + export namespace ClientAction { + export namespace Constants { + /** The skill that is requesting the action. Included only if **type**=`client`. */ + export enum Skill { + MAIN_SKILL = 'main skill', + ACTIONS_SKILL = 'actions skill', + } + } + } + /** * CreateAssistantReleaseImportResponse. */ @@ -3872,6 +4198,90 @@ namespace AssistantV2 { } } + /** + * Message final response content. + */ + export interface FinalResponse { + /** Assistant output to be rendered or processed by the client. */ + output?: FinalResponseOutput; + /** Context data for the conversation. You can use this property to access context variables. The context is + * stored by the assistant on a per-session basis. + * + * **Note:** The context is included in message responses only if **return_context**=`true` in the message request. + * Full context is always included in logs. + */ + context?: MessageContext; + /** A string value that identifies the user who is interacting with the assistant. The client must provide a + * unique identifier for each individual end user who accesses the application. For user-based plans, this user ID + * is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or + * tab characters. If no value is specified in the input, **user_id** is automatically set to the value of + * **context.global.session_id**. + * + * **Note:** This property is the same as the **user_id** property in the global system context. + */ + user_id?: string; + /** Assistant output to be rendered or processed by the client. All private data is masked or removed. */ + masked_output?: MessageOutput; + /** An input object that includes the input text. All private data is masked or removed. */ + masked_input?: MessageInput; + } + + /** + * Assistant output to be rendered or processed by the client. + */ + export interface FinalResponseOutput { + /** Output intended for any channel. It is the responsibility of the client application to implement the + * supported response types. + */ + generic?: RuntimeResponseGeneric[]; + /** An array of intents recognized in the user input, sorted in descending order of confidence. */ + intents?: RuntimeIntent[]; + /** An array of entities identified in the user input. */ + entities?: RuntimeEntity[]; + /** An array of objects describing any actions requested by the dialog node. */ + actions?: DialogNodeAction[]; + /** Additional detailed information about a message response and how it was generated. */ + debug?: MessageOutputDebug; + /** An object containing any custom properties included in the response. This object includes any arbitrary + * properties defined in the dialog JSON editor as part of the dialog node output. + */ + user_defined?: JsonObject; + /** Properties describing any spelling corrections in the user input that was received. */ + spelling?: MessageOutputSpelling; + /** An array of objects that provide information about calls to large language models that occured as part of + * handling this message. + */ + llm_metadata?: MessageOutputLLMMetadata[]; + /** Contains meta-information about the item(s) being streamed. */ + streaming_metadata: MessageStreamMetadata; + } + + /** + * GenerativeAITask. + */ + export interface GenerativeAITask { + } + + /** + * The confidence scores for determining whether to show the generated response or an “I don't know” response. + */ + export interface GenerativeAITaskConfidenceScores { + /** The confidence score based on user query and search results. */ + pre_gen?: number; + /** The pre_gen confidence score threshold. If the pre_gen score is below this threshold, it shows an “I don't + * know” response instead of the generated response. Shown in the conversational search skill UI as the “Retrieval + * Confidence threshold”. + */ + pre_gen_threshold?: number; + /** The confidence score based on user query, search results, and the generated response. */ + post_gen?: number; + /** The post_gen confidence score threshold. If the post_gen score is below this threshold, it shows an “I don't + * know” response instead of the generated response. Shown in the conversational search skill UI as the “Response + * Confidence threshold”. + */ + post_gen_threshold?: number; + } + /** * IntegrationReference. */ @@ -4058,6 +4468,10 @@ namespace AssistantV2 { user_defined?: JsonObject; /** Properties describing any spelling corrections in the user input that was received. */ spelling?: MessageOutputSpelling; + /** An array of objects that provide information about calls to large language models that occured as part of + * handling this message. + */ + llm_metadata?: MessageOutputLLMMetadata[]; } /** @@ -4360,6 +4774,10 @@ namespace AssistantV2 { user_defined?: JsonObject; /** Properties describing any spelling corrections in the user input that was received. */ spelling?: MessageOutputSpelling; + /** An array of objects that provide information about calls to large language models that occured as part of + * handling this message. + */ + llm_metadata?: MessageOutputLLMMetadata[]; } /** @@ -4401,6 +4819,16 @@ namespace AssistantV2 { export interface MessageOutputDebugTurnEvent { } + /** + * MessageOutputLLMMetadata. + */ + export interface MessageOutputLLMMetadata { + /** The task that used a large language model. */ + task?: string; + /** The id for the large language model used for the task. */ + model_id?: string; + } + /** * Properties describing any spelling corrections in the user input that was received. */ @@ -4419,6 +4847,20 @@ namespace AssistantV2 { suggested_text?: string; } + /** + * Contains meta-information about the item(s) being streamed. + */ + export interface MessageStreamMetadata { + /** Contains meta-information about the item(s) being streamed. */ + streaming_metadata: Metadata; + } + + /** + * A streamed response from the watsonx Assistant service. + */ + export interface MessageStreamResponse { + } + /** * Contains meta-information about the item(s) being streamed. */ @@ -4493,6 +4935,20 @@ namespace AssistantV2 { next_cursor?: string; } + /** + * Message response partial item content. + */ + export interface PartialItem { + /** The type of response returned by the dialog node. The specified response type must be supported by the + * client application or channel. + */ + response_type?: string; + /** The text within the partial chunk of the message stream response. */ + text: string; + /** Contains meta-information about the item(s) being streamed. */ + streaming_metadata: Metadata; + } + /** * Non-private settings for oauth2 authentication. */ @@ -4844,9 +5300,55 @@ namespace AssistantV2 { } /** - * The entity value that was recognized in the user input. + * ResponseGenericCitation. */ - export interface RuntimeEntity { + export interface ResponseGenericCitation { + /** The title of the citation text. */ + title: string; + /** The text of the citation. */ + text: string; + /** The body content of the citation. */ + body: string; + /** The index of the search_result where the citation is generated. */ + search_result_index?: number; + /** The offsets of the start and end of the citation in the generated response. For example, `ranges:[ { + * start:0, end:5 }, ...]`. + */ + ranges: ResponseGenericCitationRangesItem[]; + } + + /** + * ResponseGenericCitationRangesItem. + */ + export interface ResponseGenericCitationRangesItem { + /** The offset of the start of the citation in the generated response. */ + start?: number; + /** The offset of the end of the citation in the generated response. */ + end?: number; + } + + /** + * The confidence scores for determining whether to show the generated response or an “I don't know” response. + */ + export interface ResponseGenericConfidenceScores { + /** The confidence score threshold. If either the pre_gen or post_gen score is below this threshold, it shows an + * “I don't know” response to replace the generated text. You can configure the threshold in either the user + * interface or through the Update skill API. For more information, see the [watsonx Assistant documentation]( + * https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-conversational-search#behavioral-tuning-conversational-search). + */ + threshold?: number; + /** The confidence score based on user query and search results. */ + pre_gen?: number; + /** The confidence score based on user query, search results, and the generated response. */ + post_gen?: number; + /** It indicates how extractive the generated response is from the search results. */ + extractiveness?: number; + } + + /** + * The entity value that was recognized in the user input. + */ + export interface RuntimeEntity { /** An entity detected in the input. */ entity: string; /** An array of zero-based character offsets that indicate where the detected entity values begin and end in the @@ -5138,6 +5640,30 @@ namespace AssistantV2 { score?: number; } + /** + * SearchResults. + */ + export interface SearchResults { + /** The metadata of the search result. */ + result_metadata: SearchResultsResultMetadata; + /** The ID of the search result. It may not be unique. */ + id: string; + /** The title of the search result. */ + title: string; + /** The body content of the search result. */ + body: string; + } + + /** + * The metadata of the search result. + */ + export interface SearchResultsResultMetadata { + /** The source of the search result. */ + document_retrieval_source?: string; + /** The relevance score of the search result to the user query. */ + score?: number; + } + /** * An object describing the search skill configuration. * @@ -5146,7 +5672,7 @@ namespace AssistantV2 { */ export interface SearchSettings { /** Configuration settings for the Watson Discovery service instance used by the search integration. */ - discovery: SearchSettingsDiscovery; + discovery?: SearchSettingsDiscovery; /** The messages included with responses from the search integration. */ messages: SearchSettingsMessages; /** The mapping between fields in the Watson Discovery collection and properties in the search response. */ @@ -5156,7 +5682,7 @@ namespace AssistantV2 { */ elastic_search?: SearchSettingsElasticSearch; /** Configuration settings for conversational search. */ - conversational_search?: SearchSettingsConversationalSearch; + conversational_search: SearchSettingsConversationalSearch; /** Configuration settings for the server-side search service used by the search integration. You can provide * either basic auth, apiKey auth or none. */ @@ -5622,6 +6148,59 @@ namespace AssistantV2 { masked_input?: MessageInput; } + /** + * Message final response content. + */ + export interface StatelessFinalResponse { + /** Assistant output to be rendered or processed by the client. */ + output?: StatelessFinalResponseOutput; + /** Context data for the conversation. You can use this property to access context variables. The context is + * stored by the assistant on a per-session basis. + * + * **Note:** The context is included in message responses only if **return_context**=`true` in the message request. + * Full context is always included in logs. + */ + context?: StatelessMessageContext; + /** A string value that identifies the user who is interacting with the assistant. The client must provide a + * unique identifier for each individual end user who accesses the application. For user-based plans, this user ID + * is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or + * tab characters. If no value is specified in the input, **user_id** is automatically set to the value of + * **context.global.session_id**. + * + * **Note:** This property is the same as the **user_id** property in the global system context. + */ + user_id?: string; + } + + /** + * Assistant output to be rendered or processed by the client. + */ + export interface StatelessFinalResponseOutput { + /** Output intended for any channel. It is the responsibility of the client application to implement the + * supported response types. + */ + generic?: RuntimeResponseGeneric[]; + /** An array of intents recognized in the user input, sorted in descending order of confidence. */ + intents?: RuntimeIntent[]; + /** An array of entities identified in the user input. */ + entities?: RuntimeEntity[]; + /** An array of objects describing any actions requested by the dialog node. */ + actions?: DialogNodeAction[]; + /** Additional detailed information about a message response and how it was generated. */ + debug?: MessageOutputDebug; + /** An object containing any custom properties included in the response. This object includes any arbitrary + * properties defined in the dialog JSON editor as part of the dialog node output. + */ + user_defined?: JsonObject; + /** Properties describing any spelling corrections in the user input that was received. */ + spelling?: MessageOutputSpelling; + /** An array of objects that provide information about calls to large language models that occured as part of + * handling this message. + */ + llm_metadata?: MessageOutputLLMMetadata[]; + streaming_metadata: StatelessMessageContext; + } + /** * StatelessMessageContext. */ @@ -5782,6 +6361,12 @@ namespace AssistantV2 { user_id?: string; } + /** + * A stateless streamed response form the watsonx Assistant service. + */ + export interface StatelessMessageStreamResponse { + } + /** * An object describing an error that occurred during processing of an asynchronous operation. */ @@ -5890,6 +6475,137 @@ namespace AssistantV2 { message?: string; } + /** + * TurnEventGenerativeAICalledCallout. + */ + export interface TurnEventGenerativeAICalledCallout { + /** Whether the document search engine was called. */ + search_called?: boolean; + /** Whether watsonx.ai was called during answer generation. */ + llm_called?: boolean; + search?: TurnEventGenerativeAICalledCalloutSearch; + llm?: TurnEventGenerativeAICalledCalloutLlm; + /** Indicates why a conversational search response resolved to an idk response. This field will only be + * available when the conversational search response is an idk response. + */ + idk_reason_code?: string; + } + + /** + * TurnEventGenerativeAICalledCalloutLlm. + */ + export interface TurnEventGenerativeAICalledCalloutLlm { + /** The name of the LLM engine called by the system. */ + type?: string; + /** The LLM model used to generate the response. */ + model_id?: string; + /** The watsonx.ai class ID that was used during the answer generation request to the LLM. This is only included + * when a request to the LLM has been made by the system. + */ + model_class_id?: string; + /** The number of tokens that were generated in the response by the LLM. This is only included when a request to + * the LLM was successful and a response was generated. + */ + generated_token_count?: number; + /** The number of tokens that were sent to the LLM during answer generation. This is only included when a + * request to the LLM has been made by the system. + */ + input_token_count?: number; + /** Whether the answer generation request to the LLM was successful. */ + success?: boolean; + response?: TurnEventGenerativeAICalledCalloutLlmResponse; + /** n array of objects containing the search results. */ + request?: SearchResults[]; + } + + /** + * + */ + export interface TurnEventGenerativeAICalledCalloutLlmResponse { + /** The LLM response that is returned. */ + text?: string; + /** The type of response that is returned. */ + response_type?: string; + /** Whether the response is an idk response. */ + is_idk_response?: boolean; + } + + /** + * TurnEventGenerativeAICalledCalloutRequest. + */ + export interface TurnEventGenerativeAICalledCalloutRequest { + /** The REST method of the request. */ + method?: TurnEventGenerativeAICalledCalloutRequest.Constants.Method | string; + /** The host URL of the request call. */ + url?: string; + /** The host port of the request call. */ + port?: string; + /** The URL path of the request call. */ + path?: string; + /** Any query parameters appended to the URL of the request call. */ + query_parameters?: string; + /** Any headers included in the request call. */ + headers?: JsonObject; + /** Contains the response of the external server or an object. In cases like timeouts or connections errors, it + * will contain details of why the callout to the external server failed. + */ + body?: JsonObject; + } + export namespace TurnEventGenerativeAICalledCalloutRequest { + export namespace Constants { + /** The REST method of the request. */ + export enum Method { + GET = 'GET', + POST = 'POST', + PUT = 'PUT', + DELETE = 'DELETE', + PATCH = 'PATCH', + } + } + } + + /** + * TurnEventGenerativeAICalledCalloutResponse. + */ + export interface TurnEventGenerativeAICalledCalloutResponse { + /** The final response string. This response is a composition of every partial chunk received from the stream. */ + body?: string; + /** The final status code of the response. */ + status_code?: number; + } + + /** + * TurnEventGenerativeAICalledCalloutSearch. + */ + export interface TurnEventGenerativeAICalledCalloutSearch { + /** The search engine that was used to scan the documents. */ + engine?: string; + /** The name of the Elasticsearch index being used. This field is only available if the engine being used is + * Elasticsearch. + */ + index?: string; + /** The query that will be used by the system to initiate search on the document search engine. */ + query?: string; + request?: TurnEventGenerativeAICalledCalloutRequest; + response?: TurnEventGenerativeAICalledCalloutResponse; + } + + /** + * TurnEventGenerativeAICalledMetrics. + */ + export interface TurnEventGenerativeAICalledMetrics { + /** The amount of time (in milliseconds) it took for the system to complete the search using the document search + * engine. + */ + search_time_ms?: number; + /** The amount of time (in milliseconds) it took for the system to complete answer generation process by + * reaching out to watsonx.ai. + */ + answer_generation_time_ms?: number; + /** The amount of time (in milliseconds) it took for the system to fully process the conversational search. */ + total_time_ms?: number; + } + /** * TurnEventNodeSource. */ @@ -5920,6 +6636,32 @@ namespace AssistantV2 { message?: string; } + /** + * TurnEventStepSource. + */ + export interface TurnEventStepSource { + /** The type of turn event. */ + type?: TurnEventStepSource.Constants.Type | string; + /** An action that was visited during processing of the message. */ + action?: string; + /** The title of the action. */ + action_title?: string; + /** A step that was visited during processing of the message. */ + step?: string; + /** Whether the action that the turn event was generated from is an AI-guided action. */ + is_ai_guided?: boolean; + /** Whether the action that the turn event was generated from is a skill-guided action. */ + is_skill_based?: boolean; + } + export namespace TurnEventStepSource { + export namespace Constants { + /** The type of turn event. */ + export enum Type { + STEP = 'step', + } + } + } + /** * The search skill orchestration settings for the environment. */ @@ -5946,6 +6688,38 @@ namespace AssistantV2 { streaming_metadata: Metadata; } + /** + * GenerativeAITaskContentGroundedAnswering. + */ + export interface GenerativeAITaskContentGroundedAnswering extends GenerativeAITask { + /** The type of generative ai task. */ + task?: string; + /** Whether response was an idk response. */ + is_idk_response?: boolean; + /** Whether response was a hap response. */ + is_hap_detected?: boolean; + /** The confidence scores for determining whether to show the generated response or an “I don't know” response. */ + confidence_scores?: GenerativeAITaskConfidenceScores; + /** The original response returned by the generative ai. */ + original_response?: string; + /** Generated from the input text after auto-correction. If this field is not present, the input text was used + * as the query to the generative ai. + */ + inferred_query?: string; + } + + /** + * GenerativeAITaskGeneralPurposeAnswering. + */ + export interface GenerativeAITaskGeneralPurposeAnswering extends GenerativeAITask { + /** The type of generative ai task. */ + task?: string; + /** Whether response was an idk response. */ + is_idk_response?: boolean; + /** Whether response was a hap response. */ + is_hap_detected?: boolean; + } + /** * An object that identifies the dialog element that generated the error message. */ @@ -6028,6 +6802,33 @@ namespace AssistantV2 { } } + /** + * MessageOutputDebugTurnEventTurnEventActionRoutingDenied. + */ + export interface MessageOutputDebugTurnEventTurnEventActionRoutingDenied extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + source?: TurnEventActionSource; + /** The type of condition (if any) that is defined for the action. */ + condition_type?: MessageOutputDebugTurnEventTurnEventActionRoutingDenied.Constants.ConditionType | string; + /** The reason the action was visited. */ + reason?: MessageOutputDebugTurnEventTurnEventActionRoutingDenied.Constants.Reason | string; + } + export namespace MessageOutputDebugTurnEventTurnEventActionRoutingDenied { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + /** The reason the action was visited. */ + export enum Reason { + ACTION_CONDITIONS_FAILED = 'action_conditions_failed', + } + } + } + /** * MessageOutputDebugTurnEventTurnEventActionVisited. */ @@ -6080,6 +6881,53 @@ namespace AssistantV2 { error?: TurnEventCalloutError; } + /** + * MessageOutputDebugTurnEventTurnEventClientActions. + */ + export interface MessageOutputDebugTurnEventTurnEventClientActions extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + source?: TurnEventStepSource; + /** An array of client actions. */ + client_actions?: ClientAction[]; + } + + /** + * MessageOutputDebugTurnEventTurnEventConversationalSearchEnd. + */ + export interface MessageOutputDebugTurnEventTurnEventConversationalSearchEnd extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + source?: TurnEventActionSource; + /** The type of condition (if any) that is defined for the action. */ + condition_type?: MessageOutputDebugTurnEventTurnEventConversationalSearchEnd.Constants.ConditionType | string; + } + export namespace MessageOutputDebugTurnEventTurnEventConversationalSearchEnd { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + } + } + + /** + * MessageOutputDebugTurnEventTurnEventGenerativeAICalled. + */ + export interface MessageOutputDebugTurnEventTurnEventGenerativeAICalled extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + /** For internal use only. */ + source?: JsonObject; + /** The time when generative ai started processing the message. */ + generative_ai_start_time?: string; + generative_ai?: GenerativeAITask; + callout?: TurnEventGenerativeAICalledCallout; + metrics?: TurnEventGenerativeAICalledMetrics; + } + /** * MessageOutputDebugTurnEventTurnEventHandlerVisited. */ @@ -6091,6 +6939,31 @@ namespace AssistantV2 { action_start_time?: string; } + /** + * MessageOutputDebugTurnEventTurnEventManualRoute. + */ + export interface MessageOutputDebugTurnEventTurnEventManualRoute extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + source?: TurnEventStepSource; + /** The type of condition (if any) that is defined for the action. */ + condition_type?: MessageOutputDebugTurnEventTurnEventManualRoute.Constants.ConditionType | string; + /** The time when the action started processing the message. */ + action_start_time?: string; + /** The name of the route. */ + route_name?: string; + } + export namespace MessageOutputDebugTurnEventTurnEventManualRoute { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + } + } + /** * MessageOutputDebugTurnEventTurnEventNodeVisited. */ @@ -6177,6 +7050,67 @@ namespace AssistantV2 { } } + /** + * MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied. + */ + export interface MessageOutputDebugTurnEventTurnEventSuggestionIntentsDenied extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + /** An array of denied intents. */ + intents_denied?: RuntimeIntent[]; + } + + /** + * MessageOutputDebugTurnEventTurnEventTopicSwitchDenied. + */ + export interface MessageOutputDebugTurnEventTurnEventTopicSwitchDenied extends MessageOutputDebugTurnEvent { + /** The type of turn event. */ + event?: string; + source?: TurnEventActionSource; + /** The type of condition (if any) that is defined for the action. */ + condition_type?: MessageOutputDebugTurnEventTurnEventTopicSwitchDenied.Constants.ConditionType | string; + /** The reason the action was visited. */ + reason?: MessageOutputDebugTurnEventTurnEventTopicSwitchDenied.Constants.Reason | string; + } + export namespace MessageOutputDebugTurnEventTurnEventTopicSwitchDenied { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + /** The reason the action was visited. */ + export enum Reason { + ACTION_CONDITIONS_FAILED = 'action_conditions_failed', + } + } + } + + /** + * A completed response item. A complete item is a composition of every streamed partial item with the same + * streaming_metadata.id, and each complete item contains its own unique streaming_metadata.id. + */ + export interface MessageStreamResponseMessageStreamCompleteItem extends MessageStreamResponse { + complete_item?: CompleteItem; + } + + /** + * A chunk of the streamed message response. + */ + export interface MessageStreamResponseMessageStreamPartialItem extends MessageStreamResponse { + /** Message response partial item content. */ + partial_item?: PartialItem; + } + + /** + * The final and stateful message response. + */ + export interface MessageStreamResponseStatefulMessageStreamFinalResponse extends MessageStreamResponse { + /** Message final response content. */ + final_response?: FinalResponse; + } + /** * Non-private authentication settings for authorization-code flow. */ @@ -6404,6 +7338,36 @@ namespace AssistantV2 { channels?: ResponseGenericChannel[]; } + /** + * RuntimeResponseGenericRuntimeResponseTypeConversationalSearch. + */ + export interface RuntimeResponseGenericRuntimeResponseTypeConversationalSearch extends RuntimeResponseGeneric { + /** The type of response returned by the dialog node. The specified response type must be supported by the + * client application or channel. + */ + response_type: string; + /** The text of the conversational search response. */ + text: string; + /** The title of the citations. The default is “How do we know?”. It can be updated in the conversational search + * user interface. + */ + citations_title: string; + /** The citations for the generated response. */ + citations: ResponseGenericCitation[]; + /** The confidence scores for determining whether to show the generated response or an “I don't know” response. */ + confidence_scores: ResponseGenericConfidenceScores; + /** The response length option. It is used to control the length of the generated response. It is configured + * either in the user interface or through the Update skill API. For more information, see [watsonx Assistant + * documentation]( + * https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-conversational-search#tuning-the-generated-response-length-in-conversational-search). + */ + response_length_option: string; + /** An array of objects containing the search results. */ + search_results: SearchResults[]; + /** A disclaimer for the conversational search response. */ + disclaimer: string; + } + /** * RuntimeResponseGenericRuntimeResponseTypeDate. */ @@ -6602,6 +7566,30 @@ namespace AssistantV2 { /** Descriptive text that can be used for screen readers or other situations where the video cannot be seen. */ alt_text?: string; } + + /** + * A completed response item. A complete item is a composition of every streamed partial item with the same + * streaming_metadata.id, and each complete item contains its own unique streaming_metadata.id. + */ + export interface StatelessMessageStreamResponseMessageStreamCompleteItem extends StatelessMessageStreamResponse { + complete_item?: CompleteItem; + } + + /** + * A chunk of the streamed message response. + */ + export interface StatelessMessageStreamResponseMessageStreamPartialItem extends StatelessMessageStreamResponse { + /** Message response partial item content. */ + partial_item?: PartialItem; + } + + /** + * The final and stateless message response. + */ + export interface StatelessMessageStreamResponseStatelessMessageStreamFinalResponse extends StatelessMessageStreamResponse { + /** Message final response content. */ + final_response?: StatelessFinalResponse; + } } export = AssistantV2; From 16a1a47777bbd9b0eb3e82ccd4d5a5068077306d Mon Sep 17 00:00:00 2001 From: Nataliia Kirinovych Date: Mon, 16 Jun 2025 11:12:04 +0100 Subject: [PATCH 5/7] feat(nlu): add signal to axios options --- natural-language-understanding/v1.ts | 135 ++++++++++++++++++--------- 1 file changed, 90 insertions(+), 45 deletions(-) diff --git a/natural-language-understanding/v1.ts b/natural-language-understanding/v1.ts index 6d7155180c..c91f3f1e94 100644 --- a/natural-language-understanding/v1.ts +++ b/natural-language-understanding/v1.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2017, 2024. + * (C) Copyright IBM Corp. 2017, 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ import * as extend from 'extend'; import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { + AbortSignal, Authenticator, BaseService, UserOptions, @@ -142,7 +143,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['features']; - const _validParams = ['features', 'text', 'html', 'url', 'clean', 'xpath', 'fallbackToRaw', 'returnAnalyzedText', 'language', 'limitTextCharacters', 'headers']; + const _validParams = ['features', 'text', 'html', 'url', 'clean', 'xpath', 'fallbackToRaw', 'returnAnalyzedText', 'language', 'limitTextCharacters', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -178,12 +179,16 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -209,7 +214,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -231,11 +236,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -257,7 +266,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId']; - const _validParams = ['modelId', 'headers']; + const _validParams = ['modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -284,11 +293,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -325,7 +338,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['language', 'trainingData']; - const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'headers']; + const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -356,18 +369,22 @@ class NaturalLanguageUnderstandingV1 extends BaseService { url: '/v1/models/categories', method: 'POST', qs: query, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -388,7 +405,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -410,11 +427,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -436,7 +457,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId']; - const _validParams = ['modelId', 'headers']; + const _validParams = ['modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -463,11 +484,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -502,7 +527,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId', 'language', 'trainingData']; - const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'headers']; + const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -538,18 +563,22 @@ class NaturalLanguageUnderstandingV1 extends BaseService { method: 'PUT', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -572,7 +601,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId']; - const _validParams = ['modelId', 'headers']; + const _validParams = ['modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -599,11 +628,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -642,7 +675,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['language', 'trainingData']; - const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'headers']; + const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -674,18 +707,22 @@ class NaturalLanguageUnderstandingV1 extends BaseService { url: '/v1/models/classifications', method: 'POST', qs: query, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -706,7 +743,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = []; - const _validParams = ['headers']; + const _validParams = ['signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -728,11 +765,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -754,7 +795,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId']; - const _validParams = ['modelId', 'headers']; + const _validParams = ['modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -781,11 +822,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -822,7 +867,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId', 'language', 'trainingData']; - const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'headers']; + const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -859,18 +904,22 @@ class NaturalLanguageUnderstandingV1 extends BaseService { method: 'PUT', qs: query, path, - formData + formData, }, defaultOptions: extend(true, {}, this.baseOptions, { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', 'Content-Type': 'multipart/form-data', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -893,7 +942,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId']; - const _validParams = ['modelId', 'headers']; + const _validParams = ['modelId', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -920,11 +969,15 @@ class NaturalLanguageUnderstandingV1 extends BaseService { headers: extend( true, sdkHeaders, + this.baseOptions.headers, { 'Accept': 'application/json', }, _params.headers ), + axiosOptions: { + signal: _params.signal, + }, }), }; @@ -968,8 +1021,13 @@ namespace NaturalLanguageUnderstandingV1 { * request interfaces ************************/ + interface DefaultParams { + headers?: OutgoingHttpHeaders; + signal?: AbortSignal; + } + /** Parameters for the `analyze` operation. */ - export interface AnalyzeParams { + export interface AnalyzeParams extends DefaultParams { /** Specific features to analyze the document for. */ features: Features; /** The plain text to analyze. One of the `text`, `html`, or `url` parameters is required. */ @@ -1000,23 +1058,20 @@ namespace NaturalLanguageUnderstandingV1 { language?: string; /** Sets the maximum number of characters that are processed by the service. */ limitTextCharacters?: number; - headers?: OutgoingHttpHeaders; } /** Parameters for the `listModels` operation. */ - export interface ListModelsParams { - headers?: OutgoingHttpHeaders; + export interface ListModelsParams extends DefaultParams { } /** Parameters for the `deleteModel` operation. */ - export interface DeleteModelParams { + export interface DeleteModelParams extends DefaultParams { /** Model ID of the model to delete. */ modelId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createCategoriesModel` operation. */ - export interface CreateCategoriesModelParams { + export interface CreateCategoriesModelParams extends DefaultParams { /** The 2-letter language code of this model. */ language: string; /** Training data in JSON format. For more information, see [Categories training data @@ -1037,7 +1092,6 @@ namespace NaturalLanguageUnderstandingV1 { workspaceId?: string; /** The description of the version. */ versionDescription?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `createCategoriesModel` operation. */ @@ -1050,19 +1104,17 @@ namespace NaturalLanguageUnderstandingV1 { } /** Parameters for the `listCategoriesModels` operation. */ - export interface ListCategoriesModelsParams { - headers?: OutgoingHttpHeaders; + export interface ListCategoriesModelsParams extends DefaultParams { } /** Parameters for the `getCategoriesModel` operation. */ - export interface GetCategoriesModelParams { + export interface GetCategoriesModelParams extends DefaultParams { /** ID of the model. */ modelId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateCategoriesModel` operation. */ - export interface UpdateCategoriesModelParams { + export interface UpdateCategoriesModelParams extends DefaultParams { /** ID of the model. */ modelId: string; /** The 2-letter language code of this model. */ @@ -1085,7 +1137,6 @@ namespace NaturalLanguageUnderstandingV1 { workspaceId?: string; /** The description of the version. */ versionDescription?: string; - headers?: OutgoingHttpHeaders; } /** Constants for the `updateCategoriesModel` operation. */ @@ -1098,14 +1149,13 @@ namespace NaturalLanguageUnderstandingV1 { } /** Parameters for the `deleteCategoriesModel` operation. */ - export interface DeleteCategoriesModelParams { + export interface DeleteCategoriesModelParams extends DefaultParams { /** ID of the model. */ modelId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `createClassificationsModel` operation. */ - export interface CreateClassificationsModelParams { + export interface CreateClassificationsModelParams extends DefaultParams { /** The 2-letter language code of this model. */ language: string; /** Training data in JSON format. For more information, see [Classifications training data @@ -1128,7 +1178,6 @@ namespace NaturalLanguageUnderstandingV1 { versionDescription?: string; /** Optional classifications training parameters along with model train requests. */ trainingParameters?: ClassificationsTrainingParameters; - headers?: OutgoingHttpHeaders; } /** Constants for the `createClassificationsModel` operation. */ @@ -1141,19 +1190,17 @@ namespace NaturalLanguageUnderstandingV1 { } /** Parameters for the `listClassificationsModels` operation. */ - export interface ListClassificationsModelsParams { - headers?: OutgoingHttpHeaders; + export interface ListClassificationsModelsParams extends DefaultParams { } /** Parameters for the `getClassificationsModel` operation. */ - export interface GetClassificationsModelParams { + export interface GetClassificationsModelParams extends DefaultParams { /** ID of the model. */ modelId: string; - headers?: OutgoingHttpHeaders; } /** Parameters for the `updateClassificationsModel` operation. */ - export interface UpdateClassificationsModelParams { + export interface UpdateClassificationsModelParams extends DefaultParams { /** ID of the model. */ modelId: string; /** The 2-letter language code of this model. */ @@ -1178,7 +1225,6 @@ namespace NaturalLanguageUnderstandingV1 { versionDescription?: string; /** Optional classifications training parameters along with model train requests. */ trainingParameters?: ClassificationsTrainingParameters; - headers?: OutgoingHttpHeaders; } /** Constants for the `updateClassificationsModel` operation. */ @@ -1191,10 +1237,9 @@ namespace NaturalLanguageUnderstandingV1 { } /** Parameters for the `deleteClassificationsModel` operation. */ - export interface DeleteClassificationsModelParams { + export interface DeleteClassificationsModelParams extends DefaultParams { /** ID of the model. */ modelId: string; - headers?: OutgoingHttpHeaders; } /************************* From ef816c46e5872c3fcc060ddb4119625ca90c7c6a Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Mon, 16 Jun 2025 11:28:34 -0500 Subject: [PATCH 6/7] chore: readd correct interface types --- speech-to-text/v1-generated.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech-to-text/v1-generated.ts b/speech-to-text/v1-generated.ts index 4a869f8379..b0f214362a 100644 --- a/speech-to-text/v1-generated.ts +++ b/speech-to-text/v1-generated.ts @@ -6826,13 +6826,13 @@ namespace SpeechToTextV1 { * elements: the word followed by its start and end time in seconds, for example: * `[["hello",0.0,1.2],["world",1.2,2.5]]`. Timestamps are returned only for the best alternative. */ - timestamps?: string[]; + timestamps?: [string, number, number][]; /** A confidence score for each word of the transcript as a list of lists. Each inner list consists of two * elements: the word and its confidence score in the range of 0.0 to 1.0, for example: * `[["hello",0.95],["world",0.86]]`. Confidence scores are returned only for the best alternative and only with * results marked as final. */ - word_confidence?: string[]; + word_confidence?: [string, number][]; } /** From 71f48c881266a5d28b542d3bca9b6d05093effd1 Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Mon, 16 Jun 2025 12:46:38 -0500 Subject: [PATCH 7/7] fix(wa v1&v2): update default service name --- assistant/v1.ts | 2 +- assistant/v2.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assistant/v1.ts b/assistant/v1.ts index 5e5886f077..84b23e5f9b 100644 --- a/assistant/v1.ts +++ b/assistant/v1.ts @@ -43,7 +43,7 @@ import { getSdkHeaders } from '../lib/common'; class AssistantV1 extends BaseService { static DEFAULT_SERVICE_URL: string = 'https://api.us-south.assistant.watson.cloud.ibm.com'; - static DEFAULT_SERVICE_NAME: string = 'conversation'; + static DEFAULT_SERVICE_NAME: string = 'assistant'; /** Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is * `2021-11-27`. diff --git a/assistant/v2.ts b/assistant/v2.ts index 08ea901cf7..0040052b58 100644 --- a/assistant/v2.ts +++ b/assistant/v2.ts @@ -46,7 +46,7 @@ import { getSdkHeaders } from '../lib/common'; class AssistantV2 extends BaseService { static DEFAULT_SERVICE_URL: string = 'https://api.us-south.assistant.watson.cloud.ibm.com'; - static DEFAULT_SERVICE_NAME: string = 'conversation'; + static DEFAULT_SERVICE_NAME: string = 'assistant'; /** Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is * `2024-08-25`.