|
41 | 41 | def display_banner(): |
42 | 42 | """Display the ASCII art banner.""" |
43 | 43 | console.print(BANNER) |
44 | | - console.print("\n[dim]Version 1.0.6 - Type 'help' for commands[/dim]\n") |
| 44 | + console.print("\n[dim]Version 1.0.7 - Type 'help' for commands[/dim]\n") |
45 | 45 | console.print("[dim]Built by [bold magenta]Ashioya Jotham Victor[/bold magenta][/dim]\n") |
46 | 46 |
|
47 | 47 | def display_intro(): |
@@ -192,9 +192,20 @@ def _check_required_keys(agent_initialization=False): |
192 | 192 | border_style="yellow" |
193 | 193 | )) |
194 | 194 |
|
195 | | - # Check which keys can be stored securely |
196 | | - secure_storage_available = keyring_available and config.get("use_keyring", True) |
197 | | - secure_status = config.securely_stored_keys() if secure_storage_available else {} |
| 195 | + # Check which keys can be stored securely - safely handle different config types |
| 196 | + secure_storage_available = keyring_available |
| 197 | + secure_status = {} |
| 198 | + |
| 199 | + # Only try to call securely_stored_keys if the config object might have this method |
| 200 | + if hasattr(config, 'securely_stored_keys') and callable(getattr(config, 'securely_stored_keys', None)): |
| 201 | + try: |
| 202 | + secure_status = config.securely_stored_keys() |
| 203 | + except Exception: |
| 204 | + # Fall back to assuming no secure storage if method fails |
| 205 | + secure_status = {} |
| 206 | + else: |
| 207 | + # This is likely an old version or different implementation |
| 208 | + secure_storage_available = False |
198 | 209 |
|
199 | 210 | for key, display_name in required_keys.items(): |
200 | 211 | if key not in missing_keys: |
@@ -437,9 +448,16 @@ def config(api_key, serper_key, timeout, format, use_keyring, show): |
437 | 448 |
|
438 | 449 | if show: |
439 | 450 | click.echo("Current configuration:") |
440 | | - secure_keys = config.securely_stored_keys() if secure_storage else {} |
441 | 451 |
|
442 | | - for key, value in config.items(): |
| 452 | + # Safely handle different config types |
| 453 | + secure_keys = {} |
| 454 | + if hasattr(config, 'securely_stored_keys') and callable(getattr(config, 'securely_stored_keys', None)): |
| 455 | + try: |
| 456 | + secure_keys = config.securely_stored_keys() |
| 457 | + except Exception: |
| 458 | + secure_keys = {} |
| 459 | + |
| 460 | + for key, value in (config.items() if hasattr(config, 'items') else config.get_all().items()): |
443 | 461 | if key.endswith('_api_key') and value: |
444 | 462 | value = f"{value[:4]}...{value[-4:]}" |
445 | 463 | storage_info = " [stored in system keyring]" if secure_keys.get(key, False) else "" |
|
0 commit comments