Skip to content

Commit cd3a592

Browse files
committed
feat(AssistantV1): add support for runtime entity alternatives
1 parent 4e0e358 commit cd3a592

8 files changed

+74
-17
lines changed

Scripts/Services/Assistant/V1/AssistantService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ private void OnListExamplesResponse(RESTConnector.Request req, RESTConnector.Res
12681268
///
12691269
/// Add a new user input example to an intent.
12701270
///
1271-
/// If you want to add multiple exaples with a single API call, consider using the **[Update
1271+
/// If you want to add multiple examples with a single API call, consider using the **[Update
12721272
/// intent](#update-intent)** method instead.
12731273
///
12741274
/// This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
@@ -3720,7 +3720,7 @@ private void OnListDialogNodesResponse(RESTConnector.Request req, RESTConnector.
37203720
/// <param name="userLabel">A label that can be displayed externally to describe the purpose of the node to
37213721
/// users. (optional)</param>
37223722
/// <param name="disambiguationOptOut">Whether the dialog node should be excluded from disambiguation
3723-
/// suggestions. (optional, default to false)</param>
3723+
/// suggestions. Valid only when **type**=`standard` or `frame`. (optional, default to false)</param>
37243724
/// <param name="includeAudit">Whether to include the audit properties (`created` and `updated` timestamps) in
37253725
/// the response. (optional, default to false)</param>
37263726
/// <returns><see cref="DialogNode" />DialogNode</returns>
@@ -3960,7 +3960,7 @@ private void OnGetDialogNodeResponse(RESTConnector.Request req, RESTConnector.Re
39603960
/// <param name="newUserLabel">A label that can be displayed externally to describe the purpose of the node to
39613961
/// users. (optional)</param>
39623962
/// <param name="newDisambiguationOptOut">Whether the dialog node should be excluded from disambiguation
3963-
/// suggestions. (optional, default to false)</param>
3963+
/// suggestions. Valid only when **type**=`standard` or `frame`. (optional, default to false)</param>
39643964
/// <param name="includeAudit">Whether to include the audit properties (`created` and `updated` timestamps) in
39653965
/// the response. (optional, default to false)</param>
39663966
/// <returns><see cref="DialogNode" />DialogNode</returns>
@@ -4416,4 +4416,4 @@ private void OnDeleteUserDataResponse(RESTConnector.Request req, RESTConnector.R
44164416
((RequestObject<object>)req).Callback(response, resp.Error);
44174417
}
44184418
}
4419-
}
4419+
}

Scripts/Services/Assistant/V1/Model/DialogNode.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ public class DigressOutSlotsValue
263263
[JsonProperty("user_label", NullValueHandling = NullValueHandling.Ignore)]
264264
public string UserLabel { get; set; }
265265
/// <summary>
266-
/// Whether the dialog node should be excluded from disambiguation suggestions.
266+
/// Whether the dialog node should be excluded from disambiguation suggestions. Valid only when
267+
/// **type**=`standard` or `frame`.
267268
/// </summary>
268269
[JsonProperty("disambiguation_opt_out", NullValueHandling = NullValueHandling.Ignore)]
269270
public bool? DisambiguationOptOut { get; set; }

Scripts/Services/Assistant/V1/Model/DialogNodeOutputGeneric.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2018, 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.
@@ -198,15 +198,15 @@ public class QueryTypeValue
198198
/// The text of the search query. This can be either a natural-language query or a query that uses the Discovery
199199
/// query language syntax, depending on the value of the **query_type** property. For more information, see the
200200
/// [Discovery service
201-
/// documentation](https://cloud.ibm.com/docs/services/discovery/query-operators.html#query-operators). Required
202-
/// when **response_type**=`search_skill`.
201+
/// documentation](https://cloud.ibm.com/docs/discovery/query-operators.html#query-operators). Required when
202+
/// **response_type**=`search_skill`.
203203
/// </summary>
204204
[JsonProperty("query", NullValueHandling = NullValueHandling.Ignore)]
205205
public string Query { get; set; }
206206
/// <summary>
207207
/// An optional filter that narrows the set of documents to be searched. For more information, see the
208208
/// [Discovery service documentation]([Discovery service
209-
/// documentation](https://cloud.ibm.com/docs/services/discovery/query-parameters.html#filter).
209+
/// documentation](https://cloud.ibm.com/docs/discovery/query-parameters.html#filter).
210210
/// </summary>
211211
[JsonProperty("filter", NullValueHandling = NullValueHandling.Ignore)]
212212
public string Filter { get; set; }

Scripts/Services/Assistant/V1/Model/DialogSuggestionResponseGeneric.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2018, 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.
@@ -136,14 +136,13 @@ public class PreferenceValue
136136
[JsonProperty("message_to_human_agent", NullValueHandling = NullValueHandling.Ignore)]
137137
public string MessageToHumanAgent { get; set; }
138138
/// <summary>
139-
/// A label identifying the topic of the conversation, derived from the **user_label** property of the relevant
140-
/// node.
139+
/// A label identifying the topic of the conversation, derived from the **title** property of the relevant node.
141140
/// </summary>
142141
[JsonProperty("topic", NullValueHandling = NullValueHandling.Ignore)]
143142
public virtual string Topic { get; private set; }
144143
/// <summary>
145144
/// The ID of the dialog node that the **topic** property is taken from. The **topic** property is populated
146-
/// using the value of the dialog node's **user_label** property.
145+
/// using the value of the dialog node's **title** property.
147146
/// </summary>
148147
[JsonProperty("dialog_node", NullValueHandling = NullValueHandling.Ignore)]
149148
public string DialogNode { get; set; }

Scripts/Services/Assistant/V1/Model/RuntimeEntity.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ public class RuntimeEntity
6666
[JsonProperty("interpretation", NullValueHandling = NullValueHandling.Ignore)]
6767
public RuntimeEntityInterpretation Interpretation { get; set; }
6868
/// <summary>
69+
/// An array of possible alternative values that the user might have intended instead of the value returned in
70+
/// the **value** property. This property is returned only for `@sys-time` and `@sys-date` entities when the
71+
/// user's input is ambiguous.
72+
///
73+
/// This property is included only if the new system entities are enabled for the workspace.
74+
/// </summary>
75+
[JsonProperty("alternatives", NullValueHandling = NullValueHandling.Ignore)]
76+
public List<RuntimeEntityAlternative> Alternatives { get; set; }
77+
/// <summary>
6978
/// An object describing the role played by a system entity that is specifies the beginning or end of a range
7079
/// recognized in the user input. This property is included only if the new system entities are enabled for the
7180
/// workspace.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2018, 2020.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Assistant.V1.Model
21+
{
22+
/// <summary>
23+
/// An alternative value for the recognized entity.
24+
/// </summary>
25+
public class RuntimeEntityAlternative
26+
{
27+
/// <summary>
28+
/// The entity value that was recognized in the user input.
29+
/// </summary>
30+
[JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
31+
public string Value { get; set; }
32+
/// <summary>
33+
/// A decimal percentage that represents Watson's confidence in the recognized entity.
34+
/// </summary>
35+
[JsonProperty("confidence", NullValueHandling = NullValueHandling.Ignore)]
36+
public float? Confidence { get; set; }
37+
}
38+
}

Scripts/Services/Assistant/V1/Model/RuntimeEntityAlternative.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2018, 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.
@@ -134,14 +134,13 @@ public class PreferenceValue
134134
[JsonProperty("message_to_human_agent", NullValueHandling = NullValueHandling.Ignore)]
135135
public string MessageToHumanAgent { get; set; }
136136
/// <summary>
137-
/// A label identifying the topic of the conversation, derived from the **user_label** property of the relevant
138-
/// node.
137+
/// A label identifying the topic of the conversation, derived from the **title** property of the relevant node.
139138
/// </summary>
140139
[JsonProperty("topic", NullValueHandling = NullValueHandling.Ignore)]
141140
public virtual string Topic { get; private set; }
142141
/// <summary>
143142
/// The ID of the dialog node that the **topic** property is taken from. The **topic** property is populated
144-
/// using the value of the dialog node's **user_label** property.
143+
/// using the value of the dialog node's **title** property.
145144
/// </summary>
146145
[JsonProperty("dialog_node", NullValueHandling = NullValueHandling.Ignore)]
147146
public string DialogNode { get; set; }

0 commit comments

Comments
 (0)