similarity
Calculate pairwise cosine similarity between two text sets, returning a 2D matrix of scores to measure semantic relatedness.
Instructions
Cosine similarity matrix between two sets of texts.
Args: texts_a: First set of strings (rows of the result matrix). texts_b: Second set of strings (columns of the result matrix). dim: Matryoshka truncation dimension; one of 512, 256, 128, 64, 32.
Returns a dict with a 2D similarity matrix of shape (len(a), len(b)).
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": {
"texts_a": "<texts_a>",
"texts_b": "<texts_b>"
},
"name": "similarity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dim | No | ||
| texts_a | Yes | ||
| texts_b | Yes |