llama-github 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. llama_github-0.1.3/CHANGELOG.md +69 -0
  2. {llama_github-0.1.1/llama_github.egg-info → llama_github-0.1.3}/PKG-INFO +36 -1
  3. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/data_retrieval/github_api.py +21 -0
  4. llama_github-0.1.3/llama_github/data_retrieval/github_entities.py +578 -0
  5. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/github_integration/github_auth_manager.py +79 -0
  6. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/github_rag.py +23 -9
  7. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/llm_integration/initial_load.py +29 -23
  8. llama_github-0.1.3/llama_github/utils.py +307 -0
  9. llama_github-0.1.3/llama_github/version.py +1 -0
  10. {llama_github-0.1.1 → llama_github-0.1.3/llama_github.egg-info}/PKG-INFO +36 -1
  11. {llama_github-0.1.1 → llama_github-0.1.3}/setup.cfg +1 -1
  12. llama_github-0.1.1/CHANGELOG.md +0 -34
  13. llama_github-0.1.1/llama_github/data_retrieval/github_entities.py +0 -301
  14. llama_github-0.1.1/llama_github/utils.py +0 -98
  15. llama_github-0.1.1/llama_github/version.py +0 -1
  16. {llama_github-0.1.1 → llama_github-0.1.3}/LICENSE +0 -0
  17. {llama_github-0.1.1 → llama_github-0.1.3}/MANIFEST.in +0 -0
  18. {llama_github-0.1.1 → llama_github-0.1.3}/README.md +0 -0
  19. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/__init__.py +0 -0
  20. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/config/__init__.py +0 -0
  21. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/config/config.json +0 -0
  22. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/config/config.py +0 -0
  23. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/data_retrieval/__init__.py +0 -0
  24. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/features/__init__.py +0 -0
  25. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/features/feature_flags.py +0 -0
  26. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/features/insider_features.py +0 -0
  27. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/github_integration/__init__.py +0 -0
  28. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/llm_integration/__init__.py +0 -0
  29. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/llm_integration/llm_handler.py +0 -0
  30. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/logger.py +0 -0
  31. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/rag_processing/__init__.py +0 -0
  32. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github/rag_processing/rag_processor.py +0 -0
  33. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github.egg-info/SOURCES.txt +0 -0
  34. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github.egg-info/dependency_links.txt +0 -0
  35. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github.egg-info/requires.txt +0 -0
  36. {llama_github-0.1.1 → llama_github-0.1.3}/llama_github.egg-info/top_level.txt +0 -0
  37. {llama_github-0.1.1 → llama_github-0.1.3}/setup.py +0 -0
  38. {llama_github-0.1.1 → llama_github-0.1.3}/tests/test_data_retrieval.py +0 -0
  39. {llama_github-0.1.1 → llama_github-0.1.3}/tests/test_github_auth_manager.py +0 -0
  40. {llama_github-0.1.1 → llama_github-0.1.3}/tests/test_initial_load.py +0 -0
  41. {llama_github-0.1.1 → llama_github-0.1.3}/tests/test_llm_handler.py +0 -0
  42. {llama_github-0.1.1 → llama_github-0.1.3}/tests/test_logger.py +0 -0
  43. {llama_github-0.1.1 → llama_github-0.1.3}/tests/test_rag_processor.py +0 -0
@@ -0,0 +1,69 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.3] - 2024-10-14
9
+
10
+ ### Added
11
+ - Modified `LLMManager` class to skip loading embedding and reranker models when `simple_mode` is enabled
12
+ - Updated `retrieve_context` method to use instance's `simple_mode` by default, with option to override
13
+
14
+ ### Improved
15
+ - Faster initialization process when `simple_mode` is enabled, skipping embedding and reranker model loading
16
+ - More flexible usage of `simple_mode` in `retrieve_context`, allowing per-call customization
17
+
18
+ ### Developer Notes
19
+ - When using `simple_mode=True` during GithubRAG initialization, be aware that embedding and reranking functionalities will not be available
20
+ - The `retrieve_context` method now uses a late binding approach for `simple_mode` parameter
21
+
22
+ ## [0.1.2] - 2024-10-09
23
+
24
+ ### Added
25
+ - New `get_pr_content` method in `Repository` class for comprehensive PR data retrieval
26
+ - Singleton pattern implementation for efficient PR data caching
27
+ - Support for LLM-assisted PR analysis and Q&A capabilities
28
+ - Automatic caching mechanism to reduce API calls and improve performance
29
+ - Threaded comment and review retrieval functionality
30
+
31
+ ### Changed
32
+ - Improved PR data fetching process to include metadata, file changes, and comments
33
+
34
+ ### Optimized
35
+ - Reduced API calls through intelligent caching of PR data
36
+
37
+ ### Developer Notes
38
+ - First call to `get_pr_content` fetches data from GitHub API, subsequent calls use cached data
39
+ - Cache automatically refreshes when PR is updated
40
+
41
+ ## [0.1.1] - 2024-08-23
42
+
43
+ ### Added
44
+ - Implemented `answer_with_context` method for direct answer generation (closes #6)
45
+ - Added support for Mistral AI LLM provider
46
+ - Enhanced `retrieve_context` function to include metadata (e.g., URLs) with each context string (closes #2)
47
+
48
+ ### Changed
49
+ - Improved reranking with jina-reranker-v2 for better context retrieval
50
+ - Updated return type of `retrieve_context` to accommodate metadata
51
+
52
+ ### Fixed
53
+ - Resolved warning during context retrieval (closes #3)
54
+
55
+ ### Improved
56
+ - Enhanced overall context retrieval process
57
+ - Expanded LLM support for more versatile use cases
58
+
59
+ ## [0.1.0] - 2024-08-15
60
+
61
+ ### Added
62
+ - Initial release of llama-github
63
+ - Basic functionality for retrieving context from GitHub repositories
64
+ - Integration with LLM for processing and generating responses
65
+
66
+ [0.1.3]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.2...v0.1.3
67
+ [0.1.2]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.1...v0.1.2
68
+ [0.1.1]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.0...v0.1.1
69
+ [0.1.0]: https://github.com/JetXu-LLM/llama-github/releases/tag/v0.1.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-github
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Llama-github is an open-source Python library that empowers LLM Chatbots, AI Agents, and Auto-dev Agents to conduct Retrieval from actively selected GitHub public projects. It Augments through LLMs and Generates context for any coding question, in order to streamline the development of sophisticated AI-driven applications.
5
5
  Home-page: https://github.com/JetXu-LLM/llama-github
6
6
  Author: Jet Xu
@@ -133,6 +133,39 @@ All notable changes to this project will be documented in this file.
133
133
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
134
134
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
135
135
 
136
+ ## [0.1.3] - 2024-10-14
137
+
138
+ ### Added
139
+ - Modified `LLMManager` class to skip loading embedding and reranker models when `simple_mode` is enabled
140
+ - Updated `retrieve_context` method to use instance's `simple_mode` by default, with option to override
141
+
142
+ ### Improved
143
+ - Faster initialization process when `simple_mode` is enabled, skipping embedding and reranker model loading
144
+ - More flexible usage of `simple_mode` in `retrieve_context`, allowing per-call customization
145
+
146
+ ### Developer Notes
147
+ - When using `simple_mode=True` during GithubRAG initialization, be aware that embedding and reranking functionalities will not be available
148
+ - The `retrieve_context` method now uses a late binding approach for `simple_mode` parameter
149
+
150
+ ## [0.1.2] - 2024-10-09
151
+
152
+ ### Added
153
+ - New `get_pr_content` method in `Repository` class for comprehensive PR data retrieval
154
+ - Singleton pattern implementation for efficient PR data caching
155
+ - Support for LLM-assisted PR analysis and Q&A capabilities
156
+ - Automatic caching mechanism to reduce API calls and improve performance
157
+ - Threaded comment and review retrieval functionality
158
+
159
+ ### Changed
160
+ - Improved PR data fetching process to include metadata, file changes, and comments
161
+
162
+ ### Optimized
163
+ - Reduced API calls through intelligent caching of PR data
164
+
165
+ ### Developer Notes
166
+ - First call to `get_pr_content` fetches data from GitHub API, subsequent calls use cached data
167
+ - Cache automatically refreshes when PR is updated
168
+
136
169
  ## [0.1.1] - 2024-08-23
137
170
 
138
171
  ### Added
@@ -158,5 +191,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
158
191
  - Basic functionality for retrieving context from GitHub repositories
159
192
  - Integration with LLM for processing and generating responses
160
193
 
194
+ [0.1.3]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.2...v0.1.3
195
+ [0.1.2]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.1...v0.1.2
161
196
  [0.1.1]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.0...v0.1.1
162
197
  [0.1.0]: https://github.com/JetXu-LLM/llama-github/releases/tag/v0.1.0
@@ -5,6 +5,7 @@ from llama_github.logger import logger
5
5
  from llama_github.github_integration.github_auth_manager import ExtendedGithub
6
6
  from llama_github.config.config import config
7
7
  import re
8
+ from typing import Any, Dict, List
8
9
 
9
10
 
10
11
  class GitHubAPIHandler:
@@ -81,6 +82,26 @@ class GitHubAPIHandler:
81
82
  file_content = repository_obj.get_file_content(
82
83
  code_search_result['path'])
83
84
  return repository_obj, file_content
85
+
86
+ async def get_pr_files(self, repo: Repository, pr_number: int) -> List[Dict[str, Any]]:
87
+ url = f"{self.base_url}/repos/{repo.full_name}/pulls/{pr_number}/files"
88
+ headers = {"Authorization": f"token {self.token}"}
89
+ async with self.session.get(url, headers=headers) as response:
90
+ if response.status == 200:
91
+ return await response.json()
92
+ else:
93
+ logger.error(f"Failed to get PR files: {response.status}")
94
+ return []
95
+
96
+ async def get_pr_comments(self, repo: Repository, pr_number: int) -> List[Dict[str, Any]]:
97
+ url = f"{self.base_url}/repos/{repo.full_name}/issues/{pr_number}/comments"
98
+ headers = {"Authorization": f"token {self.token}"}
99
+ async with self.session.get(url, headers=headers) as response:
100
+ if response.status == 200:
101
+ return await response.json()
102
+ else:
103
+ logger.error(f"Failed to get PR comments: {response.status}")
104
+ return []
84
105
 
85
106
  def search_code(self, query, repo_full_name=None):
86
107
  """