You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an error when attempting to create a tool definition for the get_pums function from the tidycensus package using the create_tool_def function from ellmer.
Reproduction steps:
Load the tidycensus and ellmer libraries:
library(tidycensus)
library(ellmer)
Create a chat_gemini object:
chat<- chat_gemini("gemini-2.0-flash")
Attempt to create a tool definition for get_pums:
create_tool_def(get_pums, chat)
Expected behavior:
I expected create_tool_def to successfully generate a tool definition for the get_pums function, allowing it to be used within the ellmer framework.
Actual behavior:
Instead of creating the tool definition, the code produced the following response/error:
tool(
tidycensus::get_pums,
"Load data from the American Community Survey Public Use Microdata Series API",
variables= type_array(
"A vector of variables from the PUMS API. Use `View(pums_variables)` to browse variable options.",
items= type_string()
),
state= type_string(
"A state, or vector of states, for which you would like to request data. The entire US can be requested with `state = \"all\"` - though be patient with the data download!",
required=FALSE# TODO: could also be a vector, unclear how to Error in merge_func(left, right, path) : is.list(left) is not TRUEErrorduringwrapup:'S4SXP':shouldnothappen-pleasereportError:nomoreerrorhandlers available (recursiveerrors?); invoking'abort'restart
Additional Information:
I've tried create_tool_def with other functions (e.g. sum) and it seems to work, so it seems to be related to something specific about the tidycensus::get_pums function.
The text was updated successfully, but these errors were encountered:
Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you! If you've never heard of a reprex before, start by reading about the reprex package, including the advice further down the page. Please make sure your reprex is created with the reprex package as it gives nicely formatted output and avoids a number of common pitfalls.
I encountered an error when attempting to create a tool definition for the
get_pums
function from thetidycensus
package using thecreate_tool_def
function fromellmer
.Reproduction steps:
Load the
tidycensus
andellmer
libraries:Create a
chat_gemini
object:Attempt to create a tool definition for
get_pums
:Expected behavior:
I expected
create_tool_def
to successfully generate a tool definition for theget_pums
function, allowing it to be used within theellmer
framework.Actual behavior:
Instead of creating the tool definition, the code produced the following response/error:
Additional Information:
The text was updated successfully, but these errors were encountered: