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

Support for "search" type responses from AssistantV2

Open lorimbrius opened this issue 7 years ago • 5 comments

Watson Assistant v2 supports a "search" type response if the dialog falls through to a search skill. The structure looks like this:

{
    "output": {
        "generic": [
            {
                "response_type": "search",
                "header": "I think this could be relevant:",
                "results": [ ... ]
            }
        ],
        "intents": [],
        "entities": []
    },
    "context": {
        "global": {
            "system": {
                "turn_count": 1
            }
        }
    }
}

But the DialogRuntimeResponseGeneric class doesn't support this response type:

  /**
   * The type of response returned by the dialog node. The specified response type must be supported by the client
   * application or channel.
   *
   * **Note:** The **suggestion** response type is part of the disambiguation feature, which is only available for
   * Premium users.
   */
  public interface ResponseType {
    /** text. */
    String TEXT = "text";
    /** pause. */
    String PAUSE = "pause";
    /** image. */
    String IMAGE = "image";
    /** option. */
    String OPTION = "option";
    /** connect_to_agent. */
    String CONNECT_TO_AGENT = "connect_to_agent";
    /** suggestion. */
    String SUGGESTION = "suggestion";
  }

See screenshots: Screenshot 2019-04-23 12 01 27 Screenshot 2019-04-23 12 02 10

lorimbrius avatar Apr 25 '19 12:04 lorimbrius

Hi @lorimbrius. The search type should still be supported if you just supply the string "search". The provided interfaces with string constants are just there for convenience and don't need to be used.

search isn't present already because the SDK is slightly behind the API but it'll be updated relatively soon. Let me know if passing the string manually doesn't work for whatever reason.

lpatino10 avatar Apr 25 '19 18:04 lpatino10

I can pass the string "search" but the header and results fields aren't there either. Likewise, if I pass "search", the text field is empty (because the "search" type doesn't have a "text" field, but a "header" instead).

lorimbrius avatar Apr 25 '19 18:04 lorimbrius

@rrberry any idea about the search responseType?

mediumTaj avatar Apr 25 '19 21:04 mediumTaj

Search skill is still in beta, so it isn't documented in the Swagger yet. If there is a requirement to support it in the SDK, we'll have to figure out how to address that.

rrberry avatar Apr 26 '19 13:04 rrberry

Thanks @rrberry . @lorimbrius Beta features aren't supported in the SDKs because they can lead to incompatible changes. Closing this issue.

mediumTaj avatar Apr 26 '19 13:04 mediumTaj