-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
lf.call
to accept both str
and lf.Template
(also `lf.Lang…
…Func`) object as prompt. Usage: ```python # Call with constant string-type prompt. lf.call('Compute one plus one', lm=lf.llms.Gpt35()) >> "two" # Call with returning a structured (int) type. lf.call('Compute one plus one', int, lm=lf.llms.Gpt35()) >> 2 # Call with a template string with variables. lf.call('Compute {{x}} plus {{y}}', int, x='one', y='one', lm=lf.llms.Gpt35()) >> 2 # Call with an `lf.Template` object with variables. lf.call(lf.Template('Compute {{x}} plus {{y}}', x=1), y=1, lm=lf.llms.Gpt35()) >> 2 ``` PiperOrigin-RevId: 570096116
- Loading branch information
Showing
3 changed files
with
79 additions
and
10 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
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