Summarise or condense long text before scoring (opt-in, mutates input)
Source:R/llm.R
syn_llm_condense.RdFor 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.
See also
Other assist functions:
syn_export_video(),
syn_interpret(),
syn_py_features(),
syn_suggest()
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)
} # }