diff --git a/DESCRIPTION b/DESCRIPTION index fe65c7e..3243cf3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: GitAI Title: Extracts Knowledge From Git Repositories -Version: 0.0.0.9017 +Version: 0.0.0.9018 Authors@R: c( person("Kamil", "Wais", , "kamil.wais@gmail.com", role = c("aut", "cre")), person("Krystian", "Igras", , "krystian8207@gmail.com", role = "aut"), diff --git a/R/GitAI.R b/R/GitAI.R index 8ec23db..5fef886 100644 --- a/R/GitAI.R +++ b/R/GitAI.R @@ -4,6 +4,14 @@ GitAI <- R6::R6Class( initialize = function(project_id) { private$.project_id <- project_id + }, + + print = function() { + cat(cli::style_bold("A ", cli::col_yellow("GitAI"), " object: \n")) + private$print_project_id() + private$print_files() + private$print_llm_data() + private$print_db_data() } ), @@ -56,6 +64,37 @@ GitAI <- R6::R6Class( .gitstats = NULL, .files = NULL, .repos_metadata = NULL, - .files_content = NULL + .files_content = NULL, + + print_project_id = function() { + cat(cli::col_br_yellow("Project ID:"), private$.project_id, "\n") + }, + + print_files = function() { + if (is.null(private$.files)) { + cat(cli::col_br_yellow("Files:"), cli::col_grey("not added"), "\n") + } else { + cat(cli::col_br_yellow("Files:"), + paste0(private$.files, collapse = ", ") + , "\n") + } + }, + + print_llm_data = function() { + if (is.null(private$.llm)) { + cat(cli::col_br_yellow("LLM:"), cli::col_grey("not set"), "\n") + } else { + cat(cli::col_br_yellow("LLM:"), "set", "\n") + } + }, + + print_db_data = function() { + if (is.null(private$.db)) { + cat(cli::col_br_yellow("Database:"), cli::col_grey("not set"), "\n") + } else { + browser() + cat(cli::col_br_yellow("Database:"), "set", "\n") + } + } ) )