Skip to contents

extract_snippets makes it easy to extract snippets in generated answers from the LLM

Usage

extract_snippets(text)

Arguments

text

the text to extract snippets from.

Details

This function makes it easy to extract snippets in generated answers from the LLM

Examples

llm_answer <- "This is a simple function in r:
```
yo <- function(message) {
print(message)
}
```
Enjoy this function!"

extracted_function <- llm_answer |> extract_snippets()