fix: decisions from system one correctly
This commit is contained in:
@@ -220,26 +220,12 @@ pub async fn create_decision(
|
||||
score,
|
||||
confidence,
|
||||
probabilities: {
|
||||
let reverse_legend = HashMap::<_, _, RandomState>::from_iter(
|
||||
legend.into_iter().map(|(index, value)| {
|
||||
(
|
||||
value,
|
||||
index
|
||||
.parse::<i32>()
|
||||
.expect("this should be an integer, I believe"),
|
||||
)
|
||||
}),
|
||||
);
|
||||
|
||||
probabilities
|
||||
.into_iter()
|
||||
.map(|(choice_id, probability)| {
|
||||
openai::decisions::ScoreProbability {
|
||||
value: reverse_legend
|
||||
.get(&choice_id)
|
||||
.expect("it should exist, I think")
|
||||
.clone(),
|
||||
label: choice_id,
|
||||
value: choice_id.parse().expect("it should be a number, I think"),
|
||||
label: legend.get(&choice_id).expect("it should exist, I think").clone(),
|
||||
probability,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user