Skip to content

Commit e7e502e

Browse files
authored
Merge pull request #575 from SwapnilChand/patch-8
[docs]: SDK Reference feature wise division, and Image fixes
2 parents c64336e + afcd962 commit e7e502e

File tree

12 files changed

+204
-201
lines changed

12 files changed

+204
-201
lines changed

docs/pages/features/code_scan.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Comprehensive static code analysis to identify potential issues, vulnerabilities
2020
- The Code Scanner employs advanced algorithms and AI to analyze the code and generate a detailed report of findings.
2121
- The scanner identifies potential issues, vulnerabilities, and areas for improvement in your codebase.
2222

23-
![Code Scan Analysis Workflow](/code_scan_analysis_workflow.png.)
23+
![Code Scan Analysis Workflow](/code_scan_workflow.png)
2424

2525
You can find an example [here](https://github.com/Cloud-Code-AI/kaizen/tree/main/examples/code_scan/main.py)
2626

docs/pages/features/ui_review.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ AI-powered analysis and feedback for improving user experience and accessibility
2121
- The UI Reviewer leverages advanced language models to analyze the code and generate a detailed report of findings.
2222
- The scanner identifies potential issues, accessibility issues, and areas for improvement in your UI.
2323

24-
![UI Review Analysis Workflow](/ui_review_analysis_workflow.png.)
24+
![UI Review Analysis Workflow](/ui_review_workflow.png)
2525

2626
You can find an example [here](https://github.com/Cloud-Code-AI/kaizen/tree/main/examples/ui_review/main.py)
2727

docs/pages/sdk_reference.mdx

Lines changed: 3 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -1,203 +1,7 @@
11
This reference documents every object and method available in Kaizen’s SDK and API.
22

3-
For a step-by-step guide on how to use Kaizen, check out the [Getting Started](../getting_started).
3+
For a step-by-step guide on how to use Kaizen, check out the [initial setup guide](/initial_setup_guide).
44

5-
## Code Reviewer
5+
For a quickstart, you can instead checkout [kaizen.cloudcode.ai](https://kaizen.cloudcode.ai) to get started with Kaizen in a few clicks.
66

7-
### Class: CodeReviewer
8-
9-
#### Constructor
10-
11-
- `__init__(self, llm_provider: LLMProvider)`
12-
Initializes the CodeReviewer with the provided LLM provider.
13-
14-
#### Methods
15-
16-
##### review_pull_request
17-
18-
- `review_pull_request(self, diff_text: str, pull_request_title: str, pull_request_desc: str, pull_request_files: List[Dict], reeval_response: bool = False) -> ReviewData`
19-
Reviews a pull request and generates feedback.
20-
- Parameters:
21-
- `diff_text`: The diff text of the pull request.
22-
- `pull_request_title`: The title of the pull request.
23-
- `pull_request_desc`: The description of the pull request.
24-
- `pull_request_files`: List of files changed in the pull request.
25-
- `reeval_response`: Whether to re-evaluate the response.
26-
- Returns: ReviewData object containing the review results.
27-
28-
### Class: PRDescriptionGenerator
29-
30-
#### Constructor
31-
32-
- `__init__(self, llm_provider: LLMProvider)`
33-
Initializes the PRDescriptionGenerator with the provided LLM provider.
34-
35-
#### Methods
36-
37-
##### generate_pull_request_desc
38-
39-
- `generate_pull_request_desc(self, diff_text: str, pull_request_title: str, pull_request_desc: str, pull_request_files: List[Dict], user: str) -> str`
40-
Generates a description for a pull request.
41-
- Parameters:
42-
- `diff_text`: The diff text of the pull request.
43-
- `pull_request_title`: The title of the pull request.
44-
- `pull_request_desc`: The existing description of the pull request.
45-
- `pull_request_files`: List of files changed in the pull request.
46-
- `user`: The user or context for generating the description.
47-
- Returns: A string containing the generated pull request description.
48-
49-
## Unit Test generator
50-
51-
52-
### Class: UnitTestGenerator
53-
54-
#### Constructor
55-
56-
- `__init__(self, verbose=False)`
57-
Initializes the UnitTestGenerator with optional verbosity setting.
58-
59-
#### Methods
60-
61-
##### generate_tests_from_dir
62-
63-
- `generate_tests_from_dir(self, dir_path: str, output_path: str = None)`
64-
Generates unit tests for all supported files in a given directory.
65-
- Parameters:
66-
- `dir_path`: Path of the directory containing source files.
67-
- `max_critique`: Maximum number of critique iterations.
68-
- `output_path`: (Optional) Custom output path for generated tests.
69-
- `verbose`: Enable verbose logging.
70-
- `enable_critique`: Enable AI critique and improvement of generated tests.
71-
- Returns: A tuple containing an empty dictionary and llm usage statistics.
72-
73-
##### generate_tests
74-
75-
- `generate_tests(self, file_path: str, content: str = None, max_critique: int = 3, output_path: str = None, verbose: bool = False, enable_critique: bool = False)`
76-
Generates unit tests for a given file with various configuration options.
77-
- Parameters:
78-
- `file_path`: Path of the file relative to the project root.
79-
- `content`: (Optional) File content.
80-
- `max_critique`: Maximum number of critique iterations.
81-
- `output_path`: (Optional) Custom output path for generated tests.
82-
- `verbose`: Enable verbose logging.
83-
- `enable_critique`: Enable AI critique and improvement of generated tests.
84-
- Returns: A tuple containing an empty dictionary and llm usage statistics.
85-
86-
##### run_tests
87-
88-
- `run_tests(self) -> Dict`
89-
Runs the generated unit tests and returns the results.
90-
91-
92-
93-
## Code Scanner
94-
95-
### Class: CodeScanner
96-
97-
#### Constructor
98-
99-
- `__init__(self, llm_provider: LLMProvider)`
100-
Initializes the CodeScanner with the provided LLM provider.
101-
102-
#### Methods
103-
104-
##### review_code
105-
106-
- `review_code(self, file_data: str, user: str) -> ReviewData`
107-
Performs a code review on a single file.
108-
- Parameters:
109-
- `file_data`: Content of the file to be reviewed.
110-
- `user`: Username or project identifier.
111-
- Returns: ReviewData object containing the review results.
112-
113-
##### review_code_dir
114-
115-
- `review_code_dir(self, dir_path: str, reevaluate: bool = False, user: str) -> ReviewData`
116-
Performs a code review on all files in a directory.
117-
- Parameters:
118-
- `dir_path`: Path to the directory containing the files to be reviewed.
119-
- `reevaluate`: Whether to reevaluate previously scanned files.
120-
- `user`: Username or project identifier.
121-
- Returns: ReviewData object containing the review results for all files.
122-
123-
## UI Reviewer
124-
### Class: UIReviewer
125-
126-
#### Constructor
127-
128-
- `__init__(self, llm_provider: LLMProvider)`:
129-
Initializes the UI Reviewer with the provided LLM provider.
130-
131-
#### Methods
132-
133-
##### generate_ui_review
134-
135-
- `generate_ui_review(self, url: str = None, html_content: str = None) -> Dict`
136-
Performs a UI review on a given URL or HTML code.
137-
- Parameters:
138-
- `url`: URL of the web page to be reviewed.
139-
- `html_code`: HTML code to be reviewed.
140-
- Returns: A dictionary containing the review results.
141-
142-
## End to End Test Generator
143-
144-
### Class: E2ETestGenerator
145-
146-
#### Constructor
147-
148-
- `__init__(self)`
149-
Initializes the E2ETestGenerator.
150-
151-
#### Methods
152-
153-
##### generate_e2e_tests
154-
155-
- `generate_e2e_tests(self, url: str) -> Tuple[List[Dict], Dict]`
156-
Generates E2E UI tests for the given URL.
157-
- Parameters:
158-
- `url`: URL of the web application to test.
159-
- Returns: A tuple containing a list of generated tests and LLM usage statistics.
160-
161-
##### run_tests
162-
163-
- `run_tests(self) -> Dict`
164-
Runs the generated E2E UI tests.
165-
- Returns: A dictionary containing test execution results.
166-
167-
## Work Summary Generator
168-
169-
### Class: WorkSummaryGenerator
170-
171-
#### Constructor
172-
173-
- `__init__(self)`
174-
Initializes the WorkSummaryGenerator.
175-
176-
#### Methods
177-
178-
##### generate_work_summaries
179-
180-
- `generate_work_summaries(self, file_diffs: List[Dict], user: str) -> Dict`
181-
Generates a work summary from the provided file diffs.
182-
- Parameters:
183-
- `file_diffs`: List of dictionaries containing file diff information.
184-
- `user`: Username or identifier for the user generating the summary.
185-
- Returns: A dictionary containing the generated summary and other relevant information.
186-
187-
##### generate_twitter_post
188-
189-
- `generate_twitter_post(self, summary: str, user: str) -> Tuple[str, Dict]`
190-
Generates a Twitter post based on the work summary.
191-
- Parameters:
192-
- `summary`: The generated work summary.
193-
- `user`: Username or identifier for the user generating the post.
194-
- Returns: A tuple containing the generated Twitter post and LLM usage statistics.
195-
196-
##### generate_linkedin_post
197-
198-
- `generate_linkedin_post(self, summary: str, user: str) -> Tuple[str, Dict]`
199-
Generates a LinkedIn post based on the work summary.
200-
- Parameters:
201-
- `summary`: The generated work summary.
202-
- `user`: Username or identifier for the user generating the post.
203-
- Returns: A tuple containing the generated LinkedIn post and LLM usage statistics.
7+
For a deploying Kaizen on your own infrastructure, check out the [self-hosting guide](/self_hosting_guide).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"code_review": "Code Review",
3+
"unit_test": "Unit Tests",
4+
"code_scan": "Code Scan",
5+
"ui_review": "UI Review",
6+
"e2e_testing": "End to End Testing",
7+
"work_summary": "Work Summary"
8+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Code Reviewer
2+
3+
### Class: CodeReviewer
4+
5+
#### Constructor
6+
7+
- `__init__(self, llm_provider: LLMProvider)`
8+
Initializes the CodeReviewer with the provided LLM provider.
9+
10+
#### Methods
11+
12+
##### review_pull_request
13+
14+
- `review_pull_request(self, diff_text: str, pull_request_title: str, pull_request_desc: str, pull_request_files: List[Dict], reeval_response: bool = False) -> ReviewData`
15+
Reviews a pull request and generates feedback.
16+
- Parameters:
17+
- `diff_text`: The diff text of the pull request.
18+
- `pull_request_title`: The title of the pull request.
19+
- `pull_request_desc`: The description of the pull request.
20+
- `pull_request_files`: List of files changed in the pull request.
21+
- `reeval_response`: Whether to re-evaluate the response.
22+
- Returns: ReviewData object containing the review results.
23+
24+
### Class: PRDescriptionGenerator
25+
26+
#### Constructor
27+
28+
- `__init__(self, llm_provider: LLMProvider)`
29+
Initializes the PRDescriptionGenerator with the provided LLM provider.
30+
31+
#### Methods
32+
33+
##### generate_pull_request_desc
34+
35+
- `generate_pull_request_desc(self, diff_text: str, pull_request_title: str, pull_request_desc: str, pull_request_files: List[Dict], user: str) -> str`
36+
Generates a description for a pull request.
37+
- Parameters:
38+
- `diff_text`: The diff text of the pull request.
39+
- `pull_request_title`: The title of the pull request.
40+
- `pull_request_desc`: The existing description of the pull request.
41+
- `pull_request_files`: List of files changed in the pull request.
42+
- `user`: The user or context for generating the description.
43+
- Returns: A string containing the generated pull request description.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Code Scanner
2+
3+
### Class: CodeScanner
4+
5+
#### Constructor
6+
7+
- `__init__(self, llm_provider: LLMProvider)`
8+
Initializes the CodeScanner with the provided LLM provider.
9+
10+
#### Methods
11+
12+
##### review_code
13+
14+
- `review_code(self, file_data: str, user: str) -> ReviewData`
15+
Performs a code review on a single file.
16+
- Parameters:
17+
- `file_data`: Content of the file to be reviewed.
18+
- `user`: Username or project identifier.
19+
- Returns: ReviewData object containing the review results.
20+
21+
##### review_code_dir
22+
23+
- `review_code_dir(self, dir_path: str, reevaluate: bool = False, user: str) -> ReviewData`
24+
Performs a code review on all files in a directory.
25+
- Parameters:
26+
- `dir_path`: Path to the directory containing the files to be reviewed.
27+
- `reevaluate`: Whether to reevaluate previously scanned files.
28+
- `user`: Username or project identifier.
29+
- Returns: ReviewData object containing the review results for all files.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## End to End Test Generator
2+
3+
### Class: E2ETestGenerator
4+
5+
#### Constructor
6+
7+
- `__init__(self)`
8+
Initializes the E2ETestGenerator.
9+
10+
#### Methods
11+
12+
##### generate_e2e_tests
13+
14+
- `generate_e2e_tests(self, url: str) -> Tuple[List[Dict], Dict]`
15+
Generates E2E UI tests for the given URL.
16+
- Parameters:
17+
- `url`: URL of the web application to test.
18+
- Returns: A tuple containing a list of generated tests and LLM usage statistics.
19+
20+
##### run_tests
21+
22+
- `run_tests(self) -> Dict`
23+
Runs the generated E2E UI tests.
24+
- Returns: A dictionary containing test execution results.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## UI Reviewer
2+
### Class: UIReviewer
3+
4+
#### Constructor
5+
6+
- `__init__(self, llm_provider: LLMProvider)`:
7+
Initializes the UI Reviewer with the provided LLM provider.
8+
9+
#### Methods
10+
11+
##### generate_ui_review
12+
13+
- `generate_ui_review(self, url: str = None, html_content: str = None) -> Dict`
14+
Performs a UI review on a given URL or HTML code.
15+
- Parameters:
16+
- `url`: URL of the web page to be reviewed.
17+
- `html_code`: HTML code to be reviewed.
18+
- Returns: A dictionary containing the review results.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Unit Test Generator
2+
3+
### Class: UnitTestGenerator
4+
5+
#### Constructor
6+
7+
- `__init__(self, verbose=False)`
8+
Initializes the UnitTestGenerator with optional verbosity setting.
9+
10+
#### Methods
11+
12+
##### generate_tests_from_dir
13+
14+
- `generate_tests_from_dir(self, dir_path: str, output_path: str = None)`
15+
Generates unit tests for all supported files in a given directory.
16+
- Parameters:
17+
- `dir_path`: Path of the directory containing source files.
18+
- `max_critique`: Maximum number of critique iterations.
19+
- `output_path`: (Optional) Custom output path for generated tests.
20+
- `verbose`: Enable verbose logging.
21+
- `enable_critique`: Enable AI critique and improvement of generated tests.
22+
- Returns: A tuple containing an empty dictionary and llm usage statistics.
23+
24+
##### generate_tests
25+
26+
- `generate_tests(self, file_path: str, content: str = None, max_critique: int = 3, output_path: str = None, verbose: bool = False, enable_critique: bool = False)`
27+
Generates unit tests for a given file with various configuration options.
28+
- Parameters:
29+
- `file_path`: Path of the file relative to the project root.
30+
- `content`: (Optional) File content.
31+
- `max_critique`: Maximum number of critique iterations.
32+
- `output_path`: (Optional) Custom output path for generated tests.
33+
- `verbose`: Enable verbose logging.
34+
- `enable_critique`: Enable AI critique and improvement of generated tests.
35+
- Returns: A tuple containing an empty dictionary and llm usage statistics.
36+
37+
##### run_tests
38+
39+
- `run_tests(self) -> Dict`
40+
Runs the generated unit tests and returns the results.

0 commit comments

Comments
 (0)