-
Notifications
You must be signed in to change notification settings - Fork 10k
Description
Example URL(s)
https://developers.cloudflare.com/workers-ai/models/bge-reranker-base/
Actual Behavior
import os
import requests
ACCOUNT_ID = "your-account-id"
AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
response = requests.post(
f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/baai/bge-reranker-base",
headers={"Authorization": f"Bearer {AUTH_TOKEN}"},
json={
"query": "Which one is better?"
"context": [
{"text": "a cyberpunk lizzard"},
{"text": "a cyberpunk car"},
]
}
)
result = response.json()
print(result)
Expected Behavior
import os
import requests
ACCOUNT_ID = "your-account-id"
AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN")
response = requests.post(
f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/baai/bge-reranker-base",
headers={"Authorization": f"Bearer {AUTH_TOKEN}"},
json={
"query": "Which one is better?",
"contexts": [
{"text": "a cyberpunk lizzard"},
{"text": "a cyberpunk car"},
]
}
)
result = response.json()
print(result)
Additional information
comma
"query": "Which one is better?",
contextS
"contexts": [