Skip to content

Commit c1ac34a

Browse files
committed
fix(assistant-v2): add new property, answers for assistant v2
1 parent 0324dd5 commit c1ac34a

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 2021.
2+
* (C) Copyright IBM Corp. 2021.
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.
@@ -153,6 +153,11 @@ public class PreferenceValue
153153
[JsonProperty("agent_unavailable", NullValueHandling = NullValueHandling.Ignore)]
154154
public AgentAvailabilityMessage AgentUnavailable { get; protected set; }
155155
/// <summary>
156+
/// Routing or other contextual information to be used by target service desk systems.
157+
/// </summary>
158+
[JsonProperty("transfer_info", NullValueHandling = NullValueHandling.Ignore)]
159+
public DialogNodeOutputConnectToAgentTransferInfo TransferInfo { get; protected set; }
160+
/// <summary>
156161
/// A label identifying the topic of the conversation, derived from the **title** property of the relevant node
157162
/// or the **topic** property of the dialog node response.
158163
/// </summary>

Scripts/Services/Assistant/V2/Model/SearchResult.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2019, 2021.
2+
* (C) Copyright IBM Corp. 2021.
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.
@@ -15,6 +15,7 @@
1515
*
1616
*/
1717

18+
using System.Collections.Generic;
1819
using Newtonsoft.Json;
1920

2021
namespace IBM.Watson.Assistant.V2.Model
@@ -60,5 +61,14 @@ public class SearchResult
6061
/// </summary>
6162
[JsonProperty("highlight", NullValueHandling = NullValueHandling.Ignore)]
6263
public SearchResultHighlight Highlight { get; set; }
64+
/// <summary>
65+
/// An array specifying segments of text within the result that were identified as direct answers to the search
66+
/// query. Currently, only the single answer with the highest confidence (if any) is returned.
67+
///
68+
/// **Note:** This property uses the answer finding beta feature, and is available only if the search skill is
69+
/// connected to a Discovery v2 service instance.
70+
/// </summary>
71+
[JsonProperty("answers", NullValueHandling = NullValueHandling.Ignore)]
72+
public List<SearchResultAnswer> Answers { get; set; }
6373
}
6474
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2021.
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.V2.Model
21+
{
22+
/// <summary>
23+
/// An object specifing a segment of text that was identified as a direct answer to the search query.
24+
/// </summary>
25+
public class SearchResultAnswer
26+
{
27+
/// <summary>
28+
/// The text of the answer.
29+
/// </summary>
30+
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
31+
public string Text { get; set; }
32+
/// <summary>
33+
/// The confidence score for the answer, as returned by the Discovery service.
34+
/// </summary>
35+
[JsonProperty("confidence", NullValueHandling = NullValueHandling.Ignore)]
36+
public double? Confidence { get; set; }
37+
}
38+
}

0 commit comments

Comments
 (0)