From eb3c7af5e3b21db5aa3871ac53a3d4cacb4d251f Mon Sep 17 00:00:00 2001 From: Matt Warkentin Date: Sat, 31 May 2025 13:55:15 -0600 Subject: [PATCH 1/2] Minor default prompt fixes --- r/R/m-backend-prompt.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/r/R/m-backend-prompt.R b/r/R/m-backend-prompt.R index b238525..b0e09d3 100644 --- a/r/R/m-backend-prompt.R +++ b/r/R/m-backend-prompt.R @@ -21,7 +21,7 @@ m_backend_prompt.mall_llama3.2 <- function(backend, additional = "") { role = "user", content = glue(paste( "You are a helpful text extraction engine.", - "Extract the {col_labels} being referred to on the text.", + "Extract the {col_labels} being referred to in the text.", "I expect {no_labels} item{plural} exactly.", "No capitalization. No explanations.", "{text_multi}", @@ -81,7 +81,7 @@ m_backend_prompt.mall_session <- function(backend, additional = "") { role = "user", content = glue(paste( "You are a helpful summarization engine.", - "Your answer will contain no no capitalization and no explanations.", + "Your answer will contain no capitalization and no explanations.", "Return no more than {max_words} words.", "{additional}", "The answer is the summary of the following text:\n{{x}}" @@ -122,7 +122,7 @@ m_backend_prompt.mall_session <- function(backend, additional = "") { role = "user", content = glue(paste( "You are a helpful text extraction engine.", - "Extract the {col_labels} being referred to on the text.", + "Extract the {col_labels} being referred to in the text.", "I expect {no_labels} item{plural} exactly.", "No capitalization. No explanations.", "{text_multi}", @@ -152,7 +152,7 @@ m_backend_prompt.mall_session <- function(backend, additional = "") { role = "user", content = glue(paste( "You are a helpful text analysis engine.", - "Determine this is true ", + "Determine if this is true ", "'{what}'.", "No capitalization. No explanations.", "{additional}", From d6c42f1c8b3285c36cc37e48c70536bcf52816be Mon Sep 17 00:00:00 2001 From: Edgar Ruiz <77294576+edgararuiz@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:16:57 -0500 Subject: [PATCH 2/2] Updates snapshots --- r/tests/testthat/_snaps/llm-extract.md | 2 +- r/tests/testthat/_snaps/llm-summarize.md | 2 +- r/tests/testthat/_snaps/llm-verify.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/r/tests/testthat/_snaps/llm-extract.md b/r/tests/testthat/_snaps/llm-extract.md index 1ce3ad0..452e6f6 100644 --- a/r/tests/testthat/_snaps/llm-extract.md +++ b/r/tests/testthat/_snaps/llm-extract.md @@ -8,7 +8,7 @@ [1] "user" [[1]]$content - You are a helpful text extraction engine. Extract the product being referred to on the text. I expect 1 item exactly. No capitalization. No explanations. The answer is based on the following text: + You are a helpful text extraction engine. Extract the product being referred to in the text. I expect 1 item exactly. No capitalization. No explanations. The answer is based on the following text: {x} diff --git a/r/tests/testthat/_snaps/llm-summarize.md b/r/tests/testthat/_snaps/llm-summarize.md index b254919..a1b9aeb 100644 --- a/r/tests/testthat/_snaps/llm-summarize.md +++ b/r/tests/testthat/_snaps/llm-summarize.md @@ -26,7 +26,7 @@ 2 I regret buying this laptop. It is too slow and the keyboard is too noisy 3 Not sure how to feel about my new washing machine. Great color, but hard to figure .summary - 1 it's a great tv + 1 great tv with good features 2 laptop purchase was a mistake 3 having mixed feelings about it diff --git a/r/tests/testthat/_snaps/llm-verify.md b/r/tests/testthat/_snaps/llm-verify.md index b308dce..33910e0 100644 --- a/r/tests/testthat/_snaps/llm-verify.md +++ b/r/tests/testthat/_snaps/llm-verify.md @@ -3,7 +3,7 @@ Code llm_vec_verify("this is a test", "a test", preview = TRUE) Output - ollamar::chat(messages = list(list(role = "user", content = "You are a helpful text analysis engine. Determine this is true 'a test'. No capitalization. No explanations. The answer is based on the following text:\nthis is a test")), + ollamar::chat(messages = list(list(role = "user", content = "You are a helpful text analysis engine. Determine if this is true 'a test'. No capitalization. No explanations. The answer is based on the following text:\nthis is a test")), output = "text", model = "llama3.2", seed = 100) # Verify on Ollama works