This commit is contained in:
Cyber MacGeddon 2024-12-02 17:22:40 +00:00
parent 31a171833b
commit 9fa67b5db7
17 changed files with 638 additions and 456 deletions

28
test-api/test-agent2-api Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"question": "What is 14 plus 12. Justify your answer.",
}
resp = requests.post(
f"{url}agent",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["answer"])

30
test-api/test-dbpedia Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"term": "Cornwall",
}
resp = requests.post(
f"{url}dbpedia",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["text"])
sys.exit(0)
############################################################################

30
test-api/test-encyclopedia Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"term": "Cornwall",
}
resp = requests.post(
f"{url}encyclopedia",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["text"])
sys.exit(0)
############################################################################

30
test-api/test-internet-search Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"term": "Cornwall",
}
resp = requests.post(
f"{url}internet-search",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)
print(resp["text"])
sys.exit(0)
############################################################################

View file

@ -9,7 +9,10 @@ url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"p": "http://www.w3.org/2000/01/rdf-schema#label",
"p": {
"v": "http://www.w3.org/2000/01/rdf-schema#label",
"e": True,
},
"limit": 10
}