mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-05 06:10:28 -04:00
idxtool: show GPTs count in the TOC generator
This commit is contained in:
parent
292e2442b2
commit
1168d2802b
1 changed files with 6 additions and 2 deletions
|
@ -109,12 +109,16 @@ def rebuild_toc(toc_out: str = '') -> Tuple[bool, str]:
|
|||
except:
|
||||
return (False, f"Failed to open '{toc_out}' for writing.")
|
||||
|
||||
# Count GPTs
|
||||
enumerated_gpts = list(enum_gpts())
|
||||
ok_count = sum(1 for ok, _ in enumerated_gpts if ok)
|
||||
|
||||
# Write the marker line and each GPT entry
|
||||
out.append(f"{TOC_GPT_MARKER_LINE}\n")
|
||||
out.append(f"{TOC_GPT_MARKER_LINE} ({ok_count} total)\n")
|
||||
|
||||
nb_ok = nb_total = 0
|
||||
gpts = []
|
||||
for ok, gpt in enum_gpts():
|
||||
for ok, gpt in enumerated_gpts:
|
||||
nb_total += 1
|
||||
if ok:
|
||||
if gpt_id := gpt.id():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue