tjarkvandemerwe / tidyprompt

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

prompt wraps resolve in same order as created/added #42

Closed tjarkvandemerwe closed 4 days ago

tjarkvandemerwe commented 1 week ago

In following scenario:

|> prompt_wrap( modify_fn = function(x) { paste( x, "\n\n", "If you think that there is no table that could answer the question, \n", "please respond with only the text 'NONE' (and use no other words)." ) }, extraction_fn = function(input_string) { if (any(str_detect(input_string, "NONE"))) { return("NONE") } return(input_string) } ) |> answer_as_list()

answer_as_list is evaluated before the custom wrap.