tjarkvandemerwe / tidyprompt

Create LLM prompting pipelines
https://tjarkvandemerwe.github.io/tidyprompt/
Other
3 stars 1 forks source link

prompt_wrap appends? #13

Closed tjarkvandemerwe closed 1 month ago

tjarkvandemerwe commented 1 month ago

Can we give the prompt_wrap function a prompt as first argument, and do the appending as well? So instead of when creating a wrapper function you end with this:

new_wrap <- prompt_wrap(
    modify_fn = modify_fn
  )
append_prompt_wrap(prompt, new_wrap)

You end with: prompt_wrap(prompt, modify_fn)

This means you can also create wrappers in a pipeline:

"hi" |>
  prompt_wrap(\(x) paste(x, "there"))
lukakoning commented 1 month ago

Agreed