Created
December 1, 2025 19:47
-
-
Save simonpcouch/9789f064659237200149fe06ced8e0af to your computer and use it in GitHub Desktop.
An example using `content_image_*()` functions in LLM evaluations with vitals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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