sampler_sample_weighted
Performs weighted random sampling from items with auto-normalized weights. Returns selected sample and normalized weight list, supporting multiple draws with or without replacement.
Instructions
[sampler] Weighted random selection. weights auto-normalized. Returns {sample, weights_normalized}.
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": {
"items": "<items>",
"weights": "<weights>"
},
"name": "sampler_sample_weighted"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| weights | Yes | ||
| n | No | ||
| seed | No | ||
| replacement | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |