Package 'GitAI'

Title: Extracts Knowledge from 'Git' Repositories
Description: Scan multiple 'Git' repositories, pull specified files content and process it with large language models. You can summarize the content in specific way, extract information and data, or find answers to your questions about the repositories. The output can be stored in vector database and used for semantic search or as a part of a RAG (Retrieval Augmented Generation) prompt.
Authors: Kamil Wais [aut, cre], Krystian Igras [aut], Maciej Banas [aut]
Maintainer: Kamil Wais <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-02-21 04:44:36 UTC
Source: https://github.com/cran/GitAI

Help Index


Derive knowledge from GitHub or GitLab repositories with the use of AI/LLM

Description

logo

Scan multiple Git repositories, pull specified files content and process it with Large Language Models. You can summarize the content in specific way, extract information and data, or find answers to your questions about the repositories. The output can be stored in vector database and used for semantic search or as a part of a RAG (Retrieval Augmented Generation) prompt.

Author(s)

Maintainer: Kamil Wais [email protected]

Authors:


Add files to GitAI object.

Description

Add files to GitAI object.

Usage

add_files(gitai, files)

Arguments

gitai

A GitAI object.

files

A character vector of file paths. May be defined with regular expression.

Value

A GitAI object.


Finding top K records in a vector database.

Description

Finding top K records in a vector database.

Usage

find_records(gitai, query, top_k = 1, verbose = is_verbose())

Arguments

gitai

A GitAI object.

query

A character, user query.

top_k

A numeric, number of top K records to return.

verbose

A logical. If FALSE you won't be getting additional diagnostic messages.


Initialize a GitAI project.

Description

Initialize a GitAI project.

Usage

initialize_project(project_id)

Arguments

project_id

A character, ID of the project.

Value

A GitAI object.


Checks if GitAI is verbose

Description

The function searches for GITAI_VERBOSE environmental variable and tries to read it value as logical.

Usage

is_verbose()

Value

A logical. Default is TRUE.


This function is meant to fix 'Namespaces in Imports field not imported from:' R check note. The note shows up when namespace is used to create package object (not function) or within file marked at '.Rbuildignore' file.

Description

This function is meant to fix 'Namespaces in Imports field not imported from:' R check note. The note shows up when namespace is used to create package object (not function) or within file marked at '.Rbuildignore' file.

Usage

missing_deps_note_fix()

Run LLM on GitAI repositories content

Description

Run LLM on GitAI repositories content

Usage

process_repos(gitai, depth = 1, verbose = is_verbose())

Arguments

gitai

A GitAI object.

depth

A numeric, maximum depth of folders to process.

verbose

A logical. If FALSE you won't be getting additional diagnostic messages.

Value

A list.


Setting database in GitAI object.

Description

Setting database in GitAI object.

Usage

set_database(gitai, provider = "Pinecone", ...)

Arguments

gitai

A GitAI object.

provider

A string. Name of database provider.

...

Additional arguments to pass to database provider constructor.


Set GitHub repositories in GitAI object.

Description

Set GitHub repositories in GitAI object.

Usage

set_github_repos(gitai, ..., verbose = is_verbose())

Arguments

gitai

A GitAI object.

...

Parameters to pass to set_github_host function.

verbose

A logical. If FALSE you won't be getting additional diagnostic messages.

Value

A GitAI object.


Set GitLab repositories in GitAI object.

Description

Set GitLab repositories in GitAI object.

Usage

set_gitlab_repos(gitai, ..., verbose = is_verbose())

Arguments

gitai

A GitAI object.

...

Parameters to pass to set_gitlab_host function.

verbose

A logical. If FALSE you won't be getting additional diagnostic messages.

Value

A GitAI object.


Set Large Language Model in GitAI object.

Description

Set Large Language Model in GitAI object.

Usage

set_llm(gitai, provider = "openai", ...)

get_llm_defaults(provider)

Arguments

gitai

A GitAI object.

provider

Name of LLM provider, a string. Results with setting up LLM using ellmer::chat_<provider> function.

...

Other arguments to pass to corresponding ellmer::chat_<provider> function. Please use get_llm_defaults to get default model arguments.

Value

A GitAI object.


Set prompt.

Description

Set prompt.

Usage

set_prompt(gitai, system_prompt)

Arguments

gitai

A GitAI object.

system_prompt

A system prompt.

Value

A GitAI object.


Sets GitAI to be quiet.

Description

The function sets the GITAI_VERBOSE environmental variable to FALSE.

Usage

verbose_off()

Sets GitAI to be verbose

Description

The function sets the GITAI_VERBOSE environmental variable to TRUE.

Usage

verbose_on()