From ea753e0734bf6a517e07ab8475c0a5454f1f8fa0 Mon Sep 17 00:00:00 2001 From: laresbernardo Date: Thu, 12 Sep 2024 11:18:24 +0200 Subject: [PATCH] fix: cache of OpenAI's reply stored in JSON format --- DESCRIPTION | 2 +- R/chatgpt.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 16b726461..80ce45a98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: lares Type: Package Title: Analytics & Machine Learning Sidekick -Version: 5.2.8.9005 +Version: 5.2.8.9006 Authors@R: c( person("Bernardo", "Lares", , "laresbernardo@gmail.com", c("aut", "cre"))) Maintainer: Bernardo Lares diff --git a/R/chatgpt.R b/R/chatgpt.R index 85bfe8e10..bb807e2e7 100644 --- a/R/chatgpt.R +++ b/R/chatgpt.R @@ -130,7 +130,7 @@ gpt_ask <- function(ask, # Save historical answers cache <- bind_rows( - data.frame(ts = ts, reply = ret), + data.frame(ts = ts, reply = toJSON(ret)), cache_read("GPT_HIST_REPLY", quiet = TRUE, ...) ) %>% as_tibble()