mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 08:26:21 +02:00
29 lines
432 B
Text
29 lines
432 B
Text
|
|
#!/usr/bin/env python3
|
||
|
|
|
||
|
|
import requests
|
||
|
|
import json
|
||
|
|
import sys
|
||
|
|
|
||
|
|
url = "http://localhost:8088/api/v1/"
|
||
|
|
|
||
|
|
############################################################################
|
||
|
|
|
||
|
|
input = {
|
||
|
|
"question": "What is 14 plus 12. Justify your answer.",
|
||
|
|
}
|
||
|
|
|
||
|
|
resp = requests.post(
|
||
|
|
f"{url}agent",
|
||
|
|
json=input,
|
||
|
|
)
|
||
|
|
|
||
|
|
resp = resp.json()
|
||
|
|
|
||
|
|
if "error" in resp:
|
||
|
|
print(f"Error: {resp['error']}")
|
||
|
|
sys.exit(1)
|
||
|
|
|
||
|
|
print(resp["answer"])
|
||
|
|
|
||
|
|
|