Skip to content

Instantly share code, notes, and snippets.

@thisisnic
Created January 20, 2026 14:16
Show Gist options
  • Select an option

  • Save thisisnic/eae09dbd4594e2cff75d156a8bab3f59 to your computer and use it in GitHub Desktop.

Select an option

Save thisisnic/eae09dbd4594e2cff75d156a8bab3f59 to your computer and use it in GitHub Desktop.
library(ellmer)
library(rvest)
get_ellmer_news <- function() {
read_html("https://ellmer.tidyverse.org/news/index.html") |>
html_element("div.section") |>
html_text2() |>
substr(1, 3000) # Keep it manageable
}
# Turn it into a tool
news_tool <- tool(
get_ellmer_news,
description = "Get the latest feature updates from the ellmer package"
)
# Register and use it
chat <- chat_anthropic(system_prompt = "You are a terse but friendly assistant")
chat$register_tool(news_tool)
chat$chat("What are the 3 most interesting new features in ellmer?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment