Feature/flow librarian (#361)

* Update librarian to new API

* Implementing new schema with document + processing objects
This commit is contained in:
cybermaggedon 2025-05-04 22:26:19 +01:00 committed by GitHub
parent 6bf485788a
commit ff28d26f4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1323 additions and 428 deletions

View file

@ -0,0 +1,41 @@
#!/usr/bin/env python3
import requests
import json
import sys
import base64
url = "http://localhost:8088/api/v1/"
############################################################################
id = "http://trustgraph.ai/doc/9fdee98b-b259-40ac-bcb9-8e82ccedeb04"
user = "trustgraph"
input = {
"operation": "get-document-content",
"user": user,
"document-id": id,
}
resp = requests.post(
f"{url}librarian",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
content = base64.b64decode(resp["content"]).decode("utf-8")
print(content)
sys.exit(0)
############################################################################