clean_output: Clean Output From Code Responses

View source: R/clean_output.R

clean_outputR Documentation

Clean Output From Code Responses

Description

This function extracts the content from a given text string that is enclosed between the '“'' markers. It can be used to extract any kind of code or text content.

Usage

clean_output(text)

Arguments

text

A character string containing the code or text content with '“'' markers.

Value

A character string containing the extracted code or text content.

Author(s)

Ulrich Matter umatter@protonmail.com

Examples

code_text <- "```
example_code <- function(x) {
  return(x * 2)
}
```"
clean_output(code_text)

TheOpenAIR documentation built on April 27, 2023, 5:10 p.m.