unitypredict 1.1.84__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitypredict
3
- Version: 1.1.84
3
+ Version: 1.1.85
4
4
  Summary:
5
5
  Home-page: https://unitypredict.com
6
6
  Author: UnityPredict
@@ -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(tempOutputFolder, fileName)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitypredict
3
- Version: 1.1.84
3
+ Version: 1.1.85
4
4
  Summary:
5
5
  Home-page: https://unitypredict.com
6
6
  Author: UnityPredict
File without changes
File without changes
File without changes