import Semilattice from 'semilattice';
const client = new Semilattice({
apiKey: 'My API Key',
});
const answer = await client.answers.get('answer_id');
console.log(answer.data);{
"data": {
"id": "b8b3e8cb-4c67-40d7-8350-3eac3c2b127d",
"created_at": "2025-06-23T15:40:52Z",
"population": "af8917b4-a09c-41f9-9c9f-c4c40c1f7415",
"status": "Predicted",
"population_name": "Developers",
"question": "Tech debt or unclear error messages, what's worse?",
"accuracy": 0.8528,
"squared_error": 0.1607,
"root_mean_squared_error": 0.1607,
"simulated_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
},
"predicted_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
},
"information_loss": 0.0043,
"normalised_information_loss": 0.051,
"batch": "1e6bfe22-40d9-46c4-b241-9e1d7d5c5560",
"prediction_started_at": "2025-06-23T15:41:02Z",
"prediction_finished_at": "2025-06-23T15:43:56Z",
"test_started_at": "2025-06-23T15:44:10Z",
"test_finished_at": "2025-06-23T15:45:30Z",
"ground_answer_counts": {
"Tech debt": 58,
"Unclear error messages": 42
},
"ground_answer_percentages": {
"Tech debt": 0.58,
"Unclear error messages": 0.42
},
"simulation_engine": "answers-1",
"public": false,
"answer_options": [
"Tech debt",
"Unclear error messages"
],
"question_options": {
"question_type": "single-choice"
}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}Retrieves an answer simulation, along with its status and accuracy metrics if it’s a benchmark simulation.
import Semilattice from 'semilattice';
const client = new Semilattice({
apiKey: 'My API Key',
});
const answer = await client.answers.get('answer_id');
console.log(answer.data);{
"data": {
"id": "b8b3e8cb-4c67-40d7-8350-3eac3c2b127d",
"created_at": "2025-06-23T15:40:52Z",
"population": "af8917b4-a09c-41f9-9c9f-c4c40c1f7415",
"status": "Predicted",
"population_name": "Developers",
"question": "Tech debt or unclear error messages, what's worse?",
"accuracy": 0.8528,
"squared_error": 0.1607,
"root_mean_squared_error": 0.1607,
"simulated_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
},
"predicted_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
},
"information_loss": 0.0043,
"normalised_information_loss": 0.051,
"batch": "1e6bfe22-40d9-46c4-b241-9e1d7d5c5560",
"prediction_started_at": "2025-06-23T15:41:02Z",
"prediction_finished_at": "2025-06-23T15:43:56Z",
"test_started_at": "2025-06-23T15:44:10Z",
"test_finished_at": "2025-06-23T15:45:30Z",
"ground_answer_counts": {
"Tech debt": 58,
"Unclear error messages": 42
},
"ground_answer_percentages": {
"Tech debt": 0.58,
"Unclear error messages": 0.42
},
"simulation_engine": "answers-1",
"public": false,
"answer_options": [
"Tech debt",
"Unclear error messages"
],
"question_options": {
"question_type": "single-choice"
}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}ID of the prediction you want to fetch.
Successful Response
The primary response payload. Contains the result of the request if successful.
Show child attributes
Question ID
"b8b3e8cb-4c67-40d7-8350-3eac3c2b127d"
When the question was created
"2025-06-23T15:40:52Z"
Population ID
"af8917b4-a09c-41f9-9c9f-c4c40c1f7415"
Current status
"Predicted"
Name of the population
"Developers"
Full text of the question
"Tech debt or unclear error messages, what's worse?"
Accuracy for this prediction. Calculated as inverse mean absolute error (1 - MAE)
0.8528
Squared error for this prediction. Calculated as root mean squared error (RMSE)
0.1607
Squared error for this prediction. Calculated as root mean squared error (RMSE)
0.1607
Simulated answer percentages keyed by answer option
{
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
}Predicted answer percentages keyed by answer option
{
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
}Information loss between predicted and ground-truth distributions. Calculated as Kullback-Leibler (KL) divergence (entropy). Cannot be used to compare different predictions.
0.0043
Information loss between predicted and ground-truth distributions normalised to the number of answer options. Calculated as the normalised Kullback-Leibler (KL) divergence (entropy).
0.051
ID shared by all tests or predictions in a batch run
"1e6bfe22-40d9-46c4-b241-9e1d7d5c5560"
When prediction began
"2025-06-23T15:41:02Z"
When prediction finished
"2025-06-23T15:43:56Z"
When test began
"2025-06-23T15:44:10Z"
When test finished
"2025-06-23T15:45:30Z"
Ground-truth answer counts (benchmark mode only)
{
"Tech debt": 58,
"Unclear error messages": 42
}Ground-truth answer percentages (benchmark mode only)
{
"Tech debt": 0.58,
"Unclear error messages": 0.42
}Engine used (e.g. answers-1)
"answers-1"
If the question is public
false
Answer options presented to the model (single/ multi-choice)
["Tech debt", "Unclear error messages"]Per-question configuration - see SimulationQuestionOptions and PopulationQuestionOptions schemas
{ "question_type": "single-choice" }