Skip to contents

For very long inputs, condense to a representative passage using a local LLM before syn_score(). Opt-in because it changes the text being analysed.

Usage

syn_llm_condense(
  text,
  model = .DEFAULT_LLM_MODEL,
  ...,
  call = rlang::caller_env()
)

Arguments

text

A tibble from syn_read_text().

model

Model name. Default "mistral-small".

...

Passed to the underlying ellmer chat call.

call

The calling environment, for error reporting. Experts only.

Value

A tibble in the same shape as syn_read_text() output. Requires ellmer + a reachable backend.

Examples

if (FALSE) { # \dontrun{
# Not run: needs the ellmer package and a running local Ollama server
# with the model available.
text <- syn_read_text(syn_example_text("de"), lang = "de")
syn_llm_condense(text)
} # }