GitHubFile
- content (str): The content of the GitHub text.
- file_path (str): The path of the file.
- html_url (str): The actual url of the file.
RepositoryInfo
- repo_name (str): The full name of the repository.
- repo_url (str): The URL of the repository.
- contents (list): A list to hold the repository contents.
RepoAgent
- FULL_CONTEXT: loads and injects full repository content into the prompt.
- RAG (Retrieval-Augmented Generation): retrieves relevant code/documentation chunks using a vector store when context length exceeds a specified token limit.
- vector_retriever (VectorRetriever): Retriever used to perform semantic search in RAG mode. Required if repo content exceeds context limit.
- system_message (Optional[str]): The system message for the chat agent. (default: :str:
"You are a code assistant with repo context."
) - repo_paths (Optional[List[str]]): List of GitHub repository URLs to load during initialization. (default: :obj:
None
) - model (BaseModelBackend): The model backend to use for generating responses. (default: :obj:
ModelPlatformType.DEFAULT
withModelType.DEFAULT
) - max_context_tokens (Optional[int]): Maximum number of tokens allowed before switching to RAG mode. (default: :obj:
2000
) - github_auth_token (Optional[str]): GitHub personal access token for accessing private or rate-limited repositories. (default: :obj:
None
) - chunk_size (Optional[int]): Maximum number of characters per code chunk when indexing files for RAG. (default: :obj:
8192
) - top_k (int): Number of top-matching chunks to retrieve from the vector store in RAG mode. (default: :obj:
5
) - similarity (Optional[float]): Minimum similarity score required to include a chunk in the RAG context. (default: :obj:
0.6
) - collection_name (Optional[str]): Name of the vector database collection to use for storing and retrieving chunks. (default: :obj:
None
) **kwargs: Inherited from ChatAgent
init
parse_url
- url (str): The URL to be parsed.
load_repositories
- repo_urls (str): The list of Repo URLs.
load_repository
- repo_urls (str): The Repo URL to be loaded.
- github_client (GitHub): The established GitHub client.
count_tokens
construct_full_text
add_repositories
- repo_urls (str): The Repo URL to be added.
check_switch_mode
step
ChatAgent.step()
to first retrieve relevant context
from the vector store before passing the input to the language model.
reset
search_by_file_path
- file_path (str): The
file_path
value to filter the payloads.
text
fields sorted by
piece_num
.