Skip to content

Instantly share code, notes, and snippets.

@zeryx
Created January 5, 2017 21:56
Show Gist options
  • Save zeryx/af9b3edca4e303346acc6097846445df to your computer and use it in GitHub Desktop.
Save zeryx/af9b3edca4e303346acc6097846445df to your computer and use it in GitHub Desktop.
package algorithmia.TechSupport
import algorithmia.TechSupport.Classes.DataPoint
import argonaut.Argonaut._
import argonaut.CodecJson
/**
* Created by james on 05/01/17.
*/
sealed trait Input
case class Training(labelData: Option[List[DataPoint]], labelFile: Option[String], namespace: Option[String]) extends Input
case class Predict(text: String, namespace: Option[String]) extends Input
object Training{
implicit def TrainingCodec: CodecJson[Training] =
casecodec3(Training.apply, Training.unapply)(
"labelData",
"labelFile",
"namespace"
)
}
object Predict{
implicit def PredictCodec: CodecJson[Predict] =
casecodec2(Predict.apply, Predict.unapply)(
"text",
"namespace"
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment