(base_url: String)
| 249 | |
| 250 | impl ApiClient { |
| 251 | pub fn new(base_url: String) -> Self { |
| 252 | let client = Client::builder() |
| 253 | .timeout(std::time::Duration::from_secs(30)) |
| 254 | .build() |
| 255 | .expect("Failed to create HTTP client"); |
| 256 | |
| 257 | Self { |
| 258 | client, |
| 259 | base_url, |
| 260 | current_session: Arc::new(RwLock::new(None)), |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | pub fn create_session(&self, parent_id: Option<String>) -> anyhow::Result<SessionInfo> { |
| 265 | let url = format!("{}/session", self.base_url); |