unitypredict 1.1.44__tar.gz → 1.1.45__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.45}/PKG-INFO +2 -2
- {unitypredict-1.1.44 → unitypredict-1.1.45}/README.md +1 -1
- {unitypredict-1.1.44 → unitypredict-1.1.45}/unitypredict/UnityPredictClient.py +46 -36
- {unitypredict-1.1.44 → unitypredict-1.1.45}/unitypredict.egg-info/PKG-INFO +2 -2
- {unitypredict-1.1.44 → unitypredict-1.1.45}/setup.cfg +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.45}/setup.py +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.45}/unitypredict/__init__.py +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.45}/unitypredict.egg-info/SOURCES.txt +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.45}/unitypredict.egg-info/dependency_links.txt +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.45}/unitypredict.egg-info/requires.txt +0 -0
- {unitypredict-1.1.44 → unitypredict-1.1.45}/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.45
|
|
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
|
|
|
@@ -47,6 +47,7 @@ class UnityPredictResponse:
|
|
|
47
47
|
class UnityPredictClient:
|
|
48
48
|
ApiKey: str = ''
|
|
49
49
|
ApiBaseUrl: str = 'https://api.prod.unitypredict.com/api'
|
|
50
|
+
ApiBaseUrl: str = "https://api.dev.unitypredict.net/api"
|
|
50
51
|
ApiMaxTimeout: int = 12 * 60 * 60
|
|
51
52
|
|
|
52
53
|
# Async Variables
|
|
@@ -183,6 +184,7 @@ class UnityPredictClient:
|
|
|
183
184
|
|
|
184
185
|
|
|
185
186
|
try:
|
|
187
|
+
results.Status = finalResponseJson.get('status')
|
|
186
188
|
results.ComputeCost = finalResponseJson.get('computeCost')
|
|
187
189
|
results.OutcomeValues = outcomeValues
|
|
188
190
|
results.Outcomes = outcomes
|
|
@@ -268,61 +270,69 @@ class UnityPredictClient:
|
|
|
268
270
|
|
|
269
271
|
results, finalResponseJson = self._uploadFileAndStartPredict(modelId=modelId, request=request)
|
|
270
272
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
results.Status = finalResponseJson.get("status", None)
|
|
274
|
+
|
|
275
|
+
if (results.Status == None):
|
|
276
|
+
|
|
277
|
+
return results
|
|
278
|
+
|
|
279
|
+
if (results.Status != "Processing"):
|
|
280
|
+
|
|
281
|
+
results = self._processPredictedInference(responseJson=finalResponseJson, outputFolderPath=request.OutputFolderPath)
|
|
282
|
+
|
|
283
|
+
else:
|
|
284
|
+
results.Status = finalResponseJson.get('status')
|
|
285
|
+
results.RequestId = finalResponseJson.get('requestId')
|
|
286
|
+
results.ErrorMessages = finalResponseJson.get('errorMessages')
|
|
287
|
+
|
|
288
|
+
return results
|
|
273
289
|
|
|
274
290
|
except Exception as e:
|
|
275
291
|
|
|
276
|
-
|
|
292
|
+
results = UnityPredictResponse()
|
|
293
|
+
results.ErrorMessages = f"Predict Exception Occured: {e}"
|
|
294
|
+
|
|
295
|
+
return results
|
|
277
296
|
|
|
278
297
|
|
|
279
|
-
def
|
|
280
|
-
|
|
281
|
-
self._asyncResult.Status = self._asyncResponseJson.get("status", None)
|
|
282
|
-
statusUrl = self._asyncResponseJson.get('statusUrl', None)
|
|
298
|
+
def GetRequestStatus(self, requestId: str, outputFolderPath: str = ""):
|
|
283
299
|
|
|
284
300
|
apiKey = self.ApiKey
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if inferStatus == 'Processing':
|
|
301
|
+
apiBaseUrl = self.ApiBaseUrl
|
|
302
|
+
statusUrl: str = "{}/predict/status/{}".format(apiBaseUrl, requestId)
|
|
288
303
|
|
|
289
|
-
|
|
290
|
-
self._asyncResult.Status = None
|
|
291
|
-
return self._asyncResult
|
|
304
|
+
results: UnityPredictResponse = UnityPredictResponse()
|
|
292
305
|
|
|
293
|
-
|
|
294
|
-
|
|
306
|
+
response = requests.get(url = statusUrl, headers={"Authorization": "Bearer {}".format(apiKey)})
|
|
307
|
+
if response.status_code != 200:
|
|
308
|
+
results.RequestId = requestId
|
|
309
|
+
results.ErrorMessages = 'Error from server: {}'.format(response.status_code)
|
|
310
|
+
return results
|
|
311
|
+
|
|
312
|
+
finalResponseJson = response.json()
|
|
295
313
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
if (inferStatus == None):
|
|
300
|
-
return self._asyncResult
|
|
301
|
-
|
|
302
|
-
if (inferStatus == 'Processing'):
|
|
303
|
-
return self._asyncResult
|
|
314
|
+
inferStatus = finalResponseJson.get('status', None)
|
|
315
|
+
results.Status = inferStatus
|
|
304
316
|
|
|
305
|
-
|
|
306
|
-
|
|
317
|
+
if (inferStatus == None):
|
|
318
|
+
results.RequestId = requestId
|
|
319
|
+
return results
|
|
307
320
|
|
|
308
|
-
|
|
309
|
-
|
|
321
|
+
if (inferStatus == 'Processing'):
|
|
322
|
+
results.RequestId = requestId
|
|
323
|
+
return results
|
|
310
324
|
|
|
311
325
|
|
|
312
326
|
# Once the processing is done
|
|
313
327
|
|
|
314
328
|
try:
|
|
315
|
-
|
|
316
|
-
self._asyncResult.Status = inferStatus
|
|
329
|
+
results = self._processPredictedInference(responseJson=finalResponseJson, outputFolderPath=outputFolderPath)
|
|
317
330
|
except Exception as e:
|
|
318
|
-
|
|
319
|
-
|
|
331
|
+
results = UnityPredictResponse()
|
|
332
|
+
results.RequestId = requestId
|
|
333
|
+
results.ErrorMessages = f"Exception Occured while processing Inference: {e}"
|
|
320
334
|
|
|
321
|
-
return
|
|
322
|
-
|
|
323
|
-
def AsyncResponse(self):
|
|
324
|
-
|
|
325
|
-
return self._asyncResponseJson
|
|
335
|
+
return results
|
|
326
336
|
|
|
327
337
|
|
|
328
338
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unitypredict
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.45
|
|
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
|