trustgraph/test-api/test-embeddings-api
cybermaggedon 340d7a224f
Feature/rework kg core (#171)
* Knowledge cores with msgpack
* Put it in the cli package
* Tidy up msgpack dumper
* Created a loader
2024-11-25 20:46:35 +00:00

28 lines
512 B
Python
Executable file

#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"text": "What is the highest risk aspect of running a space shuttle program? Provide 5 detailed reasons to justify our answer.",
}
resp = requests.post(
f"{url}embeddings",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["vectors"])