In Keywords AI, you can log outputs of embedding models. This is useful for a variety of use cases, such as semantic search, clustering, and more.
You can use the same API endpoint to log embedding models.
Here is an example of how to log an embedding model.
import requests
url = "https://api.keywordsai.co/api/request-logs/create/"
headers = {
"Authorization": "Bearer YOUR_KEYWORDS_AI_API_KEY",
"Content-Type": "application/json"
}
payload = {
"latency": 0.323887338,
"embedding": [
-0.006929283495992422,
-0.005336422007530928,
-4.547132266452536e-05,
-0.024047505110502243
],
"log_type": "embedding",
"model": "text-embedding-3-small",
"input": "something to embed"
}
response = requests.request("POST", url, headers=headers, json=payload)