Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b43a329
Fixes for ellmer 0.2.0
hadley May 16, 2025
73b6dbb
Merge pull request #108 from hadley/ellmer-0.2
maciekbanas May 19, 2025
df43dd9
Update renv and version.
maciekbanas May 19, 2025
6855f76
Try fix systemfonts error.
maciekbanas May 20, 2025
325bca1
Fix.
maciekbanas May 20, 2025
c217f88
Update.
maciekbanas May 20, 2025
9fb3c99
Fixes for textshaping.
maciekbanas May 20, 2025
cf59bb4
Install system libraries for ragg package.
maciekbanas May 20, 2025
56bb947
Fix cmd check jobs.
maciekbanas May 20, 2025
86ce228
Fix.
maciekbanas May 20, 2025
bf3df72
Try fix.
maciekbanas May 20, 2025
e68617a
Try fix stringi installation (force binary installation).
maciekbanas May 20, 2025
328d880
Try fix installing stringi package.
maciekbanas May 20, 2025
89414f4
Try fix.
maciekbanas May 20, 2025
77b8350
Downgrade stringi package.
maciekbanas May 20, 2025
76c4ef8
Try fix.
maciekbanas May 20, 2025
292c1ed
Update renv.
maciekbanas May 20, 2025
fbbafae
Try fix windows check job.
maciekbanas May 20, 2025
af94ace
Try fix windows job.
maciekbanas May 20, 2025
b91dcbc
Try fix.
maciekbanas May 20, 2025
fc3bd36
Try fix.
maciekbanas May 20, 2025
66574ba
Try fix.
maciekbanas May 20, 2025
f4b0468
Try fix.
maciekbanas May 20, 2025
00dfa3c
Try simplify workflow.
maciekbanas May 20, 2025
ee5c3f2
Update Readme.
maciekbanas May 20, 2025
0606dbe
Add NEWS.md
maciekbanas May 20, 2025
6b3114d
Remove warnings, skip one test on CRAN.
maciekbanas May 20, 2025
a23944e
Update docs.
maciekbanas May 20, 2025
ec07b89
updated NEWS
kalimu May 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
config:
- {os: macos-latest, r: 'release'}
#- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
Expand All @@ -28,7 +28,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -38,12 +38,12 @@ jobs:
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2

- name: Install extra R dependencies
run: |
Rscript -e 'renv::install("rcmdcheck")'
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
21 changes: 19 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,28 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository universe
sudo apt-get update && sudo apt-get install -y \
libfontconfig1-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libharfbuzz-dev \
libfribidi-dev \
pkg-config

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2
- name: Restore R dependencies with renv
uses: r-lib/actions/setup-renv@v2

- name: Install extra R dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: GitAI
Title: Extracts Knowledge from 'Git' Repositories
Version: 0.1.0
Version: 0.1.1
Authors@R: c(
person("Kamil", "Wais", , "kamil.wais@gmail.com", role = c("aut", "cre")),
person("Krystian", "Igras", , "krystian8207@gmail.com", role = "aut"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# GitAI 0.1.1

* Fixed tests to make them work with `ellmer` 0.2.0.
* Added a `NEWS.md` file to track changes to the package.
4 changes: 2 additions & 2 deletions R/set_llm.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ set_llm <- function(gitai, provider = "openai", ...) {
}

llm_default_args <- list(
openai = list(model = "gpt-4o-mini", seed = NULL, echo = "none"),
ollama = list(model = "llama3.2", seed = NULL),
openai = list(model = "gpt-4o-mini", params = NULL, echo = "none"),
ollama = list(model = "llama3.2", params = NULL),
bedrock = list(model = "anthropic.claude-3-5-sonnet-20240620-v1:0")
)

Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ knitr::opts_chunk$set(

<!-- badges: start -->
[![Codecov test coverage](https://codecov.io/gh/r-world-devs/GitAI/graph/badge.svg)](https://app.codecov.io/gh/r-world-devs/GitAI)
[![R-CMD-check](https://github.com/r-world-devs/GitAI/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-world-devs/GitAI/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

> The goal of `GitAI` is to **extract knowledge from Git repositories** with the use of AI/LLM (Large Language Models).
Expand Down Expand Up @@ -108,4 +109,4 @@ purrr::walk(results, function(result) {

Our `GitAI` uses under the hood the `GitStats` R package.
If you want to use it directly for pulling git data, check out:
[https://r-world-devs.github.io/GitStats/](https://r-world-devs.github.io/GitStats/)
[https://r-world-devs.github.io/GitStats/](https://r-world-devs.github.io/GitStats/)
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

[![Codecov test
coverage](https://codecov.io/gh/r-world-devs/GitAI/graph/badge.svg)](https://app.codecov.io/gh/r-world-devs/GitAI)
[![R-CMD-check](https://github.com/r-world-devs/GitAI/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-world-devs/GitAI/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

> The goal of `GitAI` is to **extract knowledge from Git repositories**
Expand Down Expand Up @@ -89,6 +90,13 @@ my_project <- initialize_project("fascinating_project") |>
add_files(files = "README.md") |>
set_llm() |>
set_prompt("Write one-sentence summary for a project based on given input.")
#> Warning: The `seed` argument of `chat_openai()` is deprecated as of ellmer 0.2.0.
#> ℹ Please use the `params` argument instead.
#> ℹ The deprecated feature was likely used in the GitAI package.
#> Please report the issue to the authors.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
```

Now, let’s get the results and print them.
Expand All @@ -99,18 +107,19 @@ results <- process_repos(my_project)
purrr::walk(results, function(result) {
result$text |> stringr::str_wrap(width = 80) |> cat("\n\n")
})
#> GitStats is an experimental R package that facilitates the extraction
#> and analysis of git data from GitHub and GitLab, providing insights into
#> repositories, commits, users, and R package usage in a structured format.
#> GitStats is an R package that allows users to uniformly extract and analyze
#> git data from GitHub and GitLab, including repositories, commits, issues, and
#> R package usage, enabling the generation of basic statistics and insights into
#> version control activities.
#>
#> GitAI is an R package that leverages AI and Large Language Models to extract
#> insights from GitHub or GitLab repositories, allowing users to define project
#> scopes, select relevant content, and process repositories efficiently in a
#> tidyverse-compliant manner.
#> `GitAI` is an R-based framework designed to harness AI and Large Language
#> Models for extracting and summarizing knowledge from multiple Git repositories
#> efficiently, addressing the challenges of manual review and knowledge
#> reusability in large organizations.
#>
#> DataFakeR is an R package that enables users to generate synthetic datasets
#> while maintaining specified assumptions about the original data structure,
#> facilitating data simulation for testing and analysis.
#> DataFakeR is an R package that enables users to generate realistic fake datasets
#> while preserving specific attributes and dependencies based on a configurable
#> schema, facilitating data simulation for testing and validation purposes.
```

## See also
Expand Down
2 changes: 1 addition & 1 deletion man/GitAI-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 16 additions & 15 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.4.1",
"Version": "4.4.3",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -42,13 +42,13 @@
},
"R6": {
"Package": "R6",
"Version": "2.6.0",
"Version": "2.6.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "245934b1f739076a00b61ee7d9cd5233"
"Hash": "d4335fe7207f1c01ab8c41762f5840d4"
},
"Rcpp": {
"Package": "Rcpp",
Expand Down Expand Up @@ -150,14 +150,14 @@
},
"cli": {
"Package": "cli",
"Version": "3.6.1",
"Version": "3.6.5",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "89e6d8219950eac806ae0c489052048a"
"Hash": "16850760556401a2eeb27d39bd11c9cb"
},
"commonmark": {
"Package": "commonmark",
Expand Down Expand Up @@ -201,13 +201,13 @@
},
"curl": {
"Package": "curl",
"Version": "6.2.0",
"Version": "6.2.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "b580cbb010099fd990df6bfe44459e1a"
"Hash": "e4f9e10b18f453a1b7eaf38247dad4fe"
},
"desc": {
"Package": "desc",
Expand Down Expand Up @@ -293,10 +293,11 @@
},
"ellmer": {
"Package": "ellmer",
"Version": "0.1.1",
"Version": "0.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"R6",
"S7",
"cli",
Expand All @@ -309,7 +310,7 @@
"promises",
"rlang"
],
"Hash": "754d3a8cbb25b05be2058892f579422f"
"Hash": "08f7504cda76185e0f689b19357706e0"
},
"evaluate": {
"Package": "evaluate",
Expand Down Expand Up @@ -429,7 +430,7 @@
},
"httr2": {
"Package": "httr2",
"Version": "1.1.0",
"Version": "1.1.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -446,7 +447,7 @@
"vctrs",
"withr"
],
"Hash": "0f14199bbd820a9fca398f2df40994f1"
"Hash": "ade531519694081d91036b509eb30594"
},
"jquerylib": {
"Package": "jquerylib",
Expand Down Expand Up @@ -775,14 +776,14 @@
},
"rlang": {
"Package": "rlang",
"Version": "1.1.5",
"Version": "1.1.6",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "724dcc1490cd7071ee75ca2994a5446e"
"Hash": "892124978869b74935dc3934c42bfe5a"
},
"rmarkdown": {
"Package": "rmarkdown",
Expand Down Expand Up @@ -921,7 +922,7 @@
},
"stringi": {
"Package": "stringi",
"Version": "1.8.4",
"Version": "1.8.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
Expand All @@ -930,7 +931,7 @@
"tools",
"utils"
],
"Hash": "39e1144fd75428983dc3f63aa53dfa91"
"Hash": "2b56088e23bdd58f89aebf43a0913457"
},
"stringr": {
"Package": "stringr",
Expand Down
12 changes: 8 additions & 4 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ mock_chat_method <- function(turns = NULL,
provider_class) {

provider_args <- rlang::dots_list(...)
provider <- rlang::exec(provider_class, !!!provider_args)
provider <- rlang::exec(provider_class, name = "mock", !!!provider_args)

ChatMocked$new(provider = provider, turns = turns, echo = echo)
chat <- ChatMocked$new(provider = provider, echo = echo)
chat$set_turns(turns)
chat
}

chat_openai_mocked <- function(system_prompt = NULL,
Expand All @@ -32,23 +34,25 @@ chat_openai_mocked <- function(system_prompt = NULL,
api_key = "mocked_key",
model = NULL,
seed = NULL,
params = NULL,
api_args = list(),
echo = c("none", "text", "all")) {

turns <- ellmer:::normalize_turns(turns, system_prompt)
model <- ellmer:::set_default(model, "gpt-4o")
echo <- ellmer:::check_echo(echo)

params <- params %||% ellmer::params()
if (is.null(seed)) {
seed <- 1014
params$seed <- 1014
}

mock_chat_method(
turns = turns,
echo = echo,
base_url = base_url,
model = model,
seed = seed,
params = params,
extra_args = api_args,
api_key = api_key,
provider_class = ellmer:::ProviderOpenAI
Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-process_content.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ test_that("processing content have proper output structure", {
})

test_that("processing a single file content with deterministic output", {

skip_on_cran()
skip_if_not(interactive())
params <- ellmer::params(seed = 1014)
my_project <- initialize_project("gitai_test_project") |>
set_llm(seed = 1014, api_args = list(temperature = 0)) |>
set_llm(params = params, api_args = list(temperature = 0)) |>
set_prompt(system_prompt = "Summarize provided conent with one, short sentence.")

test_content <- r"(
Artificial intelligence (AI) plays a crucial role in transforming industries
by automating repetitive tasks and enhancing productivity. It enables personalized experiences
Expand Down
Loading