Flow API - update gateway (#357)

* Altered API to incorporate Flow IDs, refactored for dynamic start/stop of flows
* Gateway: Split endpoint / dispatcher for maintainability
This commit is contained in:
cybermaggedon 2025-05-02 21:11:50 +01:00 committed by GitHub
parent 450f664b1b
commit a70ae9793a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 1206 additions and 907 deletions

33
test-api/test-llm2-api Executable file
View file

@ -0,0 +1,33 @@
#!/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"])
############################################################################

View file

@ -5,7 +5,7 @@ import json
import sys
import base64
url = "http://localhost:8088/api/v1/"
url = "http://localhost:8088/api/v1/flow/0000/document-load"
############################################################################
@ -88,10 +88,7 @@ input = {
}
resp = requests.post(
f"{url}load/document",
json=input,
)
resp = requests.post(url, json=input)
resp = resp.json()

View file

@ -5,7 +5,7 @@ import json
import sys
import base64
url = "http://localhost:8088/api/v1/"
url = "http://localhost:8088/api/v1/flow/0000/service/text-load"
############################################################################
@ -85,10 +85,7 @@ input = {
}
resp = requests.post(
f"{url}load/text",
json=input,
)
resp = requests.post(url, json=input)
resp = resp.json()