| 170 | return _response_data(resp) |
| 171 | |
| 172 | def get_batch_status(self, batch_id: str) -> Dict[str, Any]: |
| 173 | try: |
| 174 | resp = self._session.get( |
| 175 | f"{self._jobs_url}/batch/{batch_id}", |
| 176 | timeout=self._timeout, |
| 177 | ) |
| 178 | except requests.Timeout as e: |
| 179 | raise RequestTimeoutError(f"Request timed out: {e}") from e |
| 180 | except requests.ConnectionError as e: |
| 181 | raise NetworkError(f"Connection failed: {e}") from e |
| 182 | _raise_for_response(resp) |
| 183 | return _response_data(resp) |
| 184 | |
| 185 | def fetch_jsonl(self, url: str) -> list: |
| 186 | # Result URLs are often pre-signed object storage links. |