mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31:02 +02:00
Working for LLM + prompt
This commit is contained in:
parent
a8e37037d2
commit
04a6059f33
2 changed files with 87 additions and 50 deletions
19
test-api
19
test-api
|
|
@ -19,14 +19,20 @@ resp = requests.post(
|
|||
json=input,
|
||||
)
|
||||
|
||||
print(resp.json()["response"])
|
||||
sys.exit(0)
|
||||
resp = resp.json()
|
||||
|
||||
if "error" in resp:
|
||||
print(f"Error: {resp['error']}")
|
||||
sys.exit(1)
|
||||
|
||||
print(resp["response"])
|
||||
|
||||
############################################################################
|
||||
|
||||
input = {
|
||||
"id": "question",
|
||||
"variables": {
|
||||
"question": "Add 12 and 14, and then make a poem about llamas which incorporates that number. Then write a joke about llamas."
|
||||
"question": "Write a joke about llamas."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,8 +41,13 @@ resp = requests.post(
|
|||
json=input,
|
||||
)
|
||||
|
||||
print(resp.json()["text"])
|
||||
if "error" in resp:
|
||||
print(f"Error: {resp['error']}")
|
||||
sys.exit(1)
|
||||
|
||||
print(resp["response"])
|
||||
|
||||
sys.exit(0)
|
||||
############################################################################
|
||||
|
||||
input = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue