Ranajit1997 commited on
Commit
925a61b
Β·
1 Parent(s): bf9b8fe

changes in Readme.md

Browse files
Files changed (1) hide show
  1. README.md +55 -19
README.md CHANGED
@@ -1,17 +1,35 @@
1
- # πŸ” Red AI Code Reviewer
2
 
3
  An RedAI-powered code review tool using OpenAI GPT models to analyze and improve your code quality.
 
4
 
5
- ## Features
6
 
7
- - πŸ“Š **Code Quality Analysis** - Get readability scores and overall quality assessment
8
- - πŸ› **Bug Detection** - Identify potential bugs and issues
9
- - ⚑ **Optimization Suggestions** - Get performance improvement tips
10
- - πŸ”’ **Security Review** - Detect security vulnerabilities
11
- - πŸ”„ **Code Refactoring** - Receive improved code versions
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ## Installation
14
 
 
 
 
15
 
16
 
17
  Load and use directly from Hugging Face Hub!
@@ -19,24 +37,42 @@ Load and use directly from Hugging Face Hub!
19
  ## Quick Start
20
 
21
  ```python
22
- from huggingface_hub import from_pretrained
23
- import os
 
 
 
 
 
 
 
 
 
24
 
25
- # Set your OpenAI API key
26
- os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
27
 
28
- # Load directly from Hugging Face Hub
29
- pipeline = from_pretrained("Ranajit1997/red-ai-code-reviewer")
 
30
 
31
- # Use it!
 
 
 
 
 
32
  code = """
33
- def calculate_factorial(n):
34
  if n == 0:
35
  return 1
36
  else:
37
- return n * calculate_factorial(n-1)
38
  """
39
 
40
- result = pipeline(code)
41
- print(f"Score: {result['overall_score']}")
42
- print(f"Readability: {result['readability']}")
 
 
 
 
 
1
+ # Red AI Code Reviewer
2
 
3
  An RedAI-powered code review tool using OpenAI GPT models to analyze and improve your code quality.
4
+ developed by Ranajit Sahoo (Software developer at **Redintegro** ).
5
 
 
6
 
7
+ #### click https://huggingface.co/Ranajit1997/red-ai-code-reviewer/tree/main on this link to check the code
 
 
 
 
8
 
9
+ ## ✨ Features
10
+ πŸ€– **AI-Powered Analysis** - Uses OpenAI's advanced language models for comprehensive code review
11
+
12
+ πŸ“Š **Multi-dimensional Review** - Evaluates readability, bugs, optimizations, security, and more
13
+
14
+ πŸ”„ **Code Refactoring** - Suggests improved code versions with detailed explanations
15
+
16
+ 🎯 **Overall Scoring** - Provides quantitative score (0-100) for code quality assessment
17
+
18
+ πŸš€ **Easy Integration** - Simple Python API for quick implementation
19
+
20
+ πŸ” **Security Scanning** - Identifies potential security vulnerabilities
21
+
22
+ ⚑ **Performance Optimization** - Suggests performance improvements
23
+
24
+
25
+
26
+
27
+ ## Installation
28
  ## Installation
29
 
30
+ ```bash
31
+ # Install required dependencies
32
+ pip install huggingface_hub openai
33
 
34
 
35
  Load and use directly from Hugging Face Hub!
 
37
  ## Quick Start
38
 
39
  ```python
40
+ from huggingface_hub import snapshot_download
41
+ import sys, os
42
+
43
+ # Set OpenAI key (if not set in terminal)
44
+ os.environ["OPENAI_API_KEY"] = "sk-your-openai-key-here"
45
+
46
+ # Download repo from Hugging Face
47
+ repo_dir = snapshot_download("Ranajit1997/red-ai-code-reviewer")
48
+
49
+ # Add repo folder to Python path
50
+ package_dir = os.path.join(repo_dir, "red_ai_code_reviewer") # folder with model.py, pipeline.py, __init__.py
51
 
52
+ sys.path.append(package_dir)
 
53
 
54
+ # 4️⃣ Import classes directly from files
55
+ from model import CodeReviewerModel
56
+ from pipeline import CodeReviewerPipeline
57
 
58
+ # 5️⃣ Initialize
59
+ model = CodeReviewerModel(api_key="sk-your-openai-key-here",
60
+ )
61
+ reviewer = CodeReviewerPipeline(model)
62
+
63
+ # 6️⃣ Example code
64
  code = """
65
+ def factorial(n):
66
  if n == 0:
67
  return 1
68
  else:
69
+ return n * factorial(n-1)
70
  """
71
 
72
+ # 7️⃣ Run review
73
+ review = reviewer(code)
74
+
75
+ # 8️⃣ Print result
76
+ print("AI Review:\n", review)
77
+
78
+