unitypredict 1.1.44__tar.gz → 1.1.46__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unitypredict-1.1.44 → unitypredict-1.1.46}/PKG-INFO +2 -2
- {unitypredict-1.1.44 → unitypredict-1.1.46}/README.md +1 -1
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict/UnityPredictClient.py +45 -36
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict.egg-info/PKG-INFO +2 -2
- {unitypredict-1.1.44 → unitypredict-1.1.46}/setup.cfg +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.46}/setup.py +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict/__init__.py +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict.egg-info/SOURCES.txt +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict.egg-info/dependency_links.txt +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict.egg-info/requires.txt +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.46}/unitypredict.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unitypredict
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.46
|
|
4
4
|
Summary:
|
|
5
5
|
Home-page: https://unitypredict.com
|
|
6
6
|
Author: UnityPredict
|
|
@@ -19,7 +19,7 @@ pip install unitypredict
|
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
|
-
TFor detailed instructions on how to use the SDK, please refer to [
|
|
22
|
+
TFor detailed instructions on how to use the SDK, please refer to [UnityPredict API Documentation](https://docs.unitypredict.com/sdk).
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -9,7 +9,7 @@ pip install unitypredict
|
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
|
-
TFor detailed instructions on how to use the SDK, please refer to [
|
|
12
|
+
TFor detailed instructions on how to use the SDK, please refer to [UnityPredict API Documentation](https://docs.unitypredict.com/sdk).
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -183,6 +183,7 @@ class UnityPredictClient:
|
|
|
183
183
|
|
|
184
184
|
|
|
185
185
|
try:
|
|
186
|
+
results.Status = finalResponseJson.get('status')
|
|
186
187
|
results.ComputeCost = finalResponseJson.get('computeCost')
|
|
187
188
|
results.OutcomeValues = outcomeValues
|
|
188
189
|
results.Outcomes = outcomes
|
|
@@ -268,61 +269,69 @@ class UnityPredictClient:
|
|
|
268
269
|
|
|
269
270
|
results, finalResponseJson = self._uploadFileAndStartPredict(modelId=modelId, request=request)
|
|
270
271
|
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
results.Status = finalResponseJson.get("status", None)
|
|
273
|
+
|
|
274
|
+
if (results.Status == None):
|
|
275
|
+
|
|
276
|
+
return results
|
|
277
|
+
|
|
278
|
+
if (results.Status != "Processing"):
|
|
279
|
+
|
|
280
|
+
results = self._processPredictedInference(responseJson=finalResponseJson, outputFolderPath=request.OutputFolderPath)
|
|
281
|
+
|
|
282
|
+
else:
|
|
283
|
+
results.Status = finalResponseJson.get('status')
|
|
284
|
+
results.RequestId = finalResponseJson.get('requestId')
|
|
285
|
+
results.ErrorMessages = finalResponseJson.get('errorMessages')
|
|
286
|
+
|
|
287
|
+
return results
|
|
273
288
|
|
|
274
289
|
except Exception as e:
|
|
275
290
|
|
|
276
|
-
|
|
291
|
+
results = UnityPredictResponse()
|
|
292
|
+
results.ErrorMessages = f"Predict Exception Occured: {e}"
|
|
293
|
+
|
|
294
|
+
return results
|
|
277
295
|
|
|
278
296
|
|
|
279
|
-
def
|
|
280
|
-
|
|
281
|
-
self._asyncResult.Status = self._asyncResponseJson.get("status", None)
|
|
282
|
-
statusUrl = self._asyncResponseJson.get('statusUrl', None)
|
|
297
|
+
def GetRequestStatus(self, requestId: str, outputFolderPath: str = ""):
|
|
283
298
|
|
|
284
299
|
apiKey = self.ApiKey
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if inferStatus == 'Processing':
|
|
300
|
+
apiBaseUrl = self.ApiBaseUrl
|
|
301
|
+
statusUrl: str = "{}/predict/status/{}".format(apiBaseUrl, requestId)
|
|
288
302
|
|
|
289
|
-
|
|
290
|
-
self._asyncResult.Status = None
|
|
291
|
-
return self._asyncResult
|
|
303
|
+
results: UnityPredictResponse = UnityPredictResponse()
|
|
292
304
|
|
|
293
|
-
|
|
294
|
-
|
|
305
|
+
response = requests.get(url = statusUrl, headers={"Authorization": "Bearer {}".format(apiKey)})
|
|
306
|
+
if response.status_code != 200:
|
|
307
|
+
results.RequestId = requestId
|
|
308
|
+
results.ErrorMessages = 'Error from server: {}'.format(response.status_code)
|
|
309
|
+
return results
|
|
310
|
+
|
|
311
|
+
finalResponseJson = response.json()
|
|
295
312
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
if (inferStatus == None):
|
|
300
|
-
return self._asyncResult
|
|
301
|
-
|
|
302
|
-
if (inferStatus == 'Processing'):
|
|
303
|
-
return self._asyncResult
|
|
313
|
+
inferStatus = finalResponseJson.get('status', None)
|
|
314
|
+
results.Status = inferStatus
|
|
304
315
|
|
|
305
|
-
|
|
306
|
-
|
|
316
|
+
if (inferStatus == None):
|
|
317
|
+
results.RequestId = requestId
|
|
318
|
+
return results
|
|
307
319
|
|
|
308
|
-
|
|
309
|
-
|
|
320
|
+
if (inferStatus == 'Processing'):
|
|
321
|
+
results.RequestId = requestId
|
|
322
|
+
return results
|
|
310
323
|
|
|
311
324
|
|
|
312
325
|
# Once the processing is done
|
|
313
326
|
|
|
314
327
|
try:
|
|
315
|
-
|
|
316
|
-
self._asyncResult.Status = inferStatus
|
|
328
|
+
results = self._processPredictedInference(responseJson=finalResponseJson, outputFolderPath=outputFolderPath)
|
|
317
329
|
except Exception as e:
|
|
318
|
-
|
|
319
|
-
|
|
330
|
+
results = UnityPredictResponse()
|
|
331
|
+
results.RequestId = requestId
|
|
332
|
+
results.ErrorMessages = f"Exception Occured while processing Inference: {e}"
|
|
320
333
|
|
|
321
|
-
return
|
|
322
|
-
|
|
323
|
-
def AsyncResponse(self):
|
|
324
|
-
|
|
325
|
-
return self._asyncResponseJson
|
|
334
|
+
return results
|
|
326
335
|
|
|
327
336
|
|
|
328
337
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unitypredict
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.46
|
|
4
4
|
Summary:
|
|
5
5
|
Home-page: https://unitypredict.com
|
|
6
6
|
Author: UnityPredict
|
|
@@ -19,7 +19,7 @@ pip install unitypredict
|
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
|
-
TFor detailed instructions on how to use the SDK, please refer to [
|
|
22
|
+
TFor detailed instructions on how to use the SDK, please refer to [UnityPredict API Documentation](https://docs.unitypredict.com/sdk).
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|