
POST a chat-completion request to an OpenAI-compatible endpoint
Source:R/llm.R
morie_llm_request_completion.RdPOST a chat-completion request to an OpenAI-compatible endpoint
Examples
if (requireNamespace("httr2", quietly = TRUE)) {
# \donttest{
msgs <- list(list(role = "user", content = "Say hello"))
# Second arg is whatever model your Ollama server serves (see `ollama list`).
res <- try(morie_llm_request_completion("http://localhost:11434", "your-model", msgs))
# }
}
#> Error : http://localhost:11434 did not answer ()