@@ -122,7 +122,10 @@ public function predictAsync(Dataset $dataset) : PromiseInterface
122
122
123
123
return $ this ->client ->sendAsync ($ request )
124
124
->then ([$ this , 'parseResponseBody ' ], [$ this , 'onError ' ])
125
- ->then ([$ this , 'unpackPayload ' ]);
125
+ ->then ([$ this , 'unpackPayload ' ])
126
+ ->then (function ($ data ) {
127
+ return $ data ['predictions ' ];
128
+ });
126
129
}
127
130
128
131
/**
@@ -148,7 +151,10 @@ public function probaAsync(Dataset $dataset) : PromiseInterface
148
151
149
152
return $ this ->client ->sendAsync ($ request )
150
153
->then ([$ this , 'parseResponseBody ' ], [$ this , 'onError ' ])
151
- ->then ([$ this , 'unpackPayload ' ]);
154
+ ->then ([$ this , 'unpackPayload ' ])
155
+ ->then (function ($ data ) {
156
+ return $ data ['probabilities ' ];
157
+ });
152
158
}
153
159
154
160
/**
@@ -174,7 +180,10 @@ public function scoreAsync(Dataset $dataset) : PromiseInterface
174
180
175
181
return $ this ->client ->sendAsync ($ request )
176
182
->then ([$ this , 'parseResponseBody ' ], [$ this , 'onError ' ])
177
- ->then ([$ this , 'unpackPayload ' ]);
183
+ ->then ([$ this , 'unpackPayload ' ])
184
+ ->then (function ($ data ) {
185
+ return $ data ['scores ' ];
186
+ });
178
187
}
179
188
180
189
/**
0 commit comments