Embeddings API

This commit is contained in:
Cyber MacGeddon 2024-11-20 19:10:58 +00:00
parent f96cf2a682
commit 1c4ec3d361
2 changed files with 89 additions and 0 deletions

25
test-embeddings-api Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env python3
import requests
import json
import sys
url = "http://localhost:8088/api/v1/"
############################################################################
input = {
"text": "What is the highest risk aspect of running a space shuttle program? Provide 5 detailed reasons to justify our answer.",
}
resp = requests.post(
f"{url}embeddings",
json=input,
)
resp = resp.json()
if "error" in resp:
print(f"Error: {resp['error']}")
sys.exit(1)