Created
January 20, 2026 14:16
-
-
Save thisisnic/eae09dbd4594e2cff75d156a8bab3f59 to your computer and use it in GitHub Desktop.
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(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