From bce713fdc01c0dfb83cc7c990d3c3d74cef86ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20de=20Jesus=20Filho?= Date: Sat, 3 Aug 2024 08:18:31 -0300 Subject: [PATCH] =?UTF-8?q?Fix:=20melhora=20fun=C3=A7=C3=A3o=20gpt=5Fler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/gpt_ler.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/gpt_ler.R b/R/gpt_ler.R index a567dae..274127b 100644 --- a/R/gpt_ler.R +++ b/R/gpt_ler.R @@ -17,8 +17,10 @@ gpt_ler <- function (arquivos, colunas = NULL) purrr::map_dfr(arquivos, purrr::possibly(~{ nome_arquivo <- basename(.x) - - .x |> + .x |> + readLines() |> + stringr::str_subset("```", negate = T) |> + stringr::str_c(collapse = "\n") |> jsonlite::fromJSON() |> purrr::map_if(rlang::is_empty, \(x) NA_character_) |> as.data.frame() |>