-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle if a user instantiates a prompt with just text (#107)
It isn't an uncommon occurrence to have users instantiate a Prompt with just a string. Since this is also how our API works, I don't blame them. But when they do, every character becomes a text item, which causes weird behavior with our tokenization and prompt optmizations. This handles the case where a user does this, and serializes it correctly. While it would be nice to have stricter types, I think unless every user used mypy, the type hints still wouldn't alleviate the confusion.
- Loading branch information
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters