Skip to content

Commit fd91352

Browse files
updating sdk to match api.
1 parent 162aec5 commit fd91352

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kintsugi-python"
3-
version = "0.1.6"
3+
version = "0.1.7"
44

55
description = "Python SDK to access Kintsugi Voice API V2."
66
authors = [

src/kintsugi/parsers.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ def parse(self, data: dict) -> Prediction:
2929
output.is_calibrated = data['is_calibrated']
3030
output.status = data['status']
3131

32-
if 'predicted_score' in data:
33-
predicted_data_raw = data['predicted_score']
34-
predicted_data = predicted_data_raw
32+
if output.status != 'processing':
33+
categories = data['model_category'].split(',')
3534

36-
if isinstance(predicted_data_raw, str):
37-
predicted_data = {data['model_category']: predicted_data_raw}
38-
39-
output.predicted_score = predicted_data
35+
for category in categories:
36+
if 'predicted_score_' + category in data:
37+
output.predicted_score[category] = data['predicted_score_' + category]
4038

4139
if 'actual_score' in data:
4240
output.feedback_score = FeedbackScoreParser().parse(data['actual_score'])

0 commit comments

Comments
 (0)