snowglobe 0.4.11__tar.gz → 0.4.12__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.
Files changed (26) hide show
  1. {snowglobe-0.4.11/src/snowglobe.egg-info → snowglobe-0.4.12}/PKG-INFO +1 -1
  2. {snowglobe-0.4.11 → snowglobe-0.4.12}/pyproject.toml +1 -1
  3. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/app.py +15 -3
  4. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/cli.py +5 -1
  5. {snowglobe-0.4.11 → snowglobe-0.4.12/src/snowglobe.egg-info}/PKG-INFO +1 -1
  6. {snowglobe-0.4.11 → snowglobe-0.4.12}/LICENSE +0 -0
  7. {snowglobe-0.4.11 → snowglobe-0.4.12}/README.md +0 -0
  8. {snowglobe-0.4.11 → snowglobe-0.4.12}/setup.cfg +0 -0
  9. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/__init__.py +0 -0
  10. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/cli_utils.py +0 -0
  11. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/config.py +0 -0
  12. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/models.py +0 -0
  13. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/project_manager.py +0 -0
  14. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/stats.py +0 -0
  15. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/telemetry.py +0 -0
  16. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe/client/src/utils.py +0 -0
  17. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe.egg-info/SOURCES.txt +0 -0
  18. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe.egg-info/dependency_links.txt +0 -0
  19. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe.egg-info/entry_points.txt +0 -0
  20. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe.egg-info/requires.txt +0 -0
  21. {snowglobe-0.4.11 → snowglobe-0.4.12}/src/snowglobe.egg-info/top_level.txt +0 -0
  22. {snowglobe-0.4.11 → snowglobe-0.4.12}/tests/test_app.py +0 -0
  23. {snowglobe-0.4.11 → snowglobe-0.4.12}/tests/test_cli.py +0 -0
  24. {snowglobe-0.4.11 → snowglobe-0.4.12}/tests/test_config.py +0 -0
  25. {snowglobe-0.4.11 → snowglobe-0.4.12}/tests/test_heartbeat.py +0 -0
  26. {snowglobe-0.4.11 → snowglobe-0.4.12}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snowglobe
3
- Version: 0.4.11
3
+ Version: 0.4.12
4
4
  Summary: client server for usage with snowglobe experiments
5
5
  Author-email: Guardrails AI <contact@guardrailsai.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "snowglobe"
3
- version = "0.4.11"
3
+ version = "0.4.12"
4
4
  authors = [
5
5
  {name = "Guardrails AI", email = "contact@guardrailsai.com"}
6
6
  ]
@@ -157,7 +157,11 @@ async def process_application_heartbeat(app_id):
157
157
  )
158
158
  async def run_completion_fn(completion_request: CompletionRequest):
159
159
  if asyncio.iscoroutinefunction(completion_fn):
160
- response = await completion_fn(completion_request)
160
+ try:
161
+ asyncio.get_running_loop()
162
+ response = await completion_fn(completion_request)
163
+ except RuntimeError:
164
+ response = asyncio.run(completion_fn(completion_request))
161
165
  else:
162
166
  response = completion_fn(completion_request)
163
167
  return response
@@ -250,7 +254,11 @@ async def process_risk_evaluation(test, risk_name, simulation_name, agent_name):
250
254
  )
251
255
  async def run_risk_evaluation_fn(risk_evaluation_request: RiskEvaluationRequest):
252
256
  if asyncio.iscoroutinefunction(risks[risk_name]):
253
- risk_evaluation = await risks[risk_name](risk_evaluation_request)
257
+ try:
258
+ asyncio.get_running_loop()
259
+ risk_evaluation = await risks[risk_name](risk_evaluation_request)
260
+ except RuntimeError:
261
+ risk_evaluation = asyncio.run(risks[risk_name](risk_evaluation_request))
254
262
  else:
255
263
  risk_evaluation = risks[risk_name](risk_evaluation_request)
256
264
  return risk_evaluation
@@ -312,7 +320,11 @@ async def process_test(test, completion_fn, app_id, simulation_name):
312
320
  )
313
321
  async def run_completion_fn(completion_request: CompletionRequest):
314
322
  if asyncio.iscoroutinefunction(completion_fn):
315
- completionOutput = await completion_fn(completion_request)
323
+ try:
324
+ asyncio.get_running_loop()
325
+ completionOutput = await completion_fn(completion_request)
326
+ except RuntimeError:
327
+ completionOutput = asyncio.run(completion_fn(completion_request))
316
328
  else:
317
329
  completionOutput = completion_fn(completion_request)
318
330
  return completionOutput
@@ -401,7 +401,11 @@ def test_agent_wrapper(filename: str, app_id: str, app_name: str) -> Tuple[bool,
401
401
  )
402
402
  async def run_process_scenario(completion_request: CompletionRequest):
403
403
  if asyncio.iscoroutinefunction(process_scenario):
404
- response = asyncio.run(process_scenario(completion_request))
404
+ try:
405
+ asyncio.get_running_loop()
406
+ response = await process_scenario(completion_request)
407
+ except RuntimeError:
408
+ response = asyncio.run(process_scenario(completion_request))
405
409
  else:
406
410
  response = process_scenario(completion_request)
407
411
  return response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snowglobe
3
- Version: 0.4.11
3
+ Version: 0.4.12
4
4
  Summary: client server for usage with snowglobe experiments
5
5
  Author-email: Guardrails AI <contact@guardrailsai.com>
6
6
  License: MIT License
File without changes
File without changes
File without changes
File without changes
File without changes