trustgraph/test-api/test-llm2-api
cybermaggedon a70ae9793a
Flow API - update gateway (#357)
* Altered API to incorporate Flow IDs, refactored for dynamic start/stop of flows
* Gateway: Split endpoint / dispatcher for maintainability
2025-05-02 21:11:50 +01:00

33 lines
595 B
Python
Executable file

#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"system": "",
"prompt": "Add 2 and 3"
}
resp = requests.post(
f"{url}text-completion",
json=input,
)
if resp.status_code != 200:
raise RuntimeError(f"Status code: {resp.status_code}")
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["response"])
############################################################################