Skip to content

Separate package listing tool into multiple functions #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 of 4 tasks
gadenbuie opened this issue Mar 24, 2025 · 0 comments
Open
3 of 4 tasks

Separate package listing tool into multiple functions #30

gadenbuie opened this issue Mar 24, 2025 · 0 comments

Comments

@gadenbuie
Copy link
Collaborator

gadenbuie commented Mar 24, 2025

I'm getting the sense that listing all installed packages is a high token count, low quality answer.

btw::btw_tool_get_installed_packages() |>
  rtiktoken::get_token_count("gpt-4o") |>
  sum()
#> [1] 12254

Even just using CSV formatting would reduce the token count (but I have ~600 something packages installed):

installed.packages(fields = c("Package", "Title")) |>
  dplyr::as_tibble() |>
  (\(x) x[, c("Package", "Title")])() |>
  readr::write_csv(file = stdout()) |>
  capture.output() |>
  paste(collapse = "\n") |>
  rtiktoken::get_token_count("gpt-4o")
#> [1] 8126

There's certainly a place for this kind of tool, but in practice I think it'd be better to have a few variants of the same kind of tool:

  1. Is _____ installed and available on this system?
  2. Search installed packages for a package to achieve task X.
  3. Verify installed version of a specific package and its dependencies.
  4. Which packages are being used in this project/right now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant