fix: decisions from system one correctly
This commit is contained in:
@@ -220,26 +220,12 @@ pub async fn create_decision(
|
|||||||
score,
|
score,
|
||||||
confidence,
|
confidence,
|
||||||
probabilities: {
|
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
|
probabilities
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(choice_id, probability)| {
|
.map(|(choice_id, probability)| {
|
||||||
openai::decisions::ScoreProbability {
|
openai::decisions::ScoreProbability {
|
||||||
value: reverse_legend
|
value: choice_id.parse().expect("it should be a number, I think"),
|
||||||
.get(&choice_id)
|
label: legend.get(&choice_id).expect("it should exist, I think").clone(),
|
||||||
.expect("it should exist, I think")
|
|
||||||
.clone(),
|
|
||||||
label: choice_id,
|
|
||||||
probability,
|
probability,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user