-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following PR #1253, I think ergonomics of the `generate` function of `ChatModule` can be improved (given it's an important public-facing API). This PR simplifies the function's usage by implementing the `From` trait for the `Prompt` enum. Also updated the example code. Now the interface changes to: ```rust /// Single prompt case: cm.generate("what is the meaning of life?", None) /// Multiple prompt case: let messages: Vec<ChatMessage> = vec![message1, message2, message3]; let output = cm.generate(messages, None).unwrap(); ```
- Loading branch information
Showing
2 changed files
with
26 additions
and
14 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