mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31:02 +02:00
RAG query works
This commit is contained in:
parent
04a6059f33
commit
a8b621f32e
5 changed files with 202 additions and 1 deletions
31
test-llm-api
Executable file
31
test-llm-api
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import requests
|
||||
import json
|
||||
import sys
|
||||
|
||||
url = "http://localhost:8088/api/v1/"
|
||||
|
||||
############################################################################
|
||||
|
||||
input = {
|
||||
"system": "Respond in French. Use long word, form of numbers, no digits",
|
||||
# "prompt": "Add 2 and 12"
|
||||
"prompt": "Add 12 and 14, and then make a poem about llamas which incorporates that number. Then write a joke about llamas"
|
||||
}
|
||||
|
||||
resp = requests.post(
|
||||
f"{url}text-completion",
|
||||
json=input,
|
||||
)
|
||||
|
||||
resp = resp.json()
|
||||
|
||||
if "error" in resp:
|
||||
print(f"Error: {resp['error']}")
|
||||
sys.exit(1)
|
||||
|
||||
print(resp["response"])
|
||||
|
||||
############################################################################
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue