Skip to content

Commit a96d6a6

Browse files
committed
replace dialog node object with generic dictionary
1 parent 2358c62 commit a96d6a6

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

Examples/ServiceExamples/Scripts/ExampleConversation.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using IBM.Watson.DeveloperCloud.Utilities;
2121
using IBM.Watson.DeveloperCloud.Logging;
2222
using System;
23+
using System.Collections.Generic;
2324

2425
public class ExampleConversation : MonoBehaviour
2526
{
@@ -34,9 +35,9 @@ void Start()
3435
m_WorkspaceID = Config.Instance.GetVariableValue("ConversationV1_ID");
3536

3637
Debug.Log("**********User: Hello!");
37-
//MessageWithOnlyInput("Hello!");
38+
MessageWithOnlyInput("Hello!");
3839

39-
GetRawOutput("Hello");
40+
//GetRawOutput("Hello");
4041
}
4142

4243
private void GetRawOutput(string input)
@@ -86,8 +87,11 @@ private void OnMessageWithOnlyInput(MessageResponse resp, string customData)
8687

8788
if (resp.context.system.dialog_stack != null)
8889
{
89-
foreach (DialogNode dialogNode in resp.context.system.dialog_stack)
90-
Log.Debug("ExampleConversation", "dialogNode: {0}", dialogNode.dialog_node);
90+
foreach (Dictionary<string, string> dialogNode in resp.context.system.dialog_stack)
91+
foreach(KeyValuePair<string, string> node in dialogNode)
92+
Log.Debug("ExampleConversation", "dialogNode: {0}", node.Value);
93+
//foreach ((Dictionary<string, string> dialogNode as Dictionary<string, string>) in resp.context.system.dialog_stack)
94+
// Log.Debug("ExampleConversation", "dialogNode: {0}", dialogNode.val);
9195
}
9296
else
9397
{

Scripts/Services/Conversation/Conversation.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
using System;
1919
using System.Text;
20-
using System.Collections.Generic;
2120
using FullSerializer;
22-
using MiniJSON;
2321
using IBM.Watson.DeveloperCloud.Utilities;
2422
using IBM.Watson.DeveloperCloud.Connection;
2523
using IBM.Watson.DeveloperCloud.Logging;

Scripts/Services/Conversation/DataModels.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*
1616
*/
17+
1718
using FullSerializer;
19+
using System.Collections.Generic;
1820

1921
namespace IBM.Watson.DeveloperCloud.Services.Conversation.v1
2022
{
@@ -282,7 +284,7 @@ public class SystemResponse
282284
/// <summary>
283285
/// An array of dialog node IDs that are in focus in the conversation.
284286
/// </summary>
285-
public DialogNode[] dialog_stack { get; set; }
287+
public Dictionary<string, string>[] dialog_stack { get; set; }
286288
/// <summary>
287289
/// The number of cycles of user input and response in this conversation.
288290
/// </summary>
@@ -292,18 +294,6 @@ public class SystemResponse
292294
/// </summary>
293295
public int dialog_request_counter { get; set; }
294296
}
295-
296-
/// <summary>
297-
/// The dialog node ID information.
298-
/// </summary>
299-
[fsObject]
300-
public class DialogNode
301-
{
302-
/// <summary>
303-
/// The dialog node iD in focus.
304-
/// </summary>
305-
public string dialog_node { get; set; }
306-
}
307297
#endregion
308298

309299
#region Version

0 commit comments

Comments
 (0)