mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
* Tweak timeouts, reduce stop time for publishers / subscribers * More APIs working as flow endpoint
28 lines
531 B
Python
Executable file
28 lines
531 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import requests
|
|
import json
|
|
import sys
|
|
|
|
url = "http://localhost:8088/api/v1/flow/0000/agent"
|
|
|
|
############################################################################
|
|
|
|
input = {
|
|
"question": "What is the highest risk aspect of running a space shuttle program? Provide 5 detailed reasons to justify our answer.",
|
|
}
|
|
|
|
resp = requests.post(
|
|
url,
|
|
json=input,
|
|
)
|
|
|
|
print(resp.text)
|
|
resp = resp.json()
|
|
|
|
if "error" in resp:
|
|
print(f"Error: {resp['error']}")
|
|
sys.exit(1)
|
|
|
|
print(resp["answer"])
|
|
|