unitypredict 1.1.83__tar.gz → 1.1.85__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.83 → unitypredict-1.1.85}/PKG-INFO +1 -1
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict/UnityPredictClient.py +8 -1
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict.egg-info/PKG-INFO +1 -1
- {unitypredict-1.1.83 → unitypredict-1.1.85}/README.md +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/setup.cfg +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/setup.py +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict/__init__.py +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict.egg-info/SOURCES.txt +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict.egg-info/dependency_links.txt +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict.egg-info/requires.txt +0 -0
- {unitypredict-1.1.83 → unitypredict-1.1.85}/unitypredict.egg-info/top_level.txt +0 -0
|
@@ -184,6 +184,7 @@ class UnityPredictClient:
|
|
|
184
184
|
|
|
185
185
|
print ("Platform Initialized!")
|
|
186
186
|
requestId: str = response.json().get('requestId')
|
|
187
|
+
contextId: str = response.json().get('contextId')
|
|
187
188
|
|
|
188
189
|
# print (f"Initialized request: {requestId}")
|
|
189
190
|
|
|
@@ -208,6 +209,11 @@ class UnityPredictClient:
|
|
|
208
209
|
|
|
209
210
|
# print (f"Input request: {request.InputValues}")
|
|
210
211
|
jsonBody = json.dumps(request, default=vars)
|
|
212
|
+
jsonBodyObj = json.loads(jsonBody)
|
|
213
|
+
|
|
214
|
+
jsonBodyObj["RequestId"] = requestId
|
|
215
|
+
jsonBodyObj["ContextId"] = contextId
|
|
216
|
+
jsonBody = json.dumps(jsonBodyObj, default=vars)
|
|
211
217
|
|
|
212
218
|
# print (f"URL: {"{}/predict/{}/{}".format(apiBaseUrl, modelId, requestId)}, body: {jsonBody}")
|
|
213
219
|
response = requests.post(url = "{}/predict/{}/{}".format(apiBaseUrl, modelId, requestId), data=jsonBody, headers={"Authorization": "Bearer {}".format(apiKey)})
|
|
@@ -238,7 +244,7 @@ class UnityPredictClient:
|
|
|
238
244
|
if outcomeItem.get('dataType') == 'File':
|
|
239
245
|
fileName = outcomeItem.get('value')
|
|
240
246
|
|
|
241
|
-
tempFilePath = os.path.join(
|
|
247
|
+
tempFilePath = os.path.join(outputFolderPath, fileName)
|
|
242
248
|
response = requests.get(url = "{}/predict/download/{}/{}".format(apiBaseUrl, finalResponseRequestId, fileName), headers={"Authorization": "Bearer {}".format(apiKey)})
|
|
243
249
|
with open(tempFilePath, 'wb') as f:
|
|
244
250
|
f.write(response.content)
|
|
@@ -353,6 +359,7 @@ class UnityPredictClient:
|
|
|
353
359
|
try:
|
|
354
360
|
|
|
355
361
|
results, finalResponseJson = self._uploadFileAndStartPredict(modelId=modelId, request=request)
|
|
362
|
+
# print (f"Final Response JSON: {finalResponseJson}")
|
|
356
363
|
|
|
357
364
|
results.Status = finalResponseJson.get("status", None)
|
|
358
365
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|