Skip to content

Instantly share code, notes, and snippets.

@simonpcouch
Created December 1, 2025 19:47
Show Gist options
  • Select an option

  • Save simonpcouch/9789f064659237200149fe06ced8e0af to your computer and use it in GitHub Desktop.

Select an option

Save simonpcouch/9789f064659237200149fe06ced8e0af to your computer and use it in GitHub Desktop.
An example using `content_image_*()` functions in LLM evaluations with vitals
library(ellmer)
library(vitals)
vitals_log_dir_set(tempdir())
dataset <- data.frame(
input = "Briefly, what does this image show?",
target = "The image shows a christmas village scene."
)
image_solver <- function(inputs, solver_chat = chat_claude()) {
ch <- solver_chat$clone()
ch$chat(
inputs[1],
content_image_url(
"https://cdn.shopify.com/s/files/1/0552/1506/3237/files/create_your_very_own_christmas_village_scene_1200x600_636aa14a-28ad-4f0d-b8d4-c6c5275c5e06.jpg?v=1648812029"
)
)
list(
result = ch$last_turn()@text,
solver_chat = list(ch)
)
}
tsk <- Task$new(
dataset = dataset,
solver = image_solver,
scorer = model_graded_qa(),
name = "christmas_scene"
)
tsk$eval()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment