| 275 | |
| 276 | |
| 277 | def gen_core(mod: str) -> str: |
| 278 | return f'''\ |
| 279 | from __future__ import annotations |
| 280 | |
| 281 | from {mod}.exceptions import YourPackageError |
| 282 | |
| 283 | |
| 284 | class YourClient: |
| 285 | """ |
| 286 | Main entry point for <your purpose>. |
| 287 | |
| 288 | Args: |
| 289 | api_key: Required authentication credential. |
| 290 | timeout: Request timeout in seconds. Defaults to 30. |
| 291 | retries: Number of retry attempts. Defaults to 3. |
| 292 | |
| 293 | Raises: |
| 294 | ValueError: If api_key is empty or timeout is non-positive. |
| 295 | |
| 296 | Example: |
| 297 | >>> from {mod} import YourClient |
| 298 | >>> client = YourClient(api_key="sk-...") |
| 299 | >>> result = client.process(data) |
| 300 | """ |
| 301 | |
| 302 | def __init__( |
| 303 | self, |
| 304 | api_key: str, |
| 305 | timeout: int = 30, |
| 306 | retries: int = 3, |
| 307 | ) -> None: |
| 308 | if not api_key: |
| 309 | raise ValueError("api_key must not be empty") |
| 310 | if timeout <= 0: |
| 311 | raise ValueError("timeout must be positive") |
| 312 | self._api_key = api_key |
| 313 | self.timeout = timeout |
| 314 | self.retries = retries |
| 315 | |
| 316 | def process(self, data: dict) -> dict: |
| 317 | """ |
| 318 | Process data and return results. |
| 319 | |
| 320 | Args: |
| 321 | data: Input dictionary to process. |
| 322 | |
| 323 | Returns: |
| 324 | Processed result as a dictionary. |
| 325 | |
| 326 | Raises: |
| 327 | YourPackageError: If processing fails. |
| 328 | """ |
| 329 | raise NotImplementedError |
| 330 | ''' |
| 331 | |
| 332 | |
| 333 | def gen_exceptions(mod: str) -> str: |