llama-github 0.1.9__tar.gz → 0.2.0__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 (40) hide show
  1. {llama_github-0.1.9 → llama_github-0.2.0}/CHANGELOG.md +6 -1
  2. {llama_github-0.1.9/llama_github.egg-info → llama_github-0.2.0}/PKG-INFO +23 -2
  3. {llama_github-0.1.9 → llama_github-0.2.0}/README.md +16 -0
  4. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/data_retrieval/github_entities.py +33 -12
  5. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/llm_integration/initial_load.py +1 -1
  6. llama_github-0.2.0/llama_github/version.py +1 -0
  7. {llama_github-0.1.9 → llama_github-0.2.0/llama_github.egg-info}/PKG-INFO +23 -2
  8. {llama_github-0.1.9 → llama_github-0.2.0}/setup.cfg +1 -1
  9. llama_github-0.1.9/llama_github/version.py +0 -1
  10. {llama_github-0.1.9 → llama_github-0.2.0}/LICENSE +0 -0
  11. {llama_github-0.1.9 → llama_github-0.2.0}/MANIFEST.in +0 -0
  12. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/__init__.py +0 -0
  13. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/config/__init__.py +0 -0
  14. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/config/config.json +0 -0
  15. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/config/config.py +0 -0
  16. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/data_retrieval/__init__.py +0 -0
  17. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/data_retrieval/github_api.py +0 -0
  18. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/features/__init__.py +0 -0
  19. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/features/feature_flags.py +0 -0
  20. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/features/insider_features.py +0 -0
  21. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/github_integration/__init__.py +0 -0
  22. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/github_integration/github_auth_manager.py +0 -0
  23. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/github_rag.py +0 -0
  24. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/llm_integration/__init__.py +0 -0
  25. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/llm_integration/llm_handler.py +0 -0
  26. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/logger.py +0 -0
  27. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/rag_processing/__init__.py +0 -0
  28. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/rag_processing/rag_processor.py +0 -0
  29. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github/utils.py +0 -0
  30. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github.egg-info/SOURCES.txt +0 -0
  31. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github.egg-info/dependency_links.txt +0 -0
  32. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github.egg-info/requires.txt +0 -0
  33. {llama_github-0.1.9 → llama_github-0.2.0}/llama_github.egg-info/top_level.txt +0 -0
  34. {llama_github-0.1.9 → llama_github-0.2.0}/setup.py +0 -0
  35. {llama_github-0.1.9 → llama_github-0.2.0}/tests/test_data_retrieval.py +0 -0
  36. {llama_github-0.1.9 → llama_github-0.2.0}/tests/test_github_auth_manager.py +0 -0
  37. {llama_github-0.1.9 → llama_github-0.2.0}/tests/test_initial_load.py +0 -0
  38. {llama_github-0.1.9 → llama_github-0.2.0}/tests/test_llm_handler.py +0 -0
  39. {llama_github-0.1.9 → llama_github-0.2.0}/tests/test_logger.py +0 -0
  40. {llama_github-0.1.9 → llama_github-0.2.0}/tests/test_rag_processor.py +0 -0
@@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.9] - 2024-10-31
8
+ ## [0.2.0] - 2024-11-16
9
+
10
+ ### Optimized
11
+ - fix bugs for generate repo from pool by using Github_install_id
12
+
13
+ ## [0.1.9] - 2024-11-04
9
14
 
10
15
  ### Optimized
11
16
  - fix bugs for get pr content
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-github
3
- Version: 0.1.9
3
+ Version: 0.2.0
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
@@ -96,6 +96,22 @@ For more advanced usage and examples, please refer to the [documentation](docs/u
96
96
 
97
97
  - **🛠️ Logging and Error Handling**: We understand the importance of smooth operations and easy troubleshooting. That's why llama-github comes equipped with comprehensive logging and error handling mechanisms. Gain deep insights into the library's behavior, quickly diagnose issues, and maintain a stable and reliable development workflow.
98
98
 
99
+ ## 🤖 Try Our AI-Powered PR Review Assistant: LlamaPReview
100
+
101
+ If you find llama-github useful, you might also be interested in our AI-powered GitHub PR review assistant, LlamaPReview. It's designed to complement your development workflow and further enhance code quality.
102
+
103
+ ### Key Features of LlamaPReview:
104
+ - 🚀 One-click installation, zero configuration required, fully auto-run
105
+ - 💯 Currently free to use - no credit card or payment info needed
106
+ - 🧠 AI-powered, automatic PR reviews with deep code understanding
107
+ - 🌐 Supports multiple programming languages
108
+
109
+ **LlamaPReview utilizes llama-github's advanced context retrieval and LLM-powered analysis** to provide intelligent, context-aware code reviews. It's like having a senior developer, armed with the full context of your repository, review every PR automatically!
110
+
111
+ 👉 [Install LlamaPReview Now](https://github.com/marketplace/llamapreview/) (Free)
112
+
113
+ By using llama-github for context retrieval and LlamaPReview for code reviews, you can create a powerful, AI-enhanced development environment.
114
+
99
115
  ## Vision and Roadmap
100
116
 
101
117
  ### Vision
@@ -140,7 +156,12 @@ All notable changes to this project will be documented in this file.
140
156
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
141
157
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
142
158
 
143
- ## [0.1.9] - 2024-10-31
159
+ ## [0.2.0] - 2024-11-16
160
+
161
+ ### Optimized
162
+ - fix bugs for generate repo from pool by using Github_install_id
163
+
164
+ ## [0.1.9] - 2024-11-04
144
165
 
145
166
  ### Optimized
146
167
  - fix bugs for get pr content
@@ -60,6 +60,22 @@ For more advanced usage and examples, please refer to the [documentation](docs/u
60
60
 
61
61
  - **🛠️ Logging and Error Handling**: We understand the importance of smooth operations and easy troubleshooting. That's why llama-github comes equipped with comprehensive logging and error handling mechanisms. Gain deep insights into the library's behavior, quickly diagnose issues, and maintain a stable and reliable development workflow.
62
62
 
63
+ ## 🤖 Try Our AI-Powered PR Review Assistant: LlamaPReview
64
+
65
+ If you find llama-github useful, you might also be interested in our AI-powered GitHub PR review assistant, LlamaPReview. It's designed to complement your development workflow and further enhance code quality.
66
+
67
+ ### Key Features of LlamaPReview:
68
+ - 🚀 One-click installation, zero configuration required, fully auto-run
69
+ - 💯 Currently free to use - no credit card or payment info needed
70
+ - 🧠 AI-powered, automatic PR reviews with deep code understanding
71
+ - 🌐 Supports multiple programming languages
72
+
73
+ **LlamaPReview utilizes llama-github's advanced context retrieval and LLM-powered analysis** to provide intelligent, context-aware code reviews. It's like having a senior developer, armed with the full context of your repository, review every PR automatically!
74
+
75
+ 👉 [Install LlamaPReview Now](https://github.com/marketplace/llamapreview/) (Free)
76
+
77
+ By using llama-github for context retrieval and LlamaPReview for code reviews, you can create a powerful, AI-enhanced development environment.
78
+
63
79
  ## Vision and Roadmap
64
80
 
65
81
  ### Vision
@@ -98,6 +98,11 @@ class Repository:
98
98
  @property
99
99
  def repo(self):
100
100
  return self.get_repo()
101
+
102
+ def set_github(self, github_instance: ExtendedGithub):
103
+ self._github = github_instance
104
+ with self._repo_lock: # Locking for write action
105
+ self._repo = self._github.get_repo(self.full_name)
101
106
 
102
107
  def get_repo(self):
103
108
  """
@@ -118,8 +123,8 @@ class Repository:
118
123
  self.default_branch = self._repo.default_branch
119
124
  self.updated_at = self._repo.updated_at
120
125
  except GithubException as e:
121
- logger.exception(
122
- f"Error retrieving repository '{self.full_name}':")
126
+ logger.error(
127
+ f"Error retrieving repository '{self.full_name}':{str(e)}")
123
128
  return None
124
129
  self.update_last_read_time()
125
130
  return self._repo
@@ -303,8 +308,8 @@ class Repository:
303
308
  # Full GitHub issue/PR URL pattern
304
309
  rf'(?:https?://)?github\.com/{re.escape(self.full_name)}/(?:issues|pull)/(\d+)',
305
310
 
306
- # Standard #123 reference with proper boundaries
307
- r'(?:^|[^\w/])#(\d+)(?=[^\w/]|$)',
311
+ # # Standard #123 reference with proper boundaries
312
+ # r'(?:^|[^\w/])#(\d+)(?=[^\w/]|$)',
308
313
 
309
314
  # Closing keywords (fixes #123)
310
315
  fr'(?:^|[^\w/])(?:{"|".join(closing_keywords)}):?\s+#(\d+)(?=[^\w/]|$)',
@@ -377,7 +382,7 @@ class Repository:
377
382
  return dt.astimezone(timezone.utc).replace(microsecond=0).isoformat().replace('+00:00', 'Z')
378
383
  return None
379
384
 
380
- def get_pr_content(self, number, pr=None, context_lines=10) -> Dict[str, Any]:
385
+ def get_pr_content(self, number, pr=None, context_lines=10, force_update=False) -> Dict[str, Any]:
381
386
  """
382
387
  Retrieves and processes the content of a pull request.
383
388
 
@@ -386,9 +391,9 @@ class Repository:
386
391
  :param context_lines: Number of context lines for diffs.
387
392
  :return: A dictionary containing detailed PR information.
388
393
  """
389
- if number not in self._prs: # Check if issue has already been fetched
394
+ if number not in self._prs or force_update: # Check if issue has already been fetched
390
395
  with self._pr_lock: # Locking for write action
391
- if number not in self._prs: # Check if issue has already been fetched after get lock
396
+ if number not in self._prs or force_update: # Check if issue has already been fetched after get lock
392
397
  try:
393
398
  logger.debug(f"Processing PR #{number}")
394
399
  if pr is None:
@@ -691,13 +696,29 @@ class RepositoryPool:
691
696
  self._locks_registry[full_name] = Lock()
692
697
  return self._locks_registry[full_name]
693
698
 
694
- def get_repository(self, full_name, **kwargs) -> Repository:
695
- """Retrieve a repository from the pool or create a new one if it doesn't exist."""
699
+ def get_repository(self, full_name, github_instance=None, **kwargs) -> Repository:
700
+ """
701
+ Retrieve a repository from the pool or create a new one if it doesn't exist.
702
+
703
+ If you are using github_install_id to generate a new repository object, you should pass new github_instance to the function.
704
+ Otherwise the default github_instance within the pool might not fit to the new repository object.
705
+ """
706
+
696
707
  if full_name in self._pool:
708
+ # repo = self._pool[full_name]
709
+ # repo.update_last_read_time()
710
+ # if github_instance is not None:
711
+ # repo.set_github(github_instance)
712
+ # return repo
697
713
  return self._pool[full_name]
714
+
698
715
  repo_lock = self._get_repo_lock(full_name)
699
716
  with repo_lock:
700
717
  if full_name not in self._pool:
701
- self._pool[full_name] = Repository(
702
- full_name, self.github_instance, **kwargs)
703
- return self._pool[full_name]
718
+ if github_instance is not None:
719
+ repo = Repository(full_name, github_instance, **kwargs)
720
+ else:
721
+ repo = Repository(full_name, self.github_instance, **kwargs)
722
+ self._pool[full_name] = repo
723
+
724
+ return self._pool[full_name]
@@ -69,7 +69,7 @@ class LLMManager:
69
69
  elif mistral_api_key is not None and mistral_api_key != "" and self.llm is None:
70
70
  logger.info("Initializing Mistral API...")
71
71
  self.llm = ChatMistralAI(mistral_api_key=mistral_api_key, model="mistral-large-latest")
72
- self.llm_simple = ChatMistralAI(mistral_api_key=mistral_api_key, model="open-mistral-nemo")
72
+ self.llm_simple = ChatMistralAI(mistral_api_key=mistral_api_key, model="open-codestral-mamba")
73
73
  self.model_type = "OpenAI"
74
74
  elif openai_api_key is not None and openai_api_key != "" and self.llm is None:
75
75
  logger.info("Initializing OpenAI API...")
@@ -0,0 +1 @@
1
+ __version__ = '0.2.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-github
3
- Version: 0.1.9
3
+ Version: 0.2.0
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
@@ -96,6 +96,22 @@ For more advanced usage and examples, please refer to the [documentation](docs/u
96
96
 
97
97
  - **🛠️ Logging and Error Handling**: We understand the importance of smooth operations and easy troubleshooting. That's why llama-github comes equipped with comprehensive logging and error handling mechanisms. Gain deep insights into the library's behavior, quickly diagnose issues, and maintain a stable and reliable development workflow.
98
98
 
99
+ ## 🤖 Try Our AI-Powered PR Review Assistant: LlamaPReview
100
+
101
+ If you find llama-github useful, you might also be interested in our AI-powered GitHub PR review assistant, LlamaPReview. It's designed to complement your development workflow and further enhance code quality.
102
+
103
+ ### Key Features of LlamaPReview:
104
+ - 🚀 One-click installation, zero configuration required, fully auto-run
105
+ - 💯 Currently free to use - no credit card or payment info needed
106
+ - 🧠 AI-powered, automatic PR reviews with deep code understanding
107
+ - 🌐 Supports multiple programming languages
108
+
109
+ **LlamaPReview utilizes llama-github's advanced context retrieval and LLM-powered analysis** to provide intelligent, context-aware code reviews. It's like having a senior developer, armed with the full context of your repository, review every PR automatically!
110
+
111
+ 👉 [Install LlamaPReview Now](https://github.com/marketplace/llamapreview/) (Free)
112
+
113
+ By using llama-github for context retrieval and LlamaPReview for code reviews, you can create a powerful, AI-enhanced development environment.
114
+
99
115
  ## Vision and Roadmap
100
116
 
101
117
  ### Vision
@@ -140,7 +156,12 @@ All notable changes to this project will be documented in this file.
140
156
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
141
157
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
142
158
 
143
- ## [0.1.9] - 2024-10-31
159
+ ## [0.2.0] - 2024-11-16
160
+
161
+ ### Optimized
162
+ - fix bugs for generate repo from pool by using Github_install_id
163
+
164
+ ## [0.1.9] - 2024-11-04
144
165
 
145
166
  ### Optimized
146
167
  - fix bugs for get pr content
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = llama-github
3
- version = 0.1.9
3
+ version = 0.2.0
4
4
  author = Jet Xu
5
5
  author_email = Voldemort.xu@foxmail.com
6
6
  description = 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.
@@ -1 +0,0 @@
1
- __version__ = '0.1.9'
File without changes
File without changes
File without changes