MCPcopy Create free account
hub / github.com/NVIDIA-NeMo/Switchyard / algorithm

Function algorithm

crates/libsy/src/algorithms/rand.rs:235–237  ·  view source on GitHub ↗

Builds a random router whose targets all share an echo client.

(names: &[&str], weights: Option<Vec<f64>>, seed: Option<u64>)

Source from the content-addressed store, hash-verified

233
234 /// Builds a random router whose targets all share an echo client.
235 fn algorithm(names: &[&str], weights: Option<Vec<f64>>, seed: Option<u64>) -> Result<Random> {
236 Random::new(target_set(names), weights, seed)
237 }
238
239 fn shared_algorithm(names: &[&str]) -> Result<Arc<dyn Algorithm>> {
240 Ok(Arc::new(algorithm(names, None, None)?))

Callers 5

shared_algorithmFunction · 0.70
rejects_invalid_weightsFunction · 0.70
rejects_invalid_targetsFunction · 0.70

Calls 1

target_setFunction · 0.70

Tested by 2

rejects_invalid_weightsFunction · 0.56
rejects_invalid_targetsFunction · 0.56