Last active
February 14, 2019 11:08
-
-
Save apkelly/40c09c026ffa7b50a930283c01a1c13a to your computer and use it in GitHub Desktop.
CloudAutoMLService.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expected json response from webservice | |
//{ | |
// "payload": [ | |
// { | |
// "classification": { | |
// "score": 0.87991875 | |
// }, | |
// "displayName": "Andy" | |
// } | |
// ] | |
//} | |
interface CloudAutoMLService { | |
@POST("/v1beta1/projects/{project}/locations/{location}/models/{model}:predict") | |
fun classify( | |
@Header("Authorization") authorization: String, | |
@Path("project") project: String, | |
@Path("location") location: String, | |
@Path("model") model: String, | |
@Body body: CloudAutoMLModel | |
): Deferred<CloudResponse> | |
data class Score(val score: Double) | |
data class Classification(val classification: Score?, val displayName: String?) | |
data class CloudResponse(val payload: List<Classification>?) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment