Skip to content

Commit 628eb67

Browse files
committed
fix(wadm-client): update model list topic to use 'get' instead of 'list'
Signed-off-by: Junji Takakura <[email protected]>
1 parent abf0702 commit 628eb67

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

crates/wadm-client/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use wadm_types::{
1010
api::{
1111
DeleteModelRequest, DeleteModelResponse, DeleteResult, DeployModelRequest,
1212
DeployModelResponse, DeployResult, GetModelRequest, GetModelResponse, GetResult,
13-
ModelSummary, PutModelResponse, PutResult, Status, StatusResponse, StatusResult,
14-
VersionInfo, VersionResponse,
13+
ListModelsResponse, ModelSummary, PutModelResponse, PutResult, Status, StatusResponse,
14+
StatusResult, VersionInfo, VersionResponse,
1515
},
1616
Manifest,
1717
};
@@ -129,9 +129,12 @@ impl Client {
129129
.client
130130
.request(topic, Vec::with_capacity(0).into())
131131
.await?;
132-
let body: Vec<ModelSummary> =
132+
let body: ListModelsResponse =
133133
serde_json::from_slice(&resp.payload).map_err(SerializationError::from)?;
134-
Ok(body)
134+
if matches!(body.result, GetResult::Error) {
135+
return Err(ClientError::ApiError(body.message));
136+
}
137+
Ok(body.models)
135138
}
136139

137140
/// Gets a manifest from the lattice by name and optionally its version. If no version is set,

crates/wadm-client/src/topics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl TopicGenerator {
4949

5050
/// Returns the full topic for a model list operation
5151
pub fn model_list_topic(&self) -> String {
52-
format!("{}.list", self.model_prefix())
52+
format!("{}.get", self.model_prefix())
5353
}
5454

5555
/// Returns the full topic for listing the versions of a model

0 commit comments

Comments
 (0)