unity-sdk icon indicating copy to clipboard operation
unity-sdk copied to clipboard

[conversation] dialog_stack empty

Open Joshua-Carr opened this issue 9 years ago • 2 comments

Judging by the docs on https://www.ibm.com/watson/developercloud/doc/conversation/dialog-build.html#dialog-tree-evaluation it seems that dialog_stack is important for horizontal traversal of dialog trees.

When I get a response, my dialog_stack is empty (IE [0] is out of range)

This happens when using the example code in the readme.

Joshua-Carr avatar Feb 11 '17 21:02 Joshua-Carr

Good catch! I added a missing DialogNode to the Conversation DataModel. Add it to the end of the DataModel.cs in the Conversation service (Scripts/Services/Conversation/DataModel.cs). Alternatively you can grab it from the feature branch gh-213-emptyDialogStack (https://github.com/watson-developer-cloud/unity-sdk/tree/gh-213-emptyDialogStack) or wait until it is merged into develop.

    /// <summary>
    /// Dialog information.
    /// </summary>
    [fsObject]
    public class SystemResponse
    {
        /// <summary>
        /// An array of dialog node IDs that are in focus in the conversation.
        /// </summary>
        public DialogNode[] dialog_stack { get; set; }
        /// <summary>
        /// The number of cycles of user input and response in this conversation.
        /// </summary>
        public int dialog_turn_counter { get; set; }
        /// <summary>
        /// The number of inputs in this conversation. This counter might be higher than the dialog_turn_counter counter when multiple inputs are needed before a response can be returned.
        /// </summary>
        public int dialog_request_counter { get; set; }
    }

    /// <summary>
    /// The dialog node ID information.
    /// </summary>
    [fsObject]
    public class DialogNode
    {
        /// <summary>
        /// The dialog node iD in focus.
        /// </summary>
        public string dialog_node { get; set; }
    }

mediumTaj avatar Feb 12 '17 17:02 mediumTaj

Hi Taj, I downloaded the gh-213-emptyDialogStack and implemented into my Unity project, but I still can't get pass by the parent node. Please advise what I missed. I am using the exampleconversation code inside the example/service folder. Many thanks!

ghettokon avatar Jun 07 '17 08:06 ghettokon