diff --git a/DESCRIPTION b/DESCRIPTION index 77337bd..b10be1e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: GitAI Title: Extracts Knowledge From Git Repositories -Version: 0.0.0.9002 +Version: 0.0.0.9003 Authors@R: c( person("Kamil", "Wais", , "kamil.wais@gmail.com", role = c("aut", "cre")), person("Maciej", "Banas", , "banasmaciek@gmail.com", role = "aut") diff --git a/NAMESPACE b/NAMESPACE index 6ae9268..5573ed6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,9 @@ # Generated by roxygen2: do not edit by hand +export(add_files) +export(initialize_project) +export(process_repos) +export(set_github_repos) +export(set_gitlab_repos) +export(set_llm) +export(set_prompt) diff --git a/R/add_files.R b/R/add_files.R index a9cb468..10928ab 100644 --- a/R/add_files.R +++ b/R/add_files.R @@ -1,6 +1,9 @@ +#' Add files to `GitAI` object. #' @name add_files +#' @param gitai A \code{GitAI} object. #' @param files A character vector of file paths. May be defined with #' regular expression. +#' @return A \code{GitAI} object. #' @export add_files <- function(gitai, files) { if (!is.null(files)) { diff --git a/R/initialize_project.R b/R/initialize_project.R index d58bfab..049ff63 100644 --- a/R/initialize_project.R +++ b/R/initialize_project.R @@ -1,4 +1,7 @@ -#' export +#' Initialize a `GitAI` project. +#' @param project_id A character, ID of the project. +#' @return A \code{GitAI} object. +#' @export initialize_project <- function(project_id) { GitAI$new(project_id = project_id) diff --git a/R/process_repos.R b/R/process_repos.R index 531413a..26cbe7a 100644 --- a/R/process_repos.R +++ b/R/process_repos.R @@ -1,8 +1,8 @@ +#' Run LLM on `GitAI` repositories content #' @name process_repos -#' @param gitai A GitAI object. -#' +#' @param gitai A \code{GitAI} object. +#' @return A list. #' @export - process_repos <- function(gitai) { gitstats <- gitai$gitstats diff --git a/R/set_llm.R b/R/set_llm.R index 437c4e9..21ddff5 100644 --- a/R/set_llm.R +++ b/R/set_llm.R @@ -1,10 +1,17 @@ -#' export -set_llm <- function(gitai, +#' Set Large Language Model in `GitAI` object. +#' @name set_llm +#' @param gitai A \code{GitAI} object. +#' @param provider A LLM provider. +#' @param model A LLM model. +#' @param seed An integer to make results more reproducible. +#' @return A \code{GitAI} object. +#' @export +set_llm <- function(gitai, provider = "openai", model = "gpt-4o-mini", seed = NULL, ...) { - + if (provider == "openai") { gitai$llm <- elmer::chat_openai( @@ -18,9 +25,14 @@ set_llm <- function(gitai, invisible(gitai) } -#' export +#' Set prompt. +#' @name set_prompt +#' @param gitati A \code{GitAI} object. +#' @param system_prompt A system prompt. +#' @return A \code{GitAI} object. +#' @export set_prompt <- function(gitai, system_prompt) { gitai$system_prompt <- system_prompt invisible(gitai) -} \ No newline at end of file +} diff --git a/R/set_repos.R b/R/set_repos.R index 0b0f823..4e8d71d 100644 --- a/R/set_repos.R +++ b/R/set_repos.R @@ -1,7 +1,9 @@ +#' Set GitHub repositories in `GitAI` object. #' @name set_github_repos -#' @param gitai A GitAI object. +#' @param gitai A \code{GitAI} object. #' @param host A character, GitHub host. #' @param repos A character vector or repositories full names. +#' @return A \code{GitAI} object. #' @export set_github_repos <- function(gitai, host = NULL, @@ -20,10 +22,12 @@ set_github_repos <- function(gitai, invisible(gitai) } +#' Set GitLab repositories in `GitAI` object. #' @name set_gitlab_repos -#' @param gitai A GitAI object. +#' @param gitai A \code{GitAI} object. #' @param host A character, GitLab host. #' @param repos A character vector or repositories full names. +#' @return A \code{GitAI} object. #' @export set_gitlab_repos <- function(gitai, host = NULL, diff --git a/man/add_files.Rd b/man/add_files.Rd new file mode 100644 index 0000000..a769de5 --- /dev/null +++ b/man/add_files.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/add_files.R +\name{add_files} +\alias{add_files} +\title{Add files to \code{GitAI} object.} +\usage{ +add_files(gitai, files) +} +\arguments{ +\item{gitai}{A \code{GitAI} object.} + +\item{files}{A character vector of file paths. May be defined with +regular expression.} +} +\value{ +A \code{GitAI} object. +} +\description{ +Add files to \code{GitAI} object. +} diff --git a/man/initialize_project.Rd b/man/initialize_project.Rd index 50d5692..92b7a90 100644 --- a/man/initialize_project.Rd +++ b/man/initialize_project.Rd @@ -2,10 +2,16 @@ % Please edit documentation in R/initialize_project.R \name{initialize_project} \alias{initialize_project} -\title{export} +\title{Initialize a \code{GitAI} project.} \usage{ initialize_project(project_id) } +\arguments{ +\item{project_id}{A character, ID of the project.} +} +\value{ +A \code{GitAI} object. +} \description{ -export +Initialize a \code{GitAI} project. } diff --git a/man/process_repos.Rd b/man/process_repos.Rd new file mode 100644 index 0000000..e046de3 --- /dev/null +++ b/man/process_repos.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/process_repos.R +\name{process_repos} +\alias{process_repos} +\title{Run LLM on \code{GitAI} repositories content} +\usage{ +process_repos(gitai) +} +\arguments{ +\item{gitai}{A \code{GitAI} object.} +} +\value{ +A list. +} +\description{ +Run LLM on \code{GitAI} repositories content +} diff --git a/man/set_github_repos.Rd b/man/set_github_repos.Rd new file mode 100644 index 0000000..f953822 --- /dev/null +++ b/man/set_github_repos.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/set_repos.R +\name{set_github_repos} +\alias{set_github_repos} +\title{Set GitHub repositories in \code{GitAI} object.} +\usage{ +set_github_repos(gitai, host = NULL, repos) +} +\arguments{ +\item{gitai}{A \code{GitAI} object.} + +\item{host}{A character, GitHub host.} + +\item{repos}{A character vector or repositories full names.} +} +\value{ +A \code{GitAI} object. +} +\description{ +Set GitHub repositories in \code{GitAI} object. +} diff --git a/man/set_gitlab_repos.Rd b/man/set_gitlab_repos.Rd new file mode 100644 index 0000000..70740c4 --- /dev/null +++ b/man/set_gitlab_repos.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/set_repos.R +\name{set_gitlab_repos} +\alias{set_gitlab_repos} +\title{Set GitLab repositories in \code{GitAI} object.} +\usage{ +set_gitlab_repos(gitai, host = NULL, repos) +} +\arguments{ +\item{gitai}{A \code{GitAI} object.} + +\item{host}{A character, GitLab host.} + +\item{repos}{A character vector or repositories full names.} +} +\value{ +A \code{GitAI} object. +} +\description{ +Set GitLab repositories in \code{GitAI} object. +} diff --git a/man/set_llm.Rd b/man/set_llm.Rd index dbd297f..7a1597e 100644 --- a/man/set_llm.Rd +++ b/man/set_llm.Rd @@ -2,10 +2,22 @@ % Please edit documentation in R/set_llm.R \name{set_llm} \alias{set_llm} -\title{export} +\title{Set Large Language Model in \code{GitAI} object.} \usage{ -set_llm(gitai, provider = "openai", model = "gpt-4o-mini") +set_llm(gitai, provider = "openai", model = "gpt-4o-mini", seed = NULL, ...) +} +\arguments{ +\item{gitai}{A \code{GitAI} object.} + +\item{provider}{A LLM provider.} + +\item{model}{A LLM model.} + +\item{seed}{An integer to make results more reproducible.} +} +\value{ +A \code{GitAI} object. } \description{ -export +Set Large Language Model in \code{GitAI} object. } diff --git a/man/set_prompt.Rd b/man/set_prompt.Rd index 5bcf2f3..95dc4db 100644 --- a/man/set_prompt.Rd +++ b/man/set_prompt.Rd @@ -2,10 +2,18 @@ % Please edit documentation in R/set_llm.R \name{set_prompt} \alias{set_prompt} -\title{export} +\title{Set prompt.} \usage{ set_prompt(gitai, system_prompt) } +\arguments{ +\item{system_prompt}{A system prompt.} + +\item{gitati}{A \code{GitAI} object.} +} +\value{ +A \code{GitAI} object. +} \description{ -export +Set prompt. }