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

Function verify_provider_endpoint

crates/openshell-server/src/inference.rs:795–819  ·  view source on GitHub ↗
(
    provider_name: &str,
    model_id: &str,
    route: &ResolvedProviderRoute,
)

Source from the content-addressed store, hash-verified

793}
794
795async fn verify_provider_endpoint(
796 provider_name: &str,
797 model_id: &str,
798 route: &ResolvedProviderRoute,
799) -> Result<ValidatedEndpoint, Status> {
800 let client = reqwest::Client::builder()
801 .timeout(Duration::from_secs(30))
802 .build()
803 .map_err(|err| Status::internal(format!("build validation client failed: {err}")))?;
804 verify_backend_endpoint(&client, &route.route)
805 .await
806 .map(|validated| ValidatedEndpoint {
807 url: validated.url,
808 protocol: validated.protocol,
809 })
810 .map_err(|err| {
811 validation_failure(
812 provider_name,
813 model_id,
814 &route.route.endpoint,
815 &err.details,
816 validation_next_steps(err.kind),
817 )
818 })
819}
820
821/// Controls whether `find_provider_api_key` is allowed to fall back to any
822/// non-empty credential when the preferred key names produce no match.

Callers

nothing calls this directly

Calls 4

verify_backend_endpointFunction · 0.85
validation_failureFunction · 0.85
validation_next_stepsFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected