mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-05 14:20:33 -04:00
fixed sorting: it was not taking the version into consideration
This commit is contained in:
parent
aad2c66b97
commit
994cc65a1e
1 changed files with 6 additions and 1 deletions
|
@ -116,7 +116,12 @@ def rebuild_toc(toc_out: str = '') -> Tuple[bool, str]:
|
|||
print(f"[!] {gpt}")
|
||||
|
||||
# Consistently sort the GPTs by ID and GPTs title
|
||||
gpts.sort(key=lambda x: (x[0].id, x[1].get('title')))
|
||||
def gpts_sorter(key):
|
||||
gpt_id, gpt = key
|
||||
version = f"{gpt.get('version')}" if gpt.get('version') else ''
|
||||
return f"{gpt.get('title')}{version} (id: {gpt_id.id}))"
|
||||
gpts.sort(key=gpts_sorter)
|
||||
|
||||
for id, gpt in gpts:
|
||||
file_link = f"./prompts/gpts/{quote(os.path.basename(gpt.filename))}"
|
||||
version = f" {gpt.get('version')}" if gpt.get('version') else ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue