WitResponse
public struct WitResponse : Codable, WitResponseProtocol
The root of the json response sent by WienBotKitura. In the legacy wit format, but with optional additional wienbot property that can include actions to perform by the client.
- Example without wienbot: https://dev.api.wienbot.wave-ai.com/message?q=wie%20komme%20ich%20zum%20schwedenplatz
- Example with wienbot: https://dev.api.wienbot.wave-ai.com/message?q=ich%20habe%20meinen%20schl%C3%BCssel%20verloren
-
The text that was sent to wit. Example: “Wie komme ich zum schwedenplatz” - this may not be the text sent by the user, it may have been modified or transated along the way.
Declaration
Swift
public let _text: String -
Message id generated by wit. Useful when communicating with the wit team about problems. Example: “0j2ApLHDS8AHvzHYx”
Declaration
Swift
public let msg_id: String -
Intents and entities that wit recognized. if multipleoutcomes is true, the array of
WitOutcome, can contain multiple outcomes, else wienbotkitura reduces the avalabile outcomes to 1 for you.Declaration
Swift
public var outcomes: [WitOutcome] -
Non-Wit addition. Only available when multipleoutcomes == false. Array of
Actionto perform (message to outbut) by the client, if available. Wave answers are currently not outputted here and need to be resolved client-side via outcomes. Thewienbotproperty overrides theoutcomes: ifwienbotis set, the client should ignoreoutcomes. Optional.Declaration
Swift
public var wienbot: [Action]? -
Non-Wit addition. Array of
QuickReply. Quick replies to be added as quick replies to the answer or to be appended to any quick replies the client may be outputing. For example if the user asks “Wo ist die nächste Bibliothek” (Wave Story),additionalQuickReplieswill contain a “Info: Bibilothek” button, that sends “biblothek” and triggers the WienBot story. Optional.Declaration
Swift
public var additionalQuickReplies: [QuickReply]? -
Non-Wit addition. If true, ask the user for the current location, then resend the
ServerRequest, but addServerRequest.latitudeandServerRequest.longitudewith the user’s current location. Example “Wie komme ich zum Westbahnhof” withServerRequest.resolvewaveset to true. Optional.Declaration
Swift
public var tryAgainWithLocation: Bool? -
The text may have been translated along the way - this was the original text sent by client.
Declaration
Swift
public var originalText: String? -
The language the originalText arrived in: String?
Declaration
Swift
public var sourceLanguage: String? -
If the output was translated, this is the language we translated to.
Declaration
Swift
public var targetLanguage: String? -
Convenience access to the intent of the response. Do not use if multioutcomes == true.
Declaration
Swift
public var intent: String { get } -
Convenience access to the entities of the reponse. Optional. Do not use if multioutcomes == true.
Declaration
Swift
public var entities: [String : [WitEntity]]? { get } -
The confidence of wit’s interpretation, from 0.0 (0%) to 1.0 (100%). Optional. Do not use if multioutcomes == true.
Declaration
Swift
public var confidence: Float { get }
WitResponse Structure Reference