Skip to content

Commit f593d47

Browse files
committed
fix aimodel endpoint in sdk
1 parent 8ff0f43 commit f593d47

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

dataspace_sdk/resources/aimodels.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def get_by_id_graphql(self, model_id: str) -> Dict[str, Any]:
9191
Dictionary containing AI model information
9292
"""
9393
query = """
94-
query GetAIModel($id: UUID!) {
95-
aiModel(id: $id) {
94+
query GetAIModel($id: Int!) {
95+
getAiModel(modelId: $id) {
9696
id
9797
name
9898
displayName
@@ -171,7 +171,7 @@ def get_by_id_graphql(self, model_id: str) -> Dict[str, Any]:
171171
"/api/graphql",
172172
json_data={
173173
"query": query,
174-
"variables": {"id": model_id},
174+
"variables": {"id": int(model_id)},
175175
},
176176
)
177177

@@ -180,7 +180,7 @@ def get_by_id_graphql(self, model_id: str) -> Dict[str, Any]:
180180

181181
raise DataSpaceAPIError(f"GraphQL error: {response['errors']}")
182182

183-
result: Dict[str, Any] = response.get("data", {}).get("aiModel", {})
183+
result: Dict[str, Any] = response.get("data", {}).get("getAiModel", {})
184184
return result
185185

186186
def list_all(

0 commit comments

Comments
 (0)