feat(prompts): The first argument of add_few_shot
should be an input model, not a string
#60
Milestone
add_few_shot
should be an input model, not a string
#60
Currently
add_few_shots
takes two strings - an arbitrary user message and an arbitrary assistant response to the message.Instead, the first argument should be of type
InputT
(i.e., the should be an instance of the pythantic model used to render the prompts). The user message should be then automatically rendered using the user message defined in the prompt class (MyPrompt.user_message
) and the input data given as the argument toadd_few_shots
. This will ensure that the user prompt given in the few-shot examples and the final user prompt are synchronized.Additionally, the
add_few_shots
might be able to take both instances ofInputT
and raw strings - it would use strings directly but when given instances ofInputT
it would first compile them to strings.For example, given this pydantic model and prompt:
instead of writing this:
you would write:
(Note that in reality the prompts might be much longer and more complicated and the values my come from external source like a database)
The text was updated successfully, but these errors were encountered: