Skip to content

Commit c5ff41a

Browse files
committed
fix: expert choice consequences has models {} now in result
1 parent bbfb434 commit c5ff41a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

refact-agent/engine/src/cloud/experts_req.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ pub async fn expert_choice_consequences(
112112
let query = r#"
113113
query GetExpertModel($fexp_id: String!, $inside_fgroup_id: String!) {
114114
expert_choice_consequences(fexp_id: $fexp_id, inside_fgroup_id: $inside_fgroup_id) {
115-
provm_name
115+
models {
116+
provm_name
117+
}
116118
}
117119
}
118120
"#;
@@ -129,7 +131,11 @@ pub async fn expert_choice_consequences(
129131
});
130132

131133
info!("expert_choice_consequences: address={}, fexp_id={}, inside_fgroup_id={}", config.address, fexp_id, fgroup_id);
132-
let result: Vec<ModelInfo> = execute_graphql(
134+
#[derive(Deserialize, Debug)]
135+
struct Consequences {
136+
models: Vec<ModelInfo>,
137+
}
138+
let result: Consequences = execute_graphql(
133139
config,
134140
query,
135141
variables,
@@ -138,9 +144,9 @@ pub async fn expert_choice_consequences(
138144
.await
139145
.map_err(|e| e.to_string())?;
140146

141-
if result.is_empty() {
147+
if result.models.is_empty() {
142148
return Err(format!("No models found for the expert with name {}", fexp_id));
143149
}
144150

145-
Ok(result[0].provm_name.clone())
151+
Ok(result.models[0].provm_name.clone())
146152
}

0 commit comments

Comments
 (0)