import httpx
import requests
import json
TEST_URL = "http://localhost:8501/api/embedding"
TEST_HEADERS = {
        "Content-Type": "application/json; charset=utf-8"        
    }

TEST_DATA={"action":"embedding", "data": [{"text":"世界"}]}
print(json.dumps(TEST_DATA))
def test():
    
    try:
        response = requests.post(TEST_URL, headers=TEST_HEADERS, json=TEST_DATA)
        print(response.status_code)
        print(response.text)
    except Exception as e:
        print(f"Error: ",e)

test()