ngpt 1.7.1__py3-none-any.whl → 1.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ngpt/cli.py CHANGED
@@ -385,20 +385,38 @@ def main():
385
385
  print(f"Total configurations: {len(configs)}")
386
386
  print(f"Active configuration index: {args.config_index}")
387
387
 
388
+ # Temporarily initialize a client to get the detected provider for each config
389
+ def get_detected_provider(config):
390
+ base_url = config.get('base_url', '')
391
+ temp_client = NGPTClient(
392
+ api_key=config.get('api_key', ''),
393
+ base_url=base_url,
394
+ provider=config.get('provider', 'N/A'),
395
+ model=config.get('model', 'N/A')
396
+ )
397
+ detected = temp_client._detect_provider_from_url(base_url)
398
+ return detected if detected else config.get('provider', 'N/A')
399
+
388
400
  if args.all:
389
401
  # Show details for all configurations
390
402
  print("\nAll configuration details:")
391
403
  for i, cfg in enumerate(configs):
392
404
  active_str = '(Active)' if i == args.config_index else ''
405
+ detected_provider = get_detected_provider(cfg)
406
+ provider_str = f" [{detected_provider}]" if detected_provider else ""
407
+
393
408
  print(f"\n--- Configuration Index {i} {active_str} ---")
394
- print(f" API Key: {'[Set]' if cfg.get('api_key') else '[Not Set]'}")
409
+ print(f" API Key: {'[Set]' if cfg.get('api_key') else '[Not Set]'}{provider_str}")
395
410
  print(f" Base URL: {cfg.get('base_url', 'N/A')}")
396
411
  print(f" Provider: {cfg.get('provider', 'N/A')}")
397
412
  print(f" Model: {cfg.get('model', 'N/A')}")
398
413
  else:
399
414
  # Show active config details and summary list
415
+ detected_provider = get_detected_provider(active_config)
416
+ provider_str = f" [{detected_provider}]" if detected_provider else ""
417
+
400
418
  print("\nActive configuration details:")
401
- print(f" API Key: {'[Set]' if active_config.get('api_key') else '[Not Set]'}")
419
+ print(f" API Key: {'[Set]' if active_config.get('api_key') else '[Not Set]'}{provider_str}")
402
420
  print(f" Base URL: {active_config.get('base_url', 'N/A')}")
403
421
  print(f" Provider: {active_config.get('provider', 'N/A')}")
404
422
  print(f" Model: {active_config.get('model', 'N/A')}")
@@ -407,7 +425,9 @@ def main():
407
425
  print("\nAvailable configurations:")
408
426
  for i, cfg in enumerate(configs):
409
427
  active_marker = "*" if i == args.config_index else " "
410
- print(f"[{i}]{active_marker} {cfg.get('provider', 'N/A')} - {cfg.get('model', 'N/A')} ({'[API Key Set]' if cfg.get('api_key') else '[API Key Not Set]'})")
428
+ detected = get_detected_provider(cfg)
429
+ detected_str = f" [{detected}]" if detected else ""
430
+ print(f"[{i}]{active_marker} {cfg.get('provider', 'N/A')} - {cfg.get('model', 'N/A')} ({'[API Key Set]' if cfg.get('api_key') else '[API Key Not Set]'}{detected_str})")
411
431
 
412
432
  return
413
433
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngpt
3
- Version: 1.7.1
3
+ Version: 1.7.2
4
4
  Summary: A lightweight Python CLI and library for interacting with OpenAI-compatible APIs, supporting both official and self-hosted LLM endpoints.
5
5
  Project-URL: Homepage, https://github.com/nazdridoy/ngpt
6
6
  Project-URL: Repository, https://github.com/nazdridoy/ngpt
@@ -0,0 +1,9 @@
1
+ ngpt/__init__.py,sha256=ehInP9w0MZlS1vZ1g6Cm4YE1ftmgF72CnEddQ3Le9n4,368
2
+ ngpt/cli.py,sha256=Ba3B4VAs-fnuSdfo22dAe2vmSy3ADVZlKYiDGTy6C6I,29818
3
+ ngpt/client.py,sha256=qwAmBHSJvadbsvK5YPbY0By1M4bBvxd7j8piP5UdTgE,16553
4
+ ngpt/config.py,sha256=BF0G3QeiPma8l7EQyc37bR7LWZog7FHJQNe7uj9cr4w,6896
5
+ ngpt-1.7.2.dist-info/METADATA,sha256=uW2p_2ENm1OJLNW35nZcyDr_L0JvD5eeMrTvWGCPQmg,10568
6
+ ngpt-1.7.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ ngpt-1.7.2.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
8
+ ngpt-1.7.2.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
9
+ ngpt-1.7.2.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- ngpt/__init__.py,sha256=ehInP9w0MZlS1vZ1g6Cm4YE1ftmgF72CnEddQ3Le9n4,368
2
- ngpt/cli.py,sha256=AyIraZFq7icPot0moqPVJer72iqbtJxKBhy6VH-dwAA,28746
3
- ngpt/client.py,sha256=qwAmBHSJvadbsvK5YPbY0By1M4bBvxd7j8piP5UdTgE,16553
4
- ngpt/config.py,sha256=BF0G3QeiPma8l7EQyc37bR7LWZog7FHJQNe7uj9cr4w,6896
5
- ngpt-1.7.1.dist-info/METADATA,sha256=ffoVoKaC58f-SKImuqxLfGOv9Umlpmou82aCFWpsfIM,10568
6
- ngpt-1.7.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- ngpt-1.7.1.dist-info/entry_points.txt,sha256=1cnAMujyy34DlOahrJg19lePSnb08bLbkUs_kVerqdk,39
8
- ngpt-1.7.1.dist-info/licenses/LICENSE,sha256=mQkpWoADxbHqE0HRefYLJdm7OpdrXBr3vNv5bZ8w72M,1065
9
- ngpt-1.7.1.dist-info/RECORD,,
File without changes