Skip to content

Commit 35fb2a5

Browse files
committed
feat(assistant-v1): includeAudit and append parameters added to a number of methods
Methods that now include the `includeAudit` parameter: - createWorkspace - updateWorkspace - createIntent - updateIntent - createExample - updateExample - createCounterexample - updateCounterexample - createEntity - updateEntity - createValue - updateValue - createSynonym - updateSynonym - createDialogNode - updateDialogNode Methods that now include the `append` parameter: - updateIntent - updateEntity - updateValue New models: - `RuntimeEntityInterpretation` - `RuntimeEntityRole` - `WorkspaceSystemSettingsSystemEntities` **Assistant v2** New models: - `RuntimeEntityAlternative` - `RuntimeEntityInterpretation` - `RuntimeEntityRole`
1 parent 85281ae commit 35fb2a5

26 files changed

+800
-318
lines changed

assistant/v1.ts

Lines changed: 330 additions & 26 deletions
Large diffs are not rendered by default.

assistant/v2.ts

Lines changed: 147 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ class AssistantV2 extends BaseService {
8080
* Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the
8181
* state of the conversation. A session persists until it is deleted, or until it times out because of inactivity.
8282
* (For more information, see the
83-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-settings).
83+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).
8484
*
8585
* @param {Object} params - The parameters to send to the service.
8686
* @param {string} params.assistantId - Unique identifier of the assistant. To find the assistant ID in the Watson
8787
* Assistant user interface, open the assistant settings and click **API Details**. For information about creating
8888
* assistants, see the
89-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
89+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
9090
*
9191
* **Note:** Currently, the v2 API does not support creating assistants.
9292
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
@@ -149,13 +149,13 @@ class AssistantV2 extends BaseService {
149149
* Delete session.
150150
*
151151
* Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see
152-
* the [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-settings)).
152+
* the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings)).
153153
*
154154
* @param {Object} params - The parameters to send to the service.
155155
* @param {string} params.assistantId - Unique identifier of the assistant. To find the assistant ID in the Watson
156156
* Assistant user interface, open the assistant settings and click **API Details**. For information about creating
157157
* assistants, see the
158-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
158+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
159159
*
160160
* **Note:** Currently, the v2 API does not support creating assistants.
161161
* @param {string} params.sessionId - Unique identifier of the session.
@@ -231,7 +231,7 @@ class AssistantV2 extends BaseService {
231231
* @param {string} params.assistantId - Unique identifier of the assistant. To find the assistant ID in the Watson
232232
* Assistant user interface, open the assistant settings and click **API Details**. For information about creating
233233
* assistants, see the
234-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
234+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
235235
*
236236
* **Note:** Currently, the v2 API does not support creating assistants.
237237
* @param {string} params.sessionId - Unique identifier of the session.
@@ -338,7 +338,7 @@ namespace AssistantV2 {
338338
export interface CreateSessionParams {
339339
/** Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open
340340
* the assistant settings and click **API Details**. For information about creating assistants, see the
341-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
341+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
342342
*
343343
* **Note:** Currently, the v2 API does not support creating assistants.
344344
*/
@@ -350,7 +350,7 @@ namespace AssistantV2 {
350350
export interface DeleteSessionParams {
351351
/** Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open
352352
* the assistant settings and click **API Details**. For information about creating assistants, see the
353-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
353+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
354354
*
355355
* **Note:** Currently, the v2 API does not support creating assistants.
356356
*/
@@ -364,7 +364,7 @@ namespace AssistantV2 {
364364
export interface MessageParams {
365365
/** Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open
366366
* the assistant settings and click **API Details**. For information about creating assistants, see the
367-
* [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
367+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
368368
*
369369
* **Note:** Currently, the v2 API does not support creating assistants.
370370
*/
@@ -495,6 +495,24 @@ namespace AssistantV2 {
495495
* triggering the start node of a dialog).
496496
*/
497497
turn_count?: number;
498+
/** The language code for localization in the user input. The specified locale overrides the default for the
499+
* assistant, and is used for interpreting entity values in user input such as date values. For example,
500+
* `04/03/2018` might be interpreted either as April 3 or March 4, depending on the locale.
501+
*
502+
* This property is included only if the new system entities are enabled for the skill.
503+
*/
504+
locale?: string;
505+
/** The base time for interpreting any relative time mentions in the user input. The specified time overrides
506+
* the current server time, and is used to calculate times mentioned in relative terms such as `now` or `tomorrow`.
507+
* This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as
508+
* news articles.
509+
*
510+
* This value must be a UTC time value formatted according to ISO 8601 (for example, `2019-06-26T12:00:00Z` for
511+
* noon on 26 June 2019.
512+
*
513+
* This property is included only if the new system entities are enabled for the skill.
514+
*/
515+
reference_time?: string;
498516
}
499517

500518
/** Contains information specific to a particular skill used by the Assistant. */
@@ -613,6 +631,127 @@ namespace AssistantV2 {
613631
metadata?: JsonObject;
614632
/** The recognized capture groups for the entity, as defined by the entity pattern. */
615633
groups?: CaptureGroup[];
634+
/** An object containing detailed information about the entity recognized in the user input. This property is
635+
* included only if the new system entities are enabled for the skill.
636+
*
637+
* For more information about how the new system entities are interpreted, see the
638+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities).
639+
*/
640+
interpretation?: RuntimeEntityInterpretation;
641+
/** An array of possible alternative values that the user might have intended instead of the value returned in
642+
* the **value** property. This property is returned only for `@sys-time` and `@sys-date` entities when the user's
643+
* input is ambiguous.
644+
*
645+
* This property is included only if the new system entities are enabled for the skill.
646+
*/
647+
alternatives?: RuntimeEntityAlternative[];
648+
/** An object describing the role played by a system entity that is specifies the beginning or end of a range
649+
* recognized in the user input. This property is included only if the new system entities are enabled for the
650+
* skill.
651+
*/
652+
role?: RuntimeEntityRole;
653+
}
654+
655+
/** An alternative value for the recognized entity. */
656+
export interface RuntimeEntityAlternative {
657+
/** The entity value that was recognized in the user input. */
658+
value?: string;
659+
/** A decimal percentage that represents Watson's confidence in the recognized entity. */
660+
confidence?: number;
661+
}
662+
663+
/** RuntimeEntityInterpretation. */
664+
export interface RuntimeEntityInterpretation {
665+
/** The calendar used to represent a recognized date (for example, `Gregorian`). */
666+
calendar_type?: string;
667+
/** A unique identifier used to associate a recognized time and date. If the user input contains a date and time
668+
* that are mentioned together (for example, `Today at 5`, the same **datetime_link** value is returned for both
669+
* the `@sys-date` and `@sys-time` entities).
670+
*/
671+
datetime_link?: string;
672+
/** A locale-specific holiday name (such as `thanksgiving` or `christmas`). This property is included when a
673+
* `@sys-date` entity is recognized based on a holiday name in the user input.
674+
*/
675+
festival?: string;
676+
/** The precision or duration of a time range specified by a recognized `@sys-time` or `@sys-date` entity. */
677+
granularity?: string;
678+
/** A unique identifier used to associate multiple recognized `@sys-date`, `@sys-time`, or `@sys-number`
679+
* entities that are recognized as a range of values in the user's input (for example, `from July 4 until July 14`
680+
* or `from 20 to 25`).
681+
*/
682+
range_link?: string;
683+
/** The word in the user input that indicates that a `sys-date` or `sys-time` entity is part of an implied range
684+
* where only one date or time is specified (for example, `since` or `until`).
685+
*/
686+
range_modifier?: string;
687+
/** A recognized mention of a relative day, represented numerically as an offset from the current date (for
688+
* example, `-1` for `yesterday` or `10` for `in ten days`).
689+
*/
690+
relative_day?: number;
691+
/** A recognized mention of a relative month, represented numerically as an offset from the current month (for
692+
* example, `1` for `next month` or `-3` for `three months ago`).
693+
*/
694+
relative_month?: number;
695+
/** A recognized mention of a relative week, represented numerically as an offset from the current week (for
696+
* example, `2` for `in two weeks` or `-1` for `last week).
697+
*/
698+
relative_week?: number;
699+
/** A recognized mention of a relative date range for a weekend, represented numerically as an offset from the
700+
* current weekend (for example, `0` for `this weekend` or `-1` for `last weekend`).
701+
*/
702+
relative_weekend?: number;
703+
/** A recognized mention of a relative year, represented numerically as an offset from the current year (for
704+
* example, `1` for `next year` or `-5` for `five years ago`).
705+
*/
706+
relative_year?: number;
707+
/** A recognized mention of a specific date, represented numerically as the date within the month (for example,
708+
* `30` for `June 30`.).
709+
*/
710+
specific_day?: number;
711+
/** A recognized mention of a specific day of the week as a lowercase string (for example, `monday`). */
712+
specific_day_of_week?: string;
713+
/** A recognized mention of a specific month, represented numerically (for example, `7` for `July`). */
714+
specific_month?: number;
715+
/** A recognized mention of a specific quarter, represented numerically (for example, `3` for `the third
716+
* quarter`).
717+
*/
718+
specific_quarter?: number;
719+
/** A recognized mention of a specific year (for example, `2016`). */
720+
specific_year?: number;
721+
/** A recognized numeric value, represented as an integer or double. */
722+
numeric_value?: number;
723+
/** The type of numeric value recognized in the user input (`integer` or `rational`). */
724+
subtype?: string;
725+
/** A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
726+
* `morning` or `afternoon`).
727+
*/
728+
part_of_day?: string;
729+
/** A recognized mention of a relative hour, represented numerically as an offset from the current hour (for
730+
* example, `3` for `in three hours` or `-1` for `an hour ago`).
731+
*/
732+
relative_hour?: number;
733+
/** A recognized mention of a relative time, represented numerically as an offset in minutes from the current
734+
* time (for example, `5` for `in five minutes` or `-15` for `fifteen minutes ago`).
735+
*/
736+
relative_minute?: number;
737+
/** A recognized mention of a relative time, represented numerically as an offset in seconds from the current
738+
* time (for example, `10` for `in ten seconds` or `-30` for `thirty seconds ago`).
739+
*/
740+
relative_second?: number;
741+
/** A recognized specific hour mentioned as part of a time value (for example, `10` for `10:15 AM`.). */
742+
specific_hour?: number;
743+
/** A recognized specific minute mentioned as part of a time value (for example, `15` for `10:15 AM`.). */
744+
specific_minute?: number;
745+
/** A recognized specific second mentioned as part of a time value (for example, `30` for `10:15:30 AM`.). */
746+
specific_second?: number;
747+
/** A recognized time zone mentioned as part of a time value (for example, `EST`). */
748+
timezone?: string;
749+
}
750+
751+
/** An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill. */
752+
export interface RuntimeEntityRole {
753+
/** The relationship of the entity to the range. */
754+
type?: string;
616755
}
617756

618757
/** An intent identified in the user input. */

examples/assistant_tone_analyzer_integration/tone_detection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2015, 2018.
2+
* (C) Copyright IBM Corp. 2015, 2019.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

lib/recognize-stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2014, 2019.
2+
* (C) Copyright IBM Corp. 2014, 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

natural-language-classifier/v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class NaturalLanguageClassifierV1 extends BaseService {
222222
* (`ja`), Korean (`ko`), Brazilian Portuguese (`pt`), and Spanish (`es`).
223223
* @param {NodeJS.ReadableStream|Buffer} params.trainingData - Training data in CSV format. Each text value must have
224224
* at least one class. The data can include up to 3,000 classes and 20,000 records. For details, see [Data
225-
* preparation](https://cloud.ibm.com/docs/services/natural-language-classifier?topic=natural-language-classifier-using-your-data).
225+
* preparation](https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-using-your-data).
226226
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
227227
* @param {Function} [callback] - The callback that handles the response
228228
* @returns {Promise<NaturalLanguageClassifierV1.Response<NaturalLanguageClassifierV1.Classifier>>}
@@ -518,7 +518,7 @@ namespace NaturalLanguageClassifierV1 {
518518
trainingMetadata: NodeJS.ReadableStream|Buffer;
519519
/** Training data in CSV format. Each text value must have at least one class. The data can include up to 3,000
520520
* classes and 20,000 records. For details, see [Data
521-
* preparation](https://cloud.ibm.com/docs/services/natural-language-classifier?topic=natural-language-classifier-using-your-data).
521+
* preparation](https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-using-your-data).
522522
*/
523523
trainingData: NodeJS.ReadableStream|Buffer;
524524
headers?: OutgoingHttpHeaders;

natural-language-understanding/v1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ namespace NaturalLanguageUnderstandingV1 {
457457
/** Enter a [custom
458458
* model](https://cloud.ibm.com/docs/services/natural-language-understanding?topic=natural-language-understanding-customizing)
459459
* ID to override the standard categories model.
460-
*
460+
*
461461
* The custom categories experimental feature will be retired on 19 December 2019. On that date, deployed custom
462462
* categories models will no longer be accessible in Natural Language Understanding. The feature will be removed
463463
* from Knowledge Studio on an earlier date. Custom categories models will no longer be accessible in Knowledge

0 commit comments

Comments
 (0)