knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
There are two ways to use ellmer chat models for batch processing. This flexibility allows you to 1) pass a chat model object or 2) pass a function. The chat object method is more flexible because the object can be reused.
The first method is to pass a chat model object. This is useful when you want to reuse an existing model configuration:
library(hellmer) openai <- chat_openai( model = "o3-mini", system_prompt = "Reply concisely, one sentence" ) chat <- chat_sequential(openai)
The second method is to pass an ellmer chat model function directly. This method may be preferred if you only need to use a model once or aesthetically prefer not to nest functions. There is not any great reason to use this method, but it's available for backward compatibility.
chat <- chat_sequential( chat_openai, model = "o3-mini", system_prompt = "Reply concisely, one sentence" )
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.