
Ask the best available LLM provider, accepting a multi-turn messages list
Source:R/llm.R
morie_llm_ask_multi.RdR port of morie.llm.ask_multi. Unlike :func:morie_llm_ask, this
accepts a pre-built messages list (each element: role/content)
enabling multi-turn conversation. Streaming is not supported in the R
port – this always returns a single character scalar.
Details
Provider fall-through order mirrors :func:morie_llm_detect_provider:
ollama -> gemini -> api -> openai -> local.
Examples
# \donttest{
old <- options(morie.llm.ollama_cached = FALSE)
msgs <- list(list(role = "user", content = "hello"))
out <- try(morie_llm_ask_multi(msgs))
print(out)
#> [1] "MORIE is running in local-only mode (no LLM provider detected).\n\nAvailable capabilities without an LLM:\n - morie list-modules List analysis modules\n - morie run-module <name> Run a specific module\n - morie pipeline --all -y Run the full analysis pipeline\n\nEnable an LLM by setting one of GEMINI_API_KEY, LLM_API_BASE_URL + LLM_API_KEY, or OPENAI_API_KEY, or by running a local Ollama instance."
options(old)
# }