View source: R/helper_other_extract_from_return_list.R
extract_from_return_list | R Documentation |
This function is intended as a helper function for piping with output from
send_prompt()
when using return_mode = "full"
. It allows to
extract a specific element from the list returned by send_prompt()
, which
can be useful for further piping.
extract_from_return_list(list, name_of_element = "response")
list |
A list, typically the output from |
name_of_element |
A character string with the name of the element to extract from the list |
The extracted element from the list
## Not run:
response <- "Hi!" |>
send_prompt(llm_provider_ollama(), return_mode = "full") |>
extract_from_return_list("response")
response
# [1] "It's nice to meet you. Is there something I can help you with,
# or would you like to chat?"
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.