smoke_jev.mojo (1118B)
1 from std.os import getenv 2 3 from hyf_provider.jev_client import post_jev_systemone 4 from hyf_runtime.jev_composition import typesafe_api_key_present 5 from json import loads 6 7 8 comptime BASE_URL = "https://api.typesafe.ai" 9 comptime MODEL = "jev-1.13.0" 10 11 12 def main() raises: 13 if not typesafe_api_key_present(): 14 print( 15 "BLOCKED: live Jev smoke requires TYPESAFE_API_KEY and explicit " 16 "authorization; no external call was made." 17 ) 18 raise Error("live_jev_prerequisite_missing") 19 var body = loads( 20 '{"model":"' 21 + MODEL 22 + '","state":"Roma tomatoes available now; basil sold out.",' 23 + '"questions":{"supply_status":{"type":"choice","instructions":' 24 + '"Is produce reported available?","criteria":{"offered":"yes",' 25 + '"unclear":"no"}}}}' 26 ) 27 var outcome = post_jev_systemone(BASE_URL, body, 15000) 28 if outcome.status < 200 or outcome.status >= 300: 29 raise Error( 30 "live Jev smoke failed with status " + String(outcome.status) 31 ) 32 print("ok: live Jev smoke status " + String(outcome.status))