Semantic similarity ranking
similarityRanks up to 15 candidate texts by cosine similarity to a query, using @cf/baai/bge-base-en-v1.5 embeddings. Returns { model, ranked: [{ index, score }] (highest first), scores: number[] (input order) } Price: 3 credits (1 credit = 1 US cent) per successful call; input that does not match the schema is rejected before billing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"candidates": "<candidates>"
},
"name": "similarity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Query text, up to 2000 characters. | |
| candidates | Yes | 1 to 15 candidate texts, each up to 2000 characters. |