(
provider_name: &str,
model_id: &str,
route: &ResolvedProviderRoute,
)
| 793 | } |
| 794 | |
| 795 | async 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. |
nothing calls this directly
no test coverage detected