wit-ai / wit-go

Go client for wit.ai HTTP API
MIT License
156 stars 30 forks source link

I don't know how to parse Entities from MessageResponse ? #3

Closed anhhtz closed 5 years ago

anhhtz commented 5 years ago

Hello,

Sorry for a basic question but I wasted 5 days for that problem

// communicate with AI service
    result, err := witClient.Parse(&witai.MessageRequest{
        Query: textMessage,
    })

    if err != nil { // handle error

    }
    // we have `result` (witai.MessageResponse) here
    data := []byte(result.Entities) // cannot continue because error convert from interface{} to []byte

I cannot continue because error convert from interface{} to []byte.

I want to extract entities key to an array and entities content to an another.

Hope you can guide me how to extract that.

Thanks in advanced !