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:
cybermaggedon 2024-11-20 19:55:40 +00:00 committed by GitHub
parent b536d78b57
commit 92b84441eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 768 additions and 0 deletions

35
test-api/test-triples-query-api Executable file
View file

@ -0,0 +1,35 @@
#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"p": "http://www.w3.org/2000/01/rdf-schema#label",
"limit": 10
}
resp = requests.post(
f"{url}triples-query",
json=input,
)
print(resp.text)
resp = resp.json()
print(resp)
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["response"])
sys.exit(0)
############################################################################