-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVSDemo.py
More file actions
24 lines (19 loc) · 708 Bytes
/
Copy pathVSDemo.py
File metadata and controls
24 lines (19 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
import json
def test_vectorsphere_embedding():
"""Demo function to test VectorSphere's embedding capabilities."""
api_url = "http://localhost:8000/embed"
# Example text input for embedding
payload = {
"text": "This is a test sentence for embedding."
}
headers = {"Content-Type": "application/json"}
response = requests.post(api_url, headers=headers, json=payload)
# Check response
if response.status_code == 200:
result = response.json()
print("Embedding Result:", json.dumps(result, indent=4))
else:
print("Error:", response.status_code, response.text)
if __name__ == "__main__":
test_vectorsphere_embedding()