mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
40 lines
661 B
Text
40 lines
661 B
Text
|
|
#!/usr/bin/env python3
|
||
|
|
|
||
|
|
import requests
|
||
|
|
import json
|
||
|
|
import sys
|
||
|
|
import base64
|
||
|
|
import time
|
||
|
|
|
||
|
|
url = "http://localhost:8088/api/v1/"
|
||
|
|
|
||
|
|
############################################################################
|
||
|
|
|
||
|
|
input = {
|
||
|
|
"operation": "delete-kg-core",
|
||
|
|
"id": "https://trustgraph.ai/doc/intelligence-and-state",
|
||
|
|
"user": "trustgraph",
|
||
|
|
}
|
||
|
|
|
||
|
|
resp = requests.post(
|
||
|
|
f"{url}knowledge",
|
||
|
|
json=input,
|
||
|
|
)
|
||
|
|
|
||
|
|
print(resp.text)
|
||
|
|
resp = resp.json()
|
||
|
|
|
||
|
|
print(resp)
|
||
|
|
|
||
|
|
if "error" in resp:
|
||
|
|
print(f"Error: {resp['error']}")
|
||
|
|
sys.exit(1)
|
||
|
|
|
||
|
|
# print(resp["response"])
|
||
|
|
print(resp)
|
||
|
|
|
||
|
|
sys.exit(0)
|
||
|
|
|
||
|
|
############################################################################
|
||
|
|
|