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

@ -4,12 +4,13 @@ import requests
import json
import sys
import base64
import time
url = "http://localhost:8088/api/v1/"
############################################################################
id = "http://trustgraph.ai/doc/12345678"
id = "http://trustgraph.ai/doc/6d034da9-2759-45c2-af24-14db7f4c44c2"
source = "../sources/20160001634.pdf"
@ -17,9 +18,13 @@ with open(source, "rb") as f:
doc = base64.b64encode(f.read()).decode("utf-8")
input = {
"operation": "add",
"id": id,
"document": {
"operation": "add-document",
"document-metadata": {
"id": id,
"time": int(time.time()),
"kind": "application/pdf",
"title": "Application of SAE ARP4754A to Flight Critical Systems",
"comments": "Application of federal safety standards to NASA spacecraft",
"metadata": [
{
"s": {
@ -61,11 +66,10 @@ input = {
},
},
],
"document": doc,
"kind": "application/pdf",
"user": "trustgraph",
"collection": "default",
}
"tags": ["nasa", "safety-engineering"],
},
"content": doc,
}
resp = requests.post(