llama-github 0.3.0__tar.gz → 0.3.2__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.
- {llama_github-0.3.0 → llama_github-0.3.2}/CHANGELOG.md +7 -2
- {llama_github-0.3.0/llama_github.egg-info → llama_github-0.3.2}/PKG-INFO +8 -3
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/data_retrieval/github_entities.py +87 -46
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/llm_integration/initial_load.py +3 -3
- llama_github-0.3.2/llama_github/version.py +1 -0
- {llama_github-0.3.0 → llama_github-0.3.2/llama_github.egg-info}/PKG-INFO +8 -3
- {llama_github-0.3.0 → llama_github-0.3.2}/setup.cfg +1 -1
- llama_github-0.3.0/llama_github/version.py +0 -1
- {llama_github-0.3.0 → llama_github-0.3.2}/LICENSE +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/MANIFEST.in +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/README.md +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/config/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/config/config.json +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/config/config.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/data_retrieval/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/data_retrieval/github_api.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/features/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/features/feature_flags.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/features/insider_features.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/github_integration/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/github_integration/github_auth_manager.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/github_rag.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/llm_integration/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/llm_integration/llm_handler.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/logger.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/rag_processing/__init__.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/rag_processing/rag_processor.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github/utils.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github.egg-info/SOURCES.txt +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github.egg-info/dependency_links.txt +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github.egg-info/requires.txt +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/llama_github.egg-info/top_level.txt +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/setup.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/tests/test_data_retrieval.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/tests/test_github_auth_manager.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/tests/test_initial_load.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/tests/test_llm_handler.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/tests/test_logger.py +0 -0
- {llama_github-0.3.0 → llama_github-0.3.2}/tests/test_rag_processor.py +0 -0
|
@@ -5,10 +5,15 @@ 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.3.
|
|
8
|
+
## [0.3.2] - 2025-06-23
|
|
9
9
|
|
|
10
10
|
### Optimized
|
|
11
|
-
- Upgrade to
|
|
11
|
+
- Upgrade to extract_related_issues method
|
|
12
|
+
|
|
13
|
+
## [0.3.1] - 2025-05-25
|
|
14
|
+
|
|
15
|
+
### Optimized
|
|
16
|
+
- Upgrade to mistral medium & devstral small
|
|
12
17
|
|
|
13
18
|
## [0.2.8] - 2025-03-19
|
|
14
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llama-github
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
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
|
|
@@ -156,10 +156,15 @@ All notable changes to this project will be documented in this file.
|
|
|
156
156
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
157
157
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
158
158
|
|
|
159
|
-
## [0.3.
|
|
159
|
+
## [0.3.2] - 2025-06-23
|
|
160
160
|
|
|
161
161
|
### Optimized
|
|
162
|
-
- Upgrade to
|
|
162
|
+
- Upgrade to extract_related_issues method
|
|
163
|
+
|
|
164
|
+
## [0.3.1] - 2025-05-25
|
|
165
|
+
|
|
166
|
+
### Optimized
|
|
167
|
+
- Upgrade to mistral medium & devstral small
|
|
163
168
|
|
|
164
169
|
## [0.2.8] - 2025-03-19
|
|
165
170
|
|
|
@@ -396,77 +396,118 @@ class Repository:
|
|
|
396
396
|
|
|
397
397
|
def extract_related_issues(self, pr_data: Dict[str, Any]) -> List[int]:
|
|
398
398
|
"""
|
|
399
|
-
Extracts related issue numbers from
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
4. Repository cross-references (owner/repo#123)
|
|
406
|
-
|
|
407
|
-
See: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls
|
|
408
|
-
|
|
399
|
+
Extracts related issue numbers from PR data using adaptive strategies based on content length.
|
|
400
|
+
|
|
401
|
+
Uses different matching strategies:
|
|
402
|
+
- Short descriptions (<200 chars): Aggressive patterns for simple references
|
|
403
|
+
- Long descriptions (>=200 chars): Strict patterns to avoid false positives
|
|
404
|
+
|
|
409
405
|
Args:
|
|
410
|
-
pr_data:
|
|
406
|
+
pr_data: Complete pull request data dictionary
|
|
411
407
|
|
|
412
408
|
Returns:
|
|
413
|
-
List[int] -
|
|
409
|
+
List[int] - Sorted list of unique issue numbers
|
|
414
410
|
"""
|
|
415
411
|
# GitHub's official closing keywords
|
|
416
412
|
closing_keywords = (
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
413
|
+
'close', 'closes', 'closed',
|
|
414
|
+
'fix', 'fixes', 'fixed',
|
|
415
|
+
'resolve', 'resolves', 'resolved',
|
|
416
|
+
'address', 'addresses', 'addressing',
|
|
417
|
+
'relate', 'relates', 'related',
|
|
418
|
+
'see',
|
|
419
|
+
'issue', 'bug', 'ticket', 'todo', 'task'
|
|
420
420
|
)
|
|
421
421
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
422
|
+
issues = set()
|
|
423
|
+
|
|
424
|
+
def get_description_length(data: Dict[str, Any]) -> int:
|
|
425
|
+
"""Get the length of PR description for strategy selection"""
|
|
426
|
+
try:
|
|
427
|
+
description = data.get('pr_metadata', {}).get('description', '')
|
|
428
|
+
return len(description) if isinstance(description, str) else 0
|
|
429
|
+
except:
|
|
430
|
+
return 0
|
|
431
|
+
|
|
432
|
+
def extract_with_aggressive_patterns(text: str) -> None:
|
|
433
|
+
"""Aggressive patterns for short, focused descriptions"""
|
|
434
|
+
if not isinstance(text, str):
|
|
435
|
+
return
|
|
436
|
+
|
|
437
|
+
patterns = [
|
|
438
|
+
# Simple #123 reference (most common in short descriptions)
|
|
439
|
+
r'#(\d+)(?!\d)',
|
|
440
|
+
|
|
441
|
+
# Full GitHub URLs
|
|
442
|
+
rf'(?:https?://)?github\.com/{re.escape(self.full_name)}/(?:issues|pull)/(\d+)',
|
|
443
|
+
|
|
444
|
+
# Closing keywords with flexible spacing
|
|
445
|
+
fr'(?:{"|".join(closing_keywords)})\s*:?\s*#?(\d+)(?!\d)',
|
|
446
|
+
|
|
447
|
+
# Action words commonly used in short descriptions
|
|
448
|
+
r'(?:addresses?|references?|relates?\s+to|see)\s+#?(\d+)(?!\d)',
|
|
449
|
+
]
|
|
435
450
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
451
|
+
for pattern in patterns:
|
|
452
|
+
matches = re.findall(pattern, text, re.IGNORECASE)
|
|
453
|
+
valid_matches = [
|
|
454
|
+
int(match) for match in matches
|
|
455
|
+
if match.isdigit() and len(match) <= 6 and int(match) > 0
|
|
456
|
+
]
|
|
457
|
+
issues.update(valid_matches)
|
|
439
458
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
def extract_from_text(text: str) -> None:
|
|
443
|
-
"""Helper function to extract issue numbers from text"""
|
|
459
|
+
def extract_with_strict_patterns(text: str) -> None:
|
|
460
|
+
"""Strict patterns for long descriptions to avoid false positives"""
|
|
444
461
|
if not isinstance(text, str):
|
|
445
462
|
return
|
|
446
463
|
|
|
464
|
+
patterns = [
|
|
465
|
+
# Full GitHub URLs (always reliable)
|
|
466
|
+
rf'(?:https?://)?github\.com/{re.escape(self.full_name)}/(?:issues|pull)/(\d+)',
|
|
467
|
+
|
|
468
|
+
# Closing keywords with word boundaries
|
|
469
|
+
fr'\b(?:{"|".join(closing_keywords)})\s*:?\s*#(\d+)\b',
|
|
470
|
+
|
|
471
|
+
# Explicit issue references with word boundaries
|
|
472
|
+
r'\b(?:issue|bug|ticket|pr|pull\s+request)\s*:?\s*#?(\d+)\b',
|
|
473
|
+
|
|
474
|
+
# Cross-repo references
|
|
475
|
+
rf'\b{re.escape(self.full_name)}#(\d+)\b',
|
|
476
|
+
]
|
|
477
|
+
|
|
447
478
|
for pattern in patterns:
|
|
448
|
-
matches = re.findall(pattern, text, re.IGNORECASE
|
|
449
|
-
# Validate issue numbers (reasonable length and positive values)
|
|
479
|
+
matches = re.findall(pattern, text, re.IGNORECASE)
|
|
450
480
|
valid_matches = [
|
|
451
481
|
int(match) for match in matches
|
|
452
|
-
if match.isdigit() and len(match) <=
|
|
482
|
+
if match.isdigit() and len(match) <= 6 and int(match) > 0
|
|
453
483
|
]
|
|
454
484
|
issues.update(valid_matches)
|
|
455
485
|
|
|
456
|
-
def
|
|
457
|
-
"""
|
|
486
|
+
def extract_from_text(text: str, use_aggressive: bool = False) -> None:
|
|
487
|
+
"""Extract issue numbers using appropriate strategy"""
|
|
488
|
+
if use_aggressive:
|
|
489
|
+
extract_with_aggressive_patterns(text)
|
|
490
|
+
else:
|
|
491
|
+
extract_with_strict_patterns(text)
|
|
492
|
+
|
|
493
|
+
def process_value(value: Any, use_aggressive: bool = False) -> None:
|
|
494
|
+
"""Recursively process values and extract issue numbers"""
|
|
458
495
|
if isinstance(value, dict):
|
|
459
496
|
for v in value.values():
|
|
460
|
-
process_value(v)
|
|
497
|
+
process_value(v, use_aggressive)
|
|
461
498
|
elif isinstance(value, (list, tuple)):
|
|
462
499
|
for item in value:
|
|
463
|
-
process_value(item)
|
|
500
|
+
process_value(item, use_aggressive)
|
|
464
501
|
elif isinstance(value, str):
|
|
465
|
-
extract_from_text(value)
|
|
502
|
+
extract_from_text(value, use_aggressive)
|
|
503
|
+
|
|
504
|
+
# Determine strategy based on description length
|
|
505
|
+
desc_length = get_description_length(pr_data)
|
|
506
|
+
use_aggressive_strategy = desc_length < 200
|
|
507
|
+
|
|
508
|
+
# Process all PR data
|
|
509
|
+
process_value(pr_data, use_aggressive_strategy)
|
|
466
510
|
|
|
467
|
-
# Process all data in pr_data recursively
|
|
468
|
-
process_value(pr_data)
|
|
469
|
-
|
|
470
511
|
return sorted(list(issues))
|
|
471
512
|
|
|
472
513
|
|
|
@@ -67,10 +67,10 @@ class LLMManager:
|
|
|
67
67
|
elif mistral_api_key is not None and mistral_api_key != "" and self.llm is None:
|
|
68
68
|
logger.info("Initializing Codestral API...")
|
|
69
69
|
from langchain_mistralai.chat_models import ChatMistralAI
|
|
70
|
-
self.llm = ChatMistralAI(mistral_api_key=mistral_api_key, model="mistral-medium-
|
|
70
|
+
self.llm = ChatMistralAI(mistral_api_key=mistral_api_key, model="mistral-medium-latest", temperature=0.3)
|
|
71
71
|
self.llm_simple = ChatMistralAI(
|
|
72
|
-
mistral_api_key=mistral_api_key,
|
|
73
|
-
model="
|
|
72
|
+
mistral_api_key=mistral_api_key,
|
|
73
|
+
model="devstral-small-latest",
|
|
74
74
|
temperature=0.2
|
|
75
75
|
)
|
|
76
76
|
self.model_type = "OpenAI"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.3.2'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: llama-github
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
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
|
|
@@ -156,10 +156,15 @@ All notable changes to this project will be documented in this file.
|
|
|
156
156
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
157
157
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
158
158
|
|
|
159
|
-
## [0.3.
|
|
159
|
+
## [0.3.2] - 2025-06-23
|
|
160
160
|
|
|
161
161
|
### Optimized
|
|
162
|
-
- Upgrade to
|
|
162
|
+
- Upgrade to extract_related_issues method
|
|
163
|
+
|
|
164
|
+
## [0.3.1] - 2025-05-25
|
|
165
|
+
|
|
166
|
+
### Optimized
|
|
167
|
+
- Upgrade to mistral medium & devstral small
|
|
163
168
|
|
|
164
169
|
## [0.2.8] - 2025-03-19
|
|
165
170
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = llama-github
|
|
3
|
-
version = 0.3.
|
|
3
|
+
version = 0.3.2
|
|
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.3.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_github-0.3.0 → llama_github-0.3.2}/llama_github/github_integration/github_auth_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|