MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / make_non_inference_request

Function make_non_inference_request

e2e/python/test_inference_routing.py:247–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245 spec = datamodel_pb2.SandboxSpec(policy=_baseline_policy())
246
247 def make_non_inference_request() -> str:
248 import ssl
249 import urllib.error
250 import urllib.request
251
252 ctx = ssl.create_default_context()
253 ctx.check_hostname = False
254 ctx.verify_mode = ssl.CERT_NONE
255
256 try:
257 req = urllib.request.Request("https://inference.local/v1/not-inference")
258 urllib.request.urlopen(req, timeout=10, context=ctx)
259 return "unexpected_success"
260 except urllib.error.HTTPError as e:
261 return f"http_error_{e.code}"
262 except Exception as e:
263 return f"error: {e}"
264
265 with sandbox(spec=spec, delete_on_exit=True) as sb:
266 result = sb.exec_python(make_non_inference_request, timeout_seconds=30)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected