Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for TypeError in llm templates list when template contains empty prompt #132

Merged

Conversation

sherwind
Copy link
Contributor

A TypeError is getting triggered when running the command llm templates list if a template contains an empty prompt.

To reproduce the issue, quickly close the editor after using the llm templates edit new-prompt-name command.

For reference, here's a snippet of the traceback:

  File ".../lib/python3.9/site-packages/llm/cli.py", line 545, in templates_list
    pairs.append((name, "".join(text).replace("\n", " ")))
TypeError: sequence item 0: expected str instance, NoneType found

@simonw
Copy link
Owner

simonw commented Jul 26, 2023

Thanks, useful fix.

@simonw simonw merged commit 531d188 into simonw:main Jul 26, 2023
simonw added a commit that referenced this pull request Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants