mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
* Knowledge cores with msgpack * Put it in the cli package * Tidy up msgpack dumper * Created a loader
28 lines
512 B
Python
Executable file
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"])
|
|
|
|
|