llama-github 0.1.3__tar.gz → 0.1.5__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.1.3 → llama_github-0.1.5}/CHANGELOG.md +15 -0
- {llama_github-0.1.3/llama_github.egg-info → llama_github-0.1.5}/PKG-INFO +21 -1
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/github_rag.py +131 -28
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/llm_integration/initial_load.py +4 -8
- llama_github-0.1.5/llama_github/logger.py +15 -0
- llama_github-0.1.5/llama_github/version.py +1 -0
- {llama_github-0.1.3 → llama_github-0.1.5/llama_github.egg-info}/PKG-INFO +21 -1
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github.egg-info/requires.txt +5 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/setup.cfg +1 -1
- llama_github-0.1.3/llama_github/logger.py +0 -28
- llama_github-0.1.3/llama_github/version.py +0 -1
- {llama_github-0.1.3 → llama_github-0.1.5}/LICENSE +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/MANIFEST.in +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/README.md +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/config/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/config/config.json +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/config/config.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/data_retrieval/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/data_retrieval/github_api.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/data_retrieval/github_entities.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/features/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/features/feature_flags.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/features/insider_features.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/github_integration/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/github_integration/github_auth_manager.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/llm_integration/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/llm_integration/llm_handler.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/rag_processing/__init__.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/rag_processing/rag_processor.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github/utils.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github.egg-info/SOURCES.txt +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github.egg-info/dependency_links.txt +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/llama_github.egg-info/top_level.txt +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/setup.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/tests/test_data_retrieval.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/tests/test_github_auth_manager.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/tests/test_initial_load.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/tests/test_llm_handler.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/tests/test_logger.py +0 -0
- {llama_github-0.1.3 → llama_github-0.1.5}/tests/test_rag_processor.py +0 -0
|
@@ -5,6 +5,20 @@ 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.5] - 2024-10-14
|
|
9
|
+
|
|
10
|
+
### Optimized
|
|
11
|
+
- requirements.txt updated to more precise list
|
|
12
|
+
|
|
13
|
+
## [0.1.4] - 2024-10-14
|
|
14
|
+
|
|
15
|
+
### Improved
|
|
16
|
+
- Optimized `simple_mode`:
|
|
17
|
+
- Removed dependencies on `Torch` and `Transformers` libraries
|
|
18
|
+
- Reduced memory footprint
|
|
19
|
+
- Eliminated related imports
|
|
20
|
+
- Enhanced compatibility with AWS Lambda environment
|
|
21
|
+
|
|
8
22
|
## [0.1.3] - 2024-10-14
|
|
9
23
|
|
|
10
24
|
### Added
|
|
@@ -63,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
63
77
|
- Basic functionality for retrieving context from GitHub repositories
|
|
64
78
|
- Integration with LLM for processing and generating responses
|
|
65
79
|
|
|
80
|
+
[0.1.4]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.3...v0.1.4
|
|
66
81
|
[0.1.3]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.2...v0.1.3
|
|
67
82
|
[0.1.2]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.1...v0.1.2
|
|
68
83
|
[0.1.1]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.0...v0.1.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: llama-github
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
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
|
|
@@ -22,6 +22,11 @@ Requires-Dist: requests
|
|
|
22
22
|
Requires-Dist: torch
|
|
23
23
|
Requires-Dist: transformers
|
|
24
24
|
Requires-Dist: urllib3
|
|
25
|
+
Requires-Dist: pydantic_core
|
|
26
|
+
Requires-Dist: langchain_openai
|
|
27
|
+
Requires-Dist: langchain_mistralai
|
|
28
|
+
Requires-Dist: httpx_sse
|
|
29
|
+
Requires-Dist: tokenizers
|
|
25
30
|
Provides-Extra: dev
|
|
26
31
|
Requires-Dist: pytest; extra == "dev"
|
|
27
32
|
Requires-Dist: black; extra == "dev"
|
|
@@ -133,6 +138,20 @@ All notable changes to this project will be documented in this file.
|
|
|
133
138
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
134
139
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
135
140
|
|
|
141
|
+
## [0.1.5] - 2024-10-14
|
|
142
|
+
|
|
143
|
+
### Optimized
|
|
144
|
+
- requirements.txt updated to more precise list
|
|
145
|
+
|
|
146
|
+
## [0.1.4] - 2024-10-14
|
|
147
|
+
|
|
148
|
+
### Improved
|
|
149
|
+
- Optimized `simple_mode`:
|
|
150
|
+
- Removed dependencies on `Torch` and `Transformers` libraries
|
|
151
|
+
- Reduced memory footprint
|
|
152
|
+
- Eliminated related imports
|
|
153
|
+
- Enhanced compatibility with AWS Lambda environment
|
|
154
|
+
|
|
136
155
|
## [0.1.3] - 2024-10-14
|
|
137
156
|
|
|
138
157
|
### Added
|
|
@@ -191,6 +210,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
191
210
|
- Basic functionality for retrieving context from GitHub repositories
|
|
192
211
|
- Integration with LLM for processing and generating responses
|
|
193
212
|
|
|
213
|
+
[0.1.4]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.3...v0.1.4
|
|
194
214
|
[0.1.3]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.2...v0.1.3
|
|
195
215
|
[0.1.2]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.1...v0.1.2
|
|
196
216
|
[0.1.1]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.0...v0.1.1
|
|
@@ -46,24 +46,26 @@ class GithubRAG:
|
|
|
46
46
|
"""
|
|
47
47
|
Initialize the GithubRAG with the provided credentials and configuration.
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- openai_api_key (Optional[str]): API key for OpenAI services -- recommend to use, GPT-4-turbo will be used.
|
|
53
|
-
- mistral_api_key (Optional[str]): API key for Mistral AI services.
|
|
54
|
-
- huggingface_token (Optional[str]): Token for Hugging Face services -- recommend to fill.
|
|
55
|
-
- jina_api_key (Optional[str]): API key for Jina AI services -- s.jina.ai API will be used
|
|
56
|
-
- open_source_models_hg_dir (Optional[str]): Name of open-source models from Hugging Face to replace OpenAI.
|
|
57
|
-
- embedding_model (Optional[str]): Name of Embedding model from Hugging Face, if you have preferred embedding model to be used.
|
|
58
|
-
- rerank_model (Optional[str]): Name of Rerank model from Hugging Face, if you have preferred rerank model to be used.
|
|
59
|
-
- llm (Any): Any kind of LangChain llm chat object - to replace OpenAI or open-source models from Hugging Face.
|
|
60
|
-
- simple_mode (bool): If True, skip embedding and rerank model initialization in LLMManager.
|
|
61
|
-
- **kwargs:
|
|
62
|
-
:param repo_cleanup_interval (Optional[int]): How often to run repo cleanup in seconds within RepositoryPool.
|
|
63
|
-
:param repo_max_idle_time (Optional[int]): Keep a repo in cache until max idle time if not used.
|
|
49
|
+
This constructor sets up the necessary components for GitHub integration,
|
|
50
|
+
RAG processing, and LLM capabilities. It handles authentication, initializes
|
|
51
|
+
the repository pool, and sets up the LLM manager.
|
|
64
52
|
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
Args:
|
|
54
|
+
github_access_token (Optional[str]): GitHub access token for authentication.
|
|
55
|
+
github_app_credentials (Optional[GitHubAppCredentials]): Credentials for GitHub App authentication.
|
|
56
|
+
openai_api_key (Optional[str]): API key for OpenAI services (GPT-4-turbo will be used).
|
|
57
|
+
mistral_api_key (Optional[str]): API key for Mistral AI services.
|
|
58
|
+
huggingface_token (Optional[str]): Token for Hugging Face services (recommended).
|
|
59
|
+
jina_api_key (Optional[str]): API key for Jina AI services (s.jina.ai API will be used).
|
|
60
|
+
open_source_models_hg_dir (Optional[str]): Directory for open-source models from Hugging Face.
|
|
61
|
+
embedding_model (Optional[str]): Name of the preferred embedding model from Hugging Face.
|
|
62
|
+
rerank_model (Optional[str]): Name of the preferred rerank model from Hugging Face.
|
|
63
|
+
llm (Any): Any LangChain LLM chat object to replace OpenAI or open-source models.
|
|
64
|
+
simple_mode (bool): If True, skip embedding and rerank model initialization in LLMManager.
|
|
65
|
+
**kwargs: Additional keyword arguments for repository pool configuration.
|
|
66
|
+
|
|
67
|
+
Raises:
|
|
68
|
+
Exception: If there's an error during initialization.
|
|
67
69
|
"""
|
|
68
70
|
try:
|
|
69
71
|
logger.info("Initializing GithubRAG...")
|
|
@@ -111,10 +113,23 @@ class GithubRAG:
|
|
|
111
113
|
raise
|
|
112
114
|
|
|
113
115
|
async def async_retrieve_context(self, query, simple_mode: Optional[bool] = None) -> List[str]:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
"""
|
|
117
|
+
Asynchronously retrieve context based on the given query.
|
|
118
|
+
|
|
119
|
+
This method orchestrates the context retrieval process, including Google search,
|
|
120
|
+
code search, issue search, and repository search. It uses the RAG processor to
|
|
121
|
+
analyze the query and retrieve the most relevant contexts.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
query (str): The query to retrieve context for.
|
|
125
|
+
simple_mode (Optional[bool]): If provided, overrides the instance's simple_mode setting.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
List[str]: A list of the most relevant context strings.
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
Exception: If there's an error during context retrieval.
|
|
132
|
+
"""
|
|
118
133
|
|
|
119
134
|
if simple_mode is None:
|
|
120
135
|
simple_mode = self.simple_mode
|
|
@@ -191,6 +206,10 @@ class GithubRAG:
|
|
|
191
206
|
"""
|
|
192
207
|
Retrieve context from GitHub code, issue and repo search based on the input query.
|
|
193
208
|
|
|
209
|
+
This method serves as a wrapper for the async_retrieve_context method,
|
|
210
|
+
handling the asynchronous call in different runtime environments (e.g., Jupyter notebook,
|
|
211
|
+
asyncio event loop).
|
|
212
|
+
|
|
194
213
|
Args:
|
|
195
214
|
query (str): The query or question to retrieve context for.
|
|
196
215
|
simple_mode (Optional[bool]): If provided, overrides the instance's simple_mode setting.
|
|
@@ -212,6 +231,24 @@ class GithubRAG:
|
|
|
212
231
|
return self.loop.run_until_complete(self.async_retrieve_context(query, simple_mode=effective_simple_mode))
|
|
213
232
|
|
|
214
233
|
async def code_search_retrieval(self, query, draft_answer: Optional[str] = None):
|
|
234
|
+
"""
|
|
235
|
+
Perform a code search on GitHub based on the given query and draft answer.
|
|
236
|
+
|
|
237
|
+
This method uses the RAG processor to generate search criteria, then performs
|
|
238
|
+
a code search using the GitHub API. It filters and deduplicates the results
|
|
239
|
+
based on star count and relevance.
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
query (str): The main query for the code search.
|
|
243
|
+
draft_answer (Optional[str]): A draft answer to refine the search criteria.
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
list: A list of unique, relevant code search results.
|
|
247
|
+
|
|
248
|
+
Raises:
|
|
249
|
+
Exception: If there's an error during the code search retrieval.
|
|
250
|
+
"""
|
|
251
|
+
|
|
215
252
|
result = []
|
|
216
253
|
try:
|
|
217
254
|
logger.info("Retrieving code search...")
|
|
@@ -238,6 +275,24 @@ class GithubRAG:
|
|
|
238
275
|
return result
|
|
239
276
|
|
|
240
277
|
async def issue_search_retrieval(self, query, draft_answer: Optional[str] = None):
|
|
278
|
+
"""
|
|
279
|
+
Perform an issue search on GitHub based on the given query and draft answer.
|
|
280
|
+
|
|
281
|
+
This method uses the RAG processor to generate search criteria, then performs
|
|
282
|
+
an issue search using the GitHub API. It deduplicates the results and transforms
|
|
283
|
+
the API URLs to official GitHub issue webpage URLs.
|
|
284
|
+
|
|
285
|
+
Args:
|
|
286
|
+
query (str): The main query for the issue search.
|
|
287
|
+
draft_answer (Optional[str]): A draft answer to refine the search criteria.
|
|
288
|
+
|
|
289
|
+
Returns:
|
|
290
|
+
list: A list of unique, relevant issue search results with transformed URLs.
|
|
291
|
+
|
|
292
|
+
Raises:
|
|
293
|
+
Exception: If there's an error during the issue search retrieval.
|
|
294
|
+
"""
|
|
295
|
+
|
|
241
296
|
result = []
|
|
242
297
|
try:
|
|
243
298
|
logger.info("Retrieving issue search...")
|
|
@@ -268,6 +323,23 @@ class GithubRAG:
|
|
|
268
323
|
return result
|
|
269
324
|
|
|
270
325
|
async def google_search_retrieval(self, query):
|
|
326
|
+
"""
|
|
327
|
+
Perform a Google search for GitHub-related content based on the given query.
|
|
328
|
+
|
|
329
|
+
This method uses the Jina AI search API to perform a Google search limited to
|
|
330
|
+
GitHub.com. It then retrieves the content of the resulting GitHub URLs using
|
|
331
|
+
the GitHub API.
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
query (str): The query to search for on Google.
|
|
335
|
+
|
|
336
|
+
Returns:
|
|
337
|
+
list: A list of dictionaries containing the GitHub URL and its content.
|
|
338
|
+
|
|
339
|
+
Raises:
|
|
340
|
+
Exception: If there's an error during the Google search retrieval.
|
|
341
|
+
"""
|
|
342
|
+
|
|
271
343
|
result = []
|
|
272
344
|
try:
|
|
273
345
|
logger.info("Retrieving google search...")
|
|
@@ -304,15 +376,39 @@ class GithubRAG:
|
|
|
304
376
|
|
|
305
377
|
def _get_repository_rag_info(self, repository: Repository):
|
|
306
378
|
"""
|
|
307
|
-
|
|
379
|
+
Retrieve RAG-related information for a given repository.
|
|
380
|
+
|
|
381
|
+
This helper method fetches the README content and a simple structure
|
|
382
|
+
of the repository using the Repository object.
|
|
383
|
+
|
|
384
|
+
Args:
|
|
385
|
+
repository (Repository): The Repository object to get information from.
|
|
308
386
|
|
|
309
|
-
:
|
|
310
|
-
|
|
387
|
+
Returns:
|
|
388
|
+
tuple: A tuple containing the repository's README content and simple structure.
|
|
311
389
|
"""
|
|
312
|
-
|
|
390
|
+
|
|
313
391
|
return repository.get_readme(), self.rag_processor.get_repo_simple_structure(repository)
|
|
314
392
|
|
|
315
393
|
async def repo_search_retrieval(self, query, draft_answer: Optional[str] = None):
|
|
394
|
+
"""
|
|
395
|
+
Perform a repository search on GitHub based on the given query and draft answer.
|
|
396
|
+
|
|
397
|
+
This method uses the RAG processor to generate search criteria, then performs
|
|
398
|
+
a repository search using the GitHub API. It retrieves README content and
|
|
399
|
+
simple structure for each relevant repository concurrently.
|
|
400
|
+
|
|
401
|
+
Args:
|
|
402
|
+
query (str): The main query for the repository search.
|
|
403
|
+
draft_answer (Optional[str]): A draft answer to refine the search criteria.
|
|
404
|
+
|
|
405
|
+
Returns:
|
|
406
|
+
list: A list of dictionaries containing repository information and content.
|
|
407
|
+
|
|
408
|
+
Raises:
|
|
409
|
+
Exception: If there's an error during the repository search retrieval.
|
|
410
|
+
"""
|
|
411
|
+
|
|
316
412
|
result = []
|
|
317
413
|
results_with_index = []
|
|
318
414
|
try:
|
|
@@ -370,18 +466,20 @@ class GithubRAG:
|
|
|
370
466
|
"""
|
|
371
467
|
Generate an answer based on the given query and optional contexts.
|
|
372
468
|
|
|
373
|
-
This method
|
|
374
|
-
|
|
375
|
-
|
|
469
|
+
This method serves as a wrapper for the async_answer_with_context method,
|
|
470
|
+
handling the asynchronous call in different runtime environments (e.g., Jupyter notebook,
|
|
471
|
+
asyncio event loop).
|
|
376
472
|
|
|
377
473
|
Args:
|
|
378
474
|
query (str): The user's query.
|
|
379
475
|
contexts (Optional[List[Dict[str, Any]]]): Optional list of context dictionaries.
|
|
380
476
|
Each dictionary should contain 'content' and 'url' keys.
|
|
477
|
+
simple_mode (bool): Whether to use simple mode for context retrieval.
|
|
381
478
|
|
|
382
479
|
Returns:
|
|
383
480
|
str: The generated answer.
|
|
384
481
|
"""
|
|
482
|
+
|
|
385
483
|
self.loop = asyncio.get_event_loop()
|
|
386
484
|
ipython = get_ipython()
|
|
387
485
|
if ipython and ipython.has_trait('kernel'):
|
|
@@ -397,14 +495,19 @@ class GithubRAG:
|
|
|
397
495
|
"""
|
|
398
496
|
Asynchronously generate an answer based on the given query and optional contexts.
|
|
399
497
|
|
|
498
|
+
This method retrieves contexts if not provided, extracts relevant information,
|
|
499
|
+
and uses the RAG processor's LLM handler to generate an answer.
|
|
500
|
+
|
|
400
501
|
Args:
|
|
401
502
|
query (str): The user's query.
|
|
402
503
|
contexts (Optional[List[Dict[str, Any]]]): Optional list of context dictionaries.
|
|
403
504
|
Each dictionary should contain 'content' and 'url' keys.
|
|
505
|
+
simple_mode (bool): Whether to use simple mode for context retrieval.
|
|
404
506
|
|
|
405
507
|
Returns:
|
|
406
508
|
str: The generated answer.
|
|
407
509
|
"""
|
|
510
|
+
|
|
408
511
|
if contexts is None:
|
|
409
512
|
contexts = await self.async_retrieve_context(query, simple_mode)
|
|
410
513
|
logger.debug(f"Retrieved contexts: {contexts}")
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
# initial_load.py
|
|
2
|
-
import torch
|
|
3
2
|
from typing import Optional, Any
|
|
4
3
|
from threading import Lock
|
|
5
4
|
from langchain_openai import ChatOpenAI
|
|
6
|
-
from langchain_community.embeddings import HuggingFaceEmbeddings
|
|
7
|
-
from langchain_community.cross_encoders import HuggingFaceCrossEncoder
|
|
8
5
|
from langchain_mistralai.chat_models import ChatMistralAI
|
|
9
6
|
|
|
10
7
|
from llama_github.config.config import config
|
|
11
8
|
from llama_github.logger import logger
|
|
12
9
|
|
|
13
|
-
from transformers import AutoModel
|
|
14
|
-
from transformers import AutoModelForSequenceClassification
|
|
15
|
-
from transformers import AutoTokenizer
|
|
16
|
-
|
|
17
|
-
|
|
18
10
|
class LLMManager:
|
|
19
11
|
_instance_lock = Lock()
|
|
20
12
|
_instance = None
|
|
@@ -74,6 +66,10 @@ class LLMManager:
|
|
|
74
66
|
self.model_type = "Hubgingface"
|
|
75
67
|
|
|
76
68
|
if not self.simple_mode:
|
|
69
|
+
import torch
|
|
70
|
+
from transformers import AutoModel
|
|
71
|
+
from transformers import AutoModelForSequenceClassification
|
|
72
|
+
from transformers import AutoTokenizer
|
|
77
73
|
# initial model_kwargs
|
|
78
74
|
if torch.cuda.is_available():
|
|
79
75
|
self.device = torch.device('cuda')
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
logger = logging.getLogger('llama_github')
|
|
4
|
+
|
|
5
|
+
def configure_logging(level=logging.INFO, handler=None):
|
|
6
|
+
logger.setLevel(level)
|
|
7
|
+
if handler:
|
|
8
|
+
logger.addHandler(handler)
|
|
9
|
+
else:
|
|
10
|
+
# default handler output to console
|
|
11
|
+
ch = logging.StreamHandler()
|
|
12
|
+
ch.setLevel(level)
|
|
13
|
+
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
14
|
+
ch.setFormatter(formatter)
|
|
15
|
+
logger.addHandler(ch)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.1.5'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: llama-github
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
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
|
|
@@ -22,6 +22,11 @@ Requires-Dist: requests
|
|
|
22
22
|
Requires-Dist: torch
|
|
23
23
|
Requires-Dist: transformers
|
|
24
24
|
Requires-Dist: urllib3
|
|
25
|
+
Requires-Dist: pydantic_core
|
|
26
|
+
Requires-Dist: langchain_openai
|
|
27
|
+
Requires-Dist: langchain_mistralai
|
|
28
|
+
Requires-Dist: httpx_sse
|
|
29
|
+
Requires-Dist: tokenizers
|
|
25
30
|
Provides-Extra: dev
|
|
26
31
|
Requires-Dist: pytest; extra == "dev"
|
|
27
32
|
Requires-Dist: black; extra == "dev"
|
|
@@ -133,6 +138,20 @@ All notable changes to this project will be documented in this file.
|
|
|
133
138
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
134
139
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
135
140
|
|
|
141
|
+
## [0.1.5] - 2024-10-14
|
|
142
|
+
|
|
143
|
+
### Optimized
|
|
144
|
+
- requirements.txt updated to more precise list
|
|
145
|
+
|
|
146
|
+
## [0.1.4] - 2024-10-14
|
|
147
|
+
|
|
148
|
+
### Improved
|
|
149
|
+
- Optimized `simple_mode`:
|
|
150
|
+
- Removed dependencies on `Torch` and `Transformers` libraries
|
|
151
|
+
- Reduced memory footprint
|
|
152
|
+
- Eliminated related imports
|
|
153
|
+
- Enhanced compatibility with AWS Lambda environment
|
|
154
|
+
|
|
136
155
|
## [0.1.3] - 2024-10-14
|
|
137
156
|
|
|
138
157
|
### Added
|
|
@@ -191,6 +210,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
191
210
|
- Basic functionality for retrieving context from GitHub repositories
|
|
192
211
|
- Integration with LLM for processing and generating responses
|
|
193
212
|
|
|
213
|
+
[0.1.4]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.3...v0.1.4
|
|
194
214
|
[0.1.3]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.2...v0.1.3
|
|
195
215
|
[0.1.2]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.1...v0.1.2
|
|
196
216
|
[0.1.1]: https://github.com/JetXu-LLM/llama-github/compare/v0.1.0...v0.1.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = llama-github
|
|
3
|
-
version = 0.1.
|
|
3
|
+
version = 0.1.5
|
|
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,28 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
|
-
logger = logging.getLogger('llama_github')
|
|
4
|
-
|
|
5
|
-
def configure_logging(level=logging.INFO, handler=None):
|
|
6
|
-
logger.setLevel(level)
|
|
7
|
-
if handler:
|
|
8
|
-
logger.addHandler(handler)
|
|
9
|
-
else:
|
|
10
|
-
# default handler output to console
|
|
11
|
-
ch = logging.StreamHandler()
|
|
12
|
-
ch.setLevel(level)
|
|
13
|
-
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
14
|
-
ch.setFormatter(formatter)
|
|
15
|
-
logger.addHandler(ch)
|
|
16
|
-
|
|
17
|
-
## Logging Configuration
|
|
18
|
-
# By default, `llama_github` does not configure logging to avoid interfering with your application's logging settings. If you want to see log outputs from `llama_github`, you can configure logging as follows:
|
|
19
|
-
|
|
20
|
-
# ```python
|
|
21
|
-
# import logging
|
|
22
|
-
# import llama_github
|
|
23
|
-
|
|
24
|
-
# # Configure the library's logger
|
|
25
|
-
# llama_github.configure_logging(level=logging.INFO)
|
|
26
|
-
|
|
27
|
-
# # Now you can see log outputs
|
|
28
|
-
# logger = logging.getLogger('llama_github')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.1.3'
|
|
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
|
{llama_github-0.1.3 → llama_github-0.1.5}/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
|