PredictSummary
The PredictSummary
class represents a summary of predictions based on the analysis of a consultation using a machine learning model. It contains a summary
field, which holds the textual prediction result.
Fields
- summary: (String) - A brief textual summary of the consultation's prediction result.
Example Usage
Once the prediction summary has been retrieved from the model, it can be displayed, stored, or further processed for analysis.
Example of Handling Predict Summary Returned from the Model
Here’s an example showing how to fetch and handle a prediction summary using getPredictSummary
.
// Function to handle a prediction summary returned from the model
fun handlePredictSummary(predictSummary: PredictSummary) {
println("Prediction Summary: ${predictSummary.summary}")
}
// Fetch the prediction summary using the API
fun fetchPredictSummary(consultationId: String) {
getPredictSummary(consultationId, object : ApiCallback<PredictSummary> {
override fun onSuccess(result: PredictSummary) {
handlePredictSummary(result)
}
override fun onRequestError(errorMessage: String?) {
println("Error fetching Predict Summary: $errorMessage")
}
})
}
// Example usage of fetching and handling a PredictSummary
fetchPredictSummary("12345")