(&self)
| 445 | } |
| 446 | |
| 447 | pub fn get_config_providers(&self) -> anyhow::Result<ProviderListResponse> { |
| 448 | let url = format!("{}/config/providers", self.base_url); |
| 449 | |
| 450 | let response = self.client.get(&url).send()?; |
| 451 | |
| 452 | if !response.status().is_success() { |
| 453 | let status = response.status(); |
| 454 | let text = response.text().unwrap_or_default(); |
| 455 | anyhow::bail!("Failed to get providers: {} - {}", status, text); |
| 456 | } |
| 457 | |
| 458 | let providers: ProviderListResponse = response.json()?; |
| 459 | Ok(providers) |
| 460 | } |
| 461 | |
| 462 | pub fn list_agents(&self) -> anyhow::Result<Vec<AgentInfo>> { |
| 463 | let url = format!("{}/agent", self.base_url); |
no test coverage detected