MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / print_inference_route

Function print_inference_route

crates/openshell-cli/src/run.rs:5919–5950  ·  view source on GitHub ↗
(
    client: &mut crate::tls::GrpcInferenceClient,
    label: &str,
    route_name: &str,
)

Source from the content-addressed store, hash-verified

5917}
5918
5919async fn print_inference_route(
5920 client: &mut crate::tls::GrpcInferenceClient,
5921 label: &str,
5922 route_name: &str,
5923) {
5924 match client
5925 .get_cluster_inference(GetClusterInferenceRequest {
5926 route_name: route_name.to_string(),
5927 })
5928 .await
5929 {
5930 Ok(response) => {
5931 let configured = response.into_inner();
5932 println!("{}", format!("{label}:").cyan().bold());
5933 println!();
5934 println!(" {} {}", "Provider:".dimmed(), configured.provider_name);
5935 println!(" {} {}", "Model:".dimmed(), configured.model_id);
5936 println!(" {} {}", "Version:".dimmed(), configured.version);
5937 print_timeout(configured.timeout_secs);
5938 }
5939 Err(e) if e.code() == Code::NotFound => {
5940 println!("{}", format!("{label}:").cyan().bold());
5941 println!();
5942 println!(" {}", "Not configured".dimmed());
5943 }
5944 Err(e) => {
5945 println!("{}", format!("{label}:").cyan().bold());
5946 println!();
5947 println!(" {} {}", "Error:".red(), e.message());
5948 }
5949 }
5950}
5951
5952fn print_timeout(timeout_secs: u64) {
5953 if timeout_secs == 0 {

Callers 1

gateway_inference_getFunction · 0.85

Calls 3

print_timeoutFunction · 0.85
get_cluster_inferenceMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected