Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing elements in SDK #8

Open
iNishantKhare opened this issue Jul 11, 2017 · 3 comments
Open

missing elements in SDK #8

iNishantKhare opened this issue Jul 11, 2017 · 3 comments

Comments

@iNishantKhare
Copy link

Hi,

I am trying to consume the webhook response in my iOS client. I have added "data" and "displayText" elements in web hook and I am trying to use the same in iOS client. However, when I try to use these elements, I get compile time error that these elements don't exist in Fulfillment struct. When I checked the API.AI SDK, I found that only elements available in Fulfillment are "speech" and "messages".

Has anyone faced this issue? Any advice on this will be much appreciated.

Thanks,
Nishant

@ozanpekmezci
Copy link

I have the same problem

@ankita240491
Copy link

ankita240491 commented Mar 22, 2023

I am facing the same problem, Xcode Version 13.2.1 (13C100)

@ankita240491
Copy link

I had to replace bellow function
func serialize(_ source: [String : Any]) throws -> QueryResponse {
let identifier: String = try objectForKey("id", dict: source)

    let dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier: "en_US")
    dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
    
    guard let timestamp: Date = dateFormatter.date(from: try objectForKey("timestamp", dict: source)) else {
        throw SerializeError.typeMismatch("timestamp")
    }
    
    let result = try ResultSerializer().serialize(try objectForKey("result", dict: source))

    return Destination(
        identifier: identifier,
        timestamp: timestamp,
        result: result
    )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants