Skip to content

Commit

Permalink
Refactor APIClient to include repo details in file generation request
Browse files Browse the repository at this point in the history
  • Loading branch information
sumansaurabh committed Aug 25, 2024
1 parent 2ef4225 commit a23ab49
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include penify_hook/*.py
11 changes: 11 additions & 0 deletions penify_hook/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ def get_supported_file_types(self) -> list[str]:
return ["py", "js", "ts", "java", "kt", "cs", "c"]

def generate_commit_summary(self, git_diff, instruction: str = "", repo_details = None):
"""
Generates a commit summary by sending a POST request to the API endpoint.
Args:
git_diff (str): The git diff of the commit.
instruction (str, optional): Additional instruction for the commit. Defaults to "".
repo_details (dict, optional): Details of the git repository. Defaults to None.
Returns:
dict: The response from the API if the request is successful, None otherwise.
"""
payload = {
'git_diff': git_diff,
'additional_instruction': instruction
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

setup(
name="penify-cli",
version="0.1.0",
packages=find_packages(),
version="0.1.1", # Increment the version number
packages=['penify_hook'], # Explicitly include the penify_hook package
install_requires=[
"requests",
"tqdm",
Expand All @@ -26,4 +26,4 @@
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)
)

0 comments on commit a23ab49

Please sign in to comment.