mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Feature/api gateway (#164)
* Bare bones API gateway * Working for LLM + prompt * RAG query works * Triples query * Added agent API * Embeddings API * Put API tests in a subdir
This commit is contained in:
parent
b536d78b57
commit
92b84441eb
9 changed files with 768 additions and 0 deletions
31
test-api/test-graph-rag-api
Executable file
31
test-api/test-graph-rag-api
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import requests
|
||||
import json
|
||||
import sys
|
||||
|
||||
url = "http://localhost:8088/api/v1/"
|
||||
|
||||
############################################################################
|
||||
|
||||
input = {
|
||||
"query": "Give me 10 facts",
|
||||
}
|
||||
|
||||
resp = requests.post(
|
||||
f"{url}graph-rag",
|
||||
json=input,
|
||||
)
|
||||
|
||||
resp = resp.json()
|
||||
|
||||
print(resp)
|
||||
if "error" in resp:
|
||||
print(f"Error: {resp['error']}")
|
||||
sys.exit(1)
|
||||
|
||||
print(resp["response"])
|
||||
|
||||
sys.exit(0)
|
||||
############################################################################
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue