├── requirements.txt ├── ai_changelog ├── __init__.py ├── string_templates.py ├── pydantic_models.py ├── __main__.py └── utils.py ├── .github ├── pull_request_template.md ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── dependabot.yml └── workflows │ ├── docker-hub.yml │ ├── bumpver.yml │ ├── ai_changelog_main_push.yml │ └── publish_on_pypi.yml ├── Dockerfile ├── LICENSE ├── .gitignore ├── pyproject.toml ├── .pre-commit-config.yaml ├── README.md ├── AI_CHANGELOG-claude-2.md └── AI_CHANGELOG.md /requirements.txt: -------------------------------------------------------------------------------- 1 | anthropic==0.25.1 2 | langchain==0.1.16 3 | langchainhub==0.1.15 4 | openai==1.17.1 5 | pydantic==2.7.0 6 | -------------------------------------------------------------------------------- /ai_changelog/__init__.py: -------------------------------------------------------------------------------- 1 | from ai_changelog.pydantic_models import Commit, CommitInfo, CommitDescription 2 | from ai_changelog.utils import get_commits, update_changelog 3 | 4 | __version__ = "0.0.14" 5 | 6 | __all__ = [ 7 | "Commit", 8 | "CommitInfo", 9 | "CommitDescription", 10 | "get_commits", 11 | "update_changelog", 12 | ] 13 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Thank you for contributing! 2 | Before submitting this PR, please make sure: 3 | 4 | - [ ] Your code builds clean without any errors or warnings 5 | - [ ] Your code doesn't break anything we can't fix 6 | - [ ] You have added appropriate tests 7 | 8 | Please check one or more of the following to describe the nature of this PR: 9 | - [ ] New feature 10 | - [ ] Bug fix 11 | - [ ] Documentation 12 | - [ ] Other 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "pip" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | groups: 13 | app: 14 | patterns: 15 | - "*" 16 | -------------------------------------------------------------------------------- /ai_changelog/string_templates.py: -------------------------------------------------------------------------------- 1 | sys_msg = """ 2 | You are a senior developer tasked with code review and devops. 3 | You are reviewing commits from a junior developer. 4 | You want to demonstrate how to craft meaningful descriptions that are concise and easy to understand. 5 | Interpret the commit and diff messages below to create descriptions for each commit. 6 | For each commit, return one short description and one long description. 7 | Do not provide any commentary outside of the structured output. 8 | """.strip() 9 | 10 | 11 | hum_msg = "{diff}" 12 | 13 | 14 | markdown_template = """ 15 | ## [{short_description}](https://github.com/{repo_name}/commit/{commit_hash}) 16 | {date_time_str} 17 | {bullet_points} 18 | """.strip() 19 | -------------------------------------------------------------------------------- /.github/workflows/docker-hub.yml: -------------------------------------------------------------------------------- 1 | name: Push to Docker Hub 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*.*.*' 7 | 8 | jobs: 9 | build-and-push-docker: 10 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Log in to Docker Hub 16 | uses: docker/login-action@v1 17 | with: 18 | username: joshuasundance 19 | password: ${{ secrets.DOCKERHUB_TOKEN }} 20 | 21 | - name: Build Docker image 22 | run: | 23 | docker build \ 24 | -t joshuasundance/ai_changelog:${{ github.ref_name }} \ 25 | -t joshuasundance/ai_changelog:latest \ 26 | . 27 | 28 | - name: Push to Docker Hub 29 | run: docker push -a joshuasundance/ai_changelog 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim-buster 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends git && \ 4 | rm -rf /var/lib/apt/lists/* 5 | 6 | RUN adduser --uid 1000 --disabled-password --gecos '' appuser 7 | USER 1000 8 | 9 | ENV PYTHONDONTWRITEBYTECODE=1 \ 10 | PYTHONUNBUFFERED=1 \ 11 | PATH="/home/appuser/.local/bin:$PATH" 12 | 13 | WORKDIR /home/appuser/ai_changelog 14 | 15 | RUN pip install --user --no-cache-dir --upgrade pip 16 | COPY ./requirements.txt /home/appuser/ai_changelog/requirements.txt 17 | RUN python -m pip install --user --no-cache-dir --upgrade -r /home/appuser/ai_changelog/requirements.txt 18 | 19 | RUN git config --global --add safe.directory "*" 20 | 21 | COPY ./pyproject.toml /home/appuser/ai_changelog/pyproject.toml 22 | COPY ./README.md /home/appuser/ai_changelog/README.md 23 | COPY ./ai_changelog /home/appuser/ai_changelog/ai_changelog 24 | 25 | RUN python -m pip install --user --no-cache-dir /home/appuser/ai_changelog 26 | 27 | WORKDIR /home/appuser/ 28 | 29 | ENTRYPOINT ["ai_changelog"] 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Joshua Sundance Bailey 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/bumpver.yml: -------------------------------------------------------------------------------- 1 | name: Bump Version 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | bump: 7 | type: choice 8 | description: 'Bump major, minor, or patch version' 9 | required: true 10 | default: 'patch' 11 | options: 12 | - 'major' 13 | - 'minor' 14 | - 'patch' 15 | 16 | jobs: 17 | bump-version: 18 | runs-on: ubuntu-latest 19 | permissions: 20 | contents: write 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v4 24 | with: 25 | token: ${{ secrets.PAT }} 26 | fetch-depth: 0 27 | - name: Set up Python 28 | uses: actions/setup-python@v4 29 | with: 30 | python-version: 3.11 31 | cache: pip 32 | - name: Install Python libraries 33 | run: | 34 | pip install --user bumpver 35 | - name: git config 36 | run: | 37 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 38 | git config --local user.name "github-actions[bot]" 39 | - name: Bump version 40 | run: bumpver update --commit --tag-commit --${{ github.event.inputs.bump }} --push 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *$py.class 2 | *.chainlit 3 | *.chroma 4 | *.cover 5 | *.egg 6 | *.egg-info/ 7 | *.env 8 | *.langchain.db 9 | *.log 10 | *.manifest 11 | *.mo 12 | *.pot 13 | *.py,cover 14 | *.py[cod] 15 | *.sage.py 16 | *.so 17 | *.spec 18 | .DS_STORE 19 | .Python 20 | .cache 21 | .coverage 22 | .coverage.* 23 | .dmypy.json 24 | .eggs/ 25 | .env 26 | .hypothesis/ 27 | .installed.cfg 28 | .ipynb_checkpoints 29 | .mypy_cache/ 30 | .nox/ 31 | .pyre/ 32 | .pytest_cache/ 33 | .python-version 34 | .ropeproject 35 | .ruff_cache/ 36 | .scrapy 37 | .spyderproject 38 | .spyproject 39 | .tox/ 40 | .venv 41 | .vscode 42 | .webassets-cache 43 | /site 44 | ENV/ 45 | MANIFEST 46 | __pycache__ 47 | __pycache__/ 48 | __pypackages__/ 49 | build/ 50 | celerybeat-schedule 51 | celerybeat.pid 52 | coverage.xml 53 | credentials.json 54 | data/ 55 | db.sqlite3 56 | db.sqlite3-journal 57 | develop-eggs/ 58 | dist/ 59 | dmypy.json 60 | docs/_build/ 61 | downloads/ 62 | eggs/ 63 | env.bak/ 64 | env/ 65 | fly.toml 66 | htmlcov/ 67 | instance/ 68 | ipython_config.py 69 | junk/ 70 | lib/ 71 | lib64/ 72 | local_settings.py 73 | models/*.bin 74 | nosetests.xml 75 | notebooks/scratch/ 76 | parts/ 77 | pip-delete-this-directory.txt 78 | pip-log.txt 79 | pip-wheel-metadata/ 80 | profile_default/ 81 | sdist/ 82 | share/python-wheels/ 83 | storage 84 | target/ 85 | token.json 86 | var/ 87 | venv 88 | venv.bak/ 89 | venv/ 90 | wheels/ 91 | .idea 92 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0.0", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "ai_changelog" 7 | version = "0.0.14" 8 | description = "A Python project that generates AI-based changelogs." 9 | authors = [{ name = "Joshua Sundance Bailey"}] 10 | readme = "README.md" 11 | dependencies = [ 12 | "langchain", 13 | "openai", 14 | "pydantic", 15 | ] 16 | license = { file = "LICENSE" } 17 | classifiers = [ 18 | "License :: OSI Approved :: MIT License", 19 | "Programming Language :: Python", 20 | "Programming Language :: Python :: 3", 21 | ] 22 | keywords = ["langchain", "changelog", "github", "openai", "developer-tools", "documentation"] 23 | requires-python = ">=3.7" 24 | [project.urls] 25 | Homepage = "https://github.com/joshuasundance-swca/ai_changelog" 26 | 27 | [project.scripts] 28 | ai_changelog = "ai_changelog.__main__:main" 29 | 30 | [project.optional-dependencies] 31 | dev = ["pre-commit", "bumpver"] 32 | 33 | [tool.bumpver] 34 | current_version = "0.0.14" 35 | version_pattern = "MAJOR.MINOR.PATCH" 36 | commit_message = "Bump version {old_version} -> {new_version}" 37 | tag_message = "{new_version}" 38 | tag_scope = "default" 39 | commit = true 40 | tag = true 41 | push = false 42 | 43 | [tool.bumpver.file_patterns] 44 | "pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"'] 45 | "ai_changelog/__init__.py" = ['__version__ = "{version}"'] 46 | -------------------------------------------------------------------------------- /.github/workflows/ai_changelog_main_push.yml: -------------------------------------------------------------------------------- 1 | name: Update AI Changelog on Push to Main 2 | on: 3 | push: 4 | branches: [main] 5 | paths-ignore: 6 | - "AI_CHANGELOG.md" 7 | - "AI_CHANGELOG-claude-2.md" 8 | - "AI_CHANGELOG-codellama.md" 9 | jobs: 10 | update-changelog: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: write 14 | pull-requests: write 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v4 18 | with: 19 | token: ${{ secrets.PAT }} 20 | fetch-depth: 0 21 | - name: Set up Python 22 | uses: actions/setup-python@v4 23 | with: 24 | python-version: 3.11 25 | cache: pip 26 | - name: Install Python libraries 27 | run: | 28 | pip install --user -r requirements.txt 29 | pip install --user . 30 | - name: "Update changelog(s)" 31 | env: 32 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} 33 | # ANYSCALE_API_KEY: ${{ secrets.ANYSCALE_API_KEY }} 34 | ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} 35 | LANGCHAIN_API_KEY: ${{ secrets.LANGCHAIN_API_KEY }} 36 | LANGCHAIN_PROJECT: ai-changelog 37 | LANGCHAIN_ENDPOINT: https://api.smith.langchain.com 38 | LANGCHAIN_TRACING_V2: true 39 | run: | 40 | ai_changelog origin/main^..origin/main \ 41 | --provider openai \ 42 | --model gpt-4 \ 43 | -o AI_CHANGELOG.md & 44 | ai_changelog origin/main^..origin/main \ 45 | --provider anthropic \ 46 | --model claude-2 \ 47 | --max_concurrency 5 \ 48 | --temperature 0 \ 49 | -o AI_CHANGELOG-claude-2.md & 50 | wait 51 | - name: Commit changes 52 | with: 53 | COMMIT_MESSAGE: "Update AI Changelog" 54 | file_pattern: "AI_CHANGELOG*.md" 55 | uses: stefanzweifel/git-auto-commit-action@v4 56 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # Don't know what this file is? See https://pre-commit.com/ 2 | # pip install pre-commit 3 | # pre-commit install 4 | # pre-commit autoupdate 5 | # Apply to all files without commiting: 6 | # pre-commit run --all-files 7 | # I recommend running this until you pass all checks, and then commit. 8 | # Fix what you need to and then let the pre-commit hooks resolve their conflicts. 9 | # You may need to git add -u between runs. 10 | exclude: "AI_CHANGELOG.*md" 11 | repos: 12 | - repo: https://github.com/charliermarsh/ruff-pre-commit 13 | rev: "v0.0.291" 14 | hooks: 15 | - id: ruff 16 | args: [--fix, --exit-non-zero-on-fix, --ignore, E501] 17 | - repo: https://github.com/koalaman/shellcheck-precommit 18 | rev: v0.9.0 19 | hooks: 20 | - id: shellcheck 21 | - repo: https://github.com/pre-commit/pre-commit-hooks 22 | rev: v4.4.0 23 | hooks: 24 | - id: check-ast 25 | - id: check-builtin-literals 26 | - id: check-merge-conflict 27 | - id: check-symlinks 28 | - id: check-toml 29 | - id: check-xml 30 | - id: debug-statements 31 | - id: check-case-conflict 32 | - id: check-docstring-first 33 | - id: check-executables-have-shebangs 34 | - id: check-json 35 | # - id: check-yaml 36 | - id: debug-statements 37 | - id: fix-byte-order-marker 38 | - id: detect-private-key 39 | - id: end-of-file-fixer 40 | - id: trailing-whitespace 41 | - id: mixed-line-ending 42 | - id: requirements-txt-fixer 43 | - repo: https://github.com/pre-commit/mirrors-mypy 44 | rev: v1.5.1 45 | hooks: 46 | - id: mypy 47 | - repo: https://github.com/asottile/add-trailing-comma 48 | rev: v3.1.0 49 | hooks: 50 | - id: add-trailing-comma 51 | - repo: https://github.com/dannysepler/rm_unneeded_f_str 52 | rev: v0.2.0 53 | hooks: 54 | - id: rm-unneeded-f-str 55 | - repo: https://github.com/psf/black 56 | rev: 23.9.1 57 | hooks: 58 | - id: black 59 | #- repo: https://github.com/PyCQA/bandit 60 | # rev: 1.7.5 61 | # hooks: 62 | # - id: bandit 63 | # args: ["-x", "tests/*.py"] 64 | -------------------------------------------------------------------------------- /ai_changelog/pydantic_models.py: -------------------------------------------------------------------------------- 1 | """Pydantic models for ai_changelog""" 2 | 3 | from __future__ import annotations 4 | 5 | import os 6 | import subprocess 7 | from typing import List, Optional 8 | 9 | from langchain.pydantic_v1 import BaseModel, Field 10 | 11 | from ai_changelog.string_templates import markdown_template 12 | 13 | 14 | class Commit(BaseModel): 15 | """A commit""" 16 | 17 | commit_hash: str = Field(..., description="The commit hash") 18 | date_time_str: str = Field(..., description="Formatted date and time str") 19 | diff: str = Field(..., description="The diff for the commit") 20 | 21 | 22 | class CommitDescription(BaseModel): 23 | """A commit description""" 24 | 25 | short_description: str = Field( 26 | ..., 27 | description="A technical and concise description of changes implemented in the commit", 28 | ) 29 | long_description: List[str] = Field( 30 | ..., 31 | description="Markdown bullet-point formatted list of changes implemented in the commit", 32 | ) 33 | 34 | 35 | class CommitInfo(Commit, CommitDescription): 36 | """A commit and its description""" 37 | 38 | @staticmethod 39 | def get_repo_name(repo_path: Optional[str] = None) -> str: 40 | """Get the repo name from the remote origin URL""" 41 | repo_path = repo_path or os.getcwd() 42 | os.chdir(repo_path) 43 | return ( 44 | subprocess.check_output(["git", "remote", "get-url", "origin"]) 45 | .decode() 46 | .replace("https://github.com/", "") 47 | .replace(".git", "") 48 | .strip() 49 | ) 50 | 51 | def markdown(self) -> str: 52 | """Generate markdown for the commit info""" 53 | _repo_name = self.get_repo_name() 54 | bullet_points = "\n".join( 55 | [f"- {line.strip('*- ').strip()}" for line in self.long_description], 56 | ).strip() 57 | return markdown_template.format( 58 | short_description=self.short_description, 59 | commit_hash=self.commit_hash, 60 | bullet_points=bullet_points, 61 | repo_name=_repo_name, 62 | date_time_str=self.date_time_str, 63 | ) 64 | 65 | @staticmethod 66 | def infos_to_str(infos: List[CommitInfo]) -> str: 67 | """Convert a list of CommitInfo objects to a string""" 68 | return "\n".join([info.markdown().strip() for info in infos]).strip() 69 | -------------------------------------------------------------------------------- /.github/workflows/publish_on_pypi.yml: -------------------------------------------------------------------------------- 1 | name: Publish to PyPI 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*.*.*' 7 | 8 | jobs: 9 | build: 10 | name: Build 11 | runs-on: ubuntu-latest 12 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Set up Python 17 | uses: actions/setup-python@v4 18 | with: 19 | python-version: "3.11" 20 | - name: Install pypa/build 21 | run: >- 22 | python3 -m 23 | pip install 24 | build 25 | --user 26 | - name: Build a binary wheel and a source tarball 27 | run: python3 -m build 28 | - name: Store the distribution packages 29 | uses: actions/upload-artifact@v3 30 | with: 31 | name: python-package-distributions 32 | path: dist/ 33 | 34 | publish-to-pypi: 35 | name: >- 36 | Publish 37 | needs: 38 | - build 39 | runs-on: ubuntu-latest 40 | environment: 41 | name: release 42 | url: https://pypi.org/p/ai-changelog 43 | permissions: 44 | id-token: write # IMPORTANT: mandatory for trusted publishing 45 | 46 | steps: 47 | - name: Download all the dists 48 | uses: actions/download-artifact@v3 49 | with: 50 | name: python-package-distributions 51 | path: dist/ 52 | - name: Publish distribution 📦 to PyPI 53 | uses: pypa/gh-action-pypi-publish@release/v1 54 | 55 | github-release: 56 | name: Release 57 | needs: 58 | - publish-to-pypi 59 | runs-on: ubuntu-latest 60 | 61 | permissions: 62 | contents: write # IMPORTANT: mandatory for making GitHub Releases 63 | id-token: write # IMPORTANT: mandatory for sigstore 64 | 65 | steps: 66 | - uses: actions/checkout@v4 67 | - name: Download all the dists 68 | uses: actions/download-artifact@v3 69 | with: 70 | name: python-package-distributions 71 | path: dist/ 72 | - name: Sign the dists with Sigstore 73 | uses: sigstore/gh-action-sigstore-python@v1.2.3 74 | with: 75 | inputs: >- 76 | ./dist/*.tar.gz 77 | ./dist/*.whl 78 | - name: Upload artifact signatures to GitHub Release 79 | env: 80 | GITHUB_TOKEN: ${{ github.token }} 81 | # Upload to GitHub Release using the `gh` CLI. 82 | # `dist/` contains the built packages, and the 83 | # sigstore-produced signatures and certificates. 84 | run: | 85 | gh release create '${{ github.ref_name }}' --repo '${{ github.repository }}' 86 | gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}' 87 | -------------------------------------------------------------------------------- /ai_changelog/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python3 2 | """Update the AI_CHANGELOG.md file with the latest changes.""" 3 | import argparse 4 | from typing import List 5 | 6 | from ai_changelog import Commit, get_commits, update_changelog 7 | from ai_changelog.utils import get_prompt, get_llm 8 | 9 | 10 | def main() -> None: 11 | """Update the AI_CHANGELOG.md file with the latest changes.""" 12 | parser = argparse.ArgumentParser( 13 | prog="ai_changelog", 14 | description="Process command line arguments.", 15 | epilog="http://github.com/joshuasundance-swca/ai_changelog", 16 | ) 17 | parser.add_argument( 18 | "refs", 19 | type=str, 20 | default="origin/main^..origin/main", 21 | help="Reference comparison with standard git syntax", 22 | ) 23 | 24 | parser.add_argument( 25 | "--provider", 26 | type=str, 27 | default="openai", 28 | help="Model API provider", 29 | choices=["openai", "anthropic", "anyscale"], 30 | ) 31 | parser.add_argument( 32 | "--model", 33 | type=str, 34 | default="gpt-4", 35 | help="Model name", 36 | ) 37 | parser.add_argument( 38 | "--temperature", 39 | type=float, 40 | default=0.5, 41 | help="Model temperature", 42 | ) 43 | parser.add_argument( 44 | "--max_tokens", 45 | type=int, 46 | default=500, 47 | help="Max tokens in output", 48 | ) 49 | parser.add_argument( 50 | "--hub_prompt", 51 | type=str, 52 | default="joshuasundance/ai_changelog", 53 | help="Prompt to pull from LangChain Hub", 54 | ) 55 | parser.add_argument( 56 | "--context_lines", 57 | type=int, 58 | default=5, 59 | help="Number of context lines for each commit", 60 | ) 61 | 62 | parser.add_argument( 63 | "--max_concurrency", 64 | type=int, 65 | default=0, 66 | help="Number of concurrent connections to llm provider (0 means no limit)", 67 | ) 68 | 69 | parser.add_argument( 70 | "-v", 71 | "--verbose", 72 | help="Run LangChain in verbose mode", 73 | action="store_true", 74 | ) 75 | 76 | parser.add_argument( 77 | "-o", 78 | "--output_file", 79 | type=str, 80 | help="Output file", 81 | default="AI_CHANGELOG.md", 82 | ) 83 | 84 | args = parser.parse_args() 85 | 86 | before_ref, after_ref = args.refs.split("..") 87 | 88 | context_lines = args.context_lines 89 | provider = args.provider 90 | llm = args.model 91 | temperature = args.temperature 92 | max_tokens = args.max_tokens 93 | hub_prompt_str = args.hub_prompt 94 | verbose = args.verbose 95 | max_concurrency = args.max_concurrency 96 | output_file = args.output_file 97 | 98 | # Generate the new AI_CHANGELOG.md 99 | new_commits: List[Commit] = get_commits( 100 | before_ref=before_ref, 101 | after_ref=after_ref, 102 | context_lines=context_lines, 103 | ) 104 | 105 | if new_commits: 106 | llm = get_llm(provider, llm, temperature, max_tokens) 107 | prompt = get_prompt(hub_prompt_str) 108 | update_changelog( 109 | before_ref=before_ref, 110 | new_commits=new_commits, 111 | provider=provider, 112 | llm=llm, 113 | prompt=prompt, 114 | verbose=verbose, 115 | max_concurrency=max_concurrency, 116 | output_file=output_file, 117 | ) 118 | 119 | 120 | if __name__ == "__main__": 121 | main() 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ai_changelog 2 | 3 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 4 | [![python](https://img.shields.io/badge/Python-3.7+-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org) 5 | 6 | [![Publish to PyPI](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/publish_on_pypi.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/publish_on_pypi.yml) 7 | ![GitHub tag (with filter)](https://img.shields.io/github/v/tag/joshuasundance-swca/ai_changelog) 8 | 9 | [![Push to Docker Hub](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/docker-hub.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/docker-hub.yml) 10 | [![Docker Image Size (tag)](https://img.shields.io/docker/image-size/joshuasundance/ai_changelog/latest)](https://hub.docker.com/r/joshuasundance/ai_changelog) 11 | 12 | ![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/joshuasundance-swca/ai_changelog) 13 | ![Code Climate issues](https://img.shields.io/codeclimate/issues/joshuasundance-swca/ai_changelog) 14 | ![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/joshuasundance-swca/ai_changelog) 15 | 16 | [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) 17 | [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff) 18 | [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) 19 | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) 20 | 21 | [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) 22 | ![Known Vulnerabilities](https://snyk.io/test/github/joshuasundance-swca/ai_changelog/badge.svg) 23 | 24 | [![Update AI Changelog on Push to Main](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/ai_changelog_main_push.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/ai_changelog_main_push.yml) 25 | 26 | `ai_changelog` is a Python project that automatically generates changelog files summarizing code changes, using AI. 27 | 28 | It uses [LangChain](https://github.com/langchain-ai/langchain) and [OpenAI](https://openai.com/) models to analyze Git commit diffs and generate natural language descriptions of the changes. This allows maintaining an up-to-date changelog without manual effort. 29 | 30 | This README was originally written by Claude, an LLM from Anthropic. 31 | 32 | ## Usage 33 | 34 | ```bash 35 | usage: ai_changelog [-h] [--provider {openai,anthropic,anyscale}] [--model MODEL] [--temperature TEMPERATURE] [--max_tokens MAX_TOKENS] [--hub_prompt HUB_PROMPT] 36 | [--context_lines CONTEXT_LINES] [--max_concurrency MAX_CONCURRENCY] [-v] 37 | refs 38 | 39 | Process command line arguments. 40 | 41 | positional arguments: 42 | refs Reference comparison with standard git syntax 43 | 44 | options: 45 | -h, --help show this help message and exit 46 | --provider {openai,anthropic,anyscale} 47 | Model API provider 48 | --model MODEL Model name 49 | --temperature TEMPERATURE 50 | Model temperature 51 | --max_tokens MAX_TOKENS 52 | Max tokens in output 53 | --hub_prompt HUB_PROMPT 54 | Prompt to pull from LangChain Hub 55 | --context_lines CONTEXT_LINES 56 | Number of context lines for each commit 57 | --max_concurrency MAX_CONCURRENCY 58 | Number of concurrent connections to llm provider (0 means no limit) 59 | -v, --verbose Run LangChain in verbose mode 60 | 61 | http://github.com/joshuasundance-swca/ai_changelog 62 | ``` 63 | 64 | ### Local install 65 | 66 | To generate a changelog locally: 67 | 68 | ```bash 69 | pip install ai_changelog 70 | 71 | ai_changelog --help 72 | ai_changelog main..HEAD # to summarize changes locally 73 | ``` 74 | 75 | ### Docker 76 | 77 | ```bash 78 | docker pull joshuasundance/ai_changelog:latest 79 | docker run \ 80 | --env-file .env \ 81 | -v /local_repo_dir:/container_dir_in_repo \ 82 | -w /container_dir_in_repo \ 83 | joshuasundance/ai_changelog:latest \ 84 | main..HEAD 85 | ``` 86 | 87 | ### GitHub Workflow 88 | 89 | The [ai_changelog_main_pr.yml](.github/workflows/ai_changelog_main_push.yml) workflow runs on pushes to `main`. 90 | 91 | It generates summaries for the new commits and appends them to `AI_CHANGELOG.md`. The updated file is then committed back to the PR branch. 92 | 93 | ```bash 94 | ai_changelog origin/main^..origin/main # in a GitHub action to summarize changes in response to a push to main 95 | ai_changelog origin/main..HEAD # in a GitHub action to summarize changes in response to a PR 96 | ``` 97 | 98 | Another flow was made to commit an updated changelog to an incoming PR before it was merged, but that seemed less useful although it did work well. 99 | 100 | ## Configuration 101 | 102 | - Set environment variables as needed for your provider of choice (default requires `OPENAI_API_KEY`). 103 | - Set LangSmith environment variables to enable LangSmith integration, if applicable. 104 | - Use command line arguments. 105 | 106 | ## License 107 | 108 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 109 | 110 | 111 | ## TODO 112 | 113 | - Testing 114 | - Get CodeLlama working reliably in CICD (currently hit or miss on structured output) 115 | -------------------------------------------------------------------------------- /ai_changelog/utils.py: -------------------------------------------------------------------------------- 1 | """Utility functions for the ai_changelog package""" 2 | import os 3 | import subprocess 4 | from typing import Any, List, Union 5 | 6 | from langchain import hub 7 | from langchain.chains.base import Chain 8 | from langchain.chains.openai_functions import ( 9 | create_structured_output_chain, 10 | ) 11 | from langchain.chat_models import ChatOpenAI, ChatAnyscale, ChatAnthropic 12 | from langchain.chat_models.base import BaseChatModel 13 | from langchain.output_parsers import OutputFixingParser, PydanticOutputParser 14 | from langchain.prompts import ChatPromptTemplate 15 | from langchain.schema.runnable import RunnableConfig 16 | 17 | from ai_changelog.pydantic_models import CommitDescription, CommitInfo, Commit 18 | from ai_changelog.string_templates import hum_msg, sys_msg 19 | 20 | 21 | def get_llm( 22 | provider: str, 23 | model: str, 24 | temperature: float = 0.5, 25 | max_tokens: int = 1000, 26 | ) -> BaseChatModel: 27 | provider_model_dict = { 28 | "openai": ChatOpenAI, 29 | "anthropic": ChatAnthropic, 30 | "anyscale": ChatAnyscale, 31 | } 32 | try: 33 | model_class = provider_model_dict[provider] 34 | except KeyError as e: 35 | raise ValueError(f"Unknown provider {provider}") from e 36 | return model_class(model=model, temperature=temperature, max_tokens=max_tokens) 37 | 38 | 39 | def get_prompt( 40 | hub_prompt_str: str = "joshuasundance/ai_changelog", 41 | ) -> ChatPromptTemplate: 42 | return ( 43 | ChatPromptTemplate.from_messages( 44 | [ 45 | ("system", sys_msg), 46 | ("human", hum_msg), 47 | ("human", "Tip: Make sure to answer in the correct format"), 48 | ], 49 | ) 50 | if hub_prompt_str == "joshuasundance/ai_changelog" 51 | else hub.pull(hub_prompt_str) 52 | ) 53 | 54 | 55 | def get_non_openai_chain(llm: BaseChatModel) -> Chain: 56 | codellama_prompt_template = hub.pull("joshuasundance/ai_changelog_codellama") 57 | parser = PydanticOutputParser(pydantic_object=CommitDescription) 58 | fixing_parser = OutputFixingParser.from_llm( 59 | parser=parser, 60 | llm=llm 61 | if not isinstance(llm, ChatAnyscale) 62 | else ChatAnyscale(model_name="meta-llama/Llama-2-7b-chat-hf", temperature=0), 63 | ) 64 | return codellama_prompt_template | llm | fixing_parser 65 | 66 | 67 | def get_timestamp(commit_hash: str, format_str: str = "%cD") -> str: 68 | """Get the timestamp for a commit hash""" 69 | cmd = ["git", "show", "-s", f"--format={format_str}", commit_hash] 70 | return subprocess.check_output(cmd).decode().strip() 71 | 72 | 73 | def rev_parse(ref: str) -> str: 74 | """Get the commit hash for a reference""" 75 | return subprocess.check_output(["git", "rev-parse", ref]).decode().strip() 76 | 77 | 78 | def dt_diffs_from_hashes( 79 | hashes: List[str], 80 | context_lines: int = 5, 81 | ) -> List[List[str]]: 82 | cmd = "git --no-pager show --no-notes {commit} -s --pretty=%cd --quiet --patch -U{context_lines}" 83 | return [ 84 | output.split("\n", maxsplit=1) 85 | for output in [ 86 | subprocess.check_output( 87 | cmd.format(commit=commit, context_lines=context_lines).split(" "), 88 | ) 89 | .decode() 90 | .strip() 91 | for commit in hashes 92 | ] 93 | ] 94 | 95 | 96 | def get_commits( 97 | before_ref: str = "origin/main^", 98 | after_ref: str = "origin/main", 99 | context_lines: int = 5, 100 | ) -> List[Commit]: 101 | """Get the list of commits between two references""" 102 | # Get the commit hashes for BEFORE and AFTER 103 | before_hash = rev_parse(before_ref) 104 | subprocess.check_call(["git", "fetch"]) 105 | after_hash = rev_parse(after_ref) 106 | 107 | # Get the list of commit hashes between before and after 108 | hashes: List[str] = ( 109 | subprocess.check_output( 110 | ["git", "rev-list", "--no-merges", f"{before_hash}..{after_hash}"], 111 | ) 112 | .decode() 113 | .splitlines() 114 | ) 115 | 116 | dt_diffs = dt_diffs_from_hashes(hashes, context_lines=context_lines) 117 | dts = [dt_diff[0] for dt_diff in dt_diffs] 118 | diffs = [dt_diff[1] for dt_diff in dt_diffs] 119 | # Return a list of Commit objects 120 | return [ 121 | Commit( 122 | commit_hash=commit_hash.strip(), 123 | date_time_str=date_time_str, 124 | diff=diff.strip(), 125 | ) 126 | for commit_hash, date_time_str, diff in zip( 127 | hashes, 128 | dts, 129 | diffs, 130 | ) 131 | ] 132 | 133 | 134 | def get_descriptions( 135 | commits: List[Commit], 136 | provider: str, 137 | llm: BaseChatModel, 138 | prompt: ChatPromptTemplate, 139 | verbose: bool = True, 140 | max_concurrency: int = 0, 141 | ) -> List[CommitInfo]: 142 | """Get the descriptions for a list of commits""" 143 | config_dict: dict[str, Any] = {"verbose": verbose} 144 | if max_concurrency > 0: 145 | config_dict["max_concurrency"] = max_concurrency 146 | outputs: List[CommitDescription] 147 | if provider == "openai": 148 | chain = create_structured_output_chain( 149 | CommitDescription, 150 | llm, 151 | prompt, 152 | ) 153 | results: List[dict] = chain.batch( 154 | [commit.dict() for commit in commits], 155 | RunnableConfig(config_dict), 156 | ) 157 | outputs = [result["function"] for result in results] 158 | 159 | else: 160 | chain = get_non_openai_chain(llm) 161 | 162 | outputs = chain.batch( 163 | [{"input": commit.diff} for commit in commits], 164 | RunnableConfig(config_dict), 165 | ) 166 | 167 | return [ 168 | CommitInfo(**commit.dict(), **commit_description.dict()) 169 | for commit, commit_description in zip(commits, outputs) 170 | ] 171 | 172 | 173 | def get_existing_changelog( 174 | before_ref: str, 175 | output_file: str = "AI_CHANGELOG.md", 176 | ) -> Union[str, None]: 177 | # Check to see if output_file already exists 178 | if os.path.isfile(output_file): 179 | # If so, restore the original version from main 180 | subprocess.call(["git", "checkout", before_ref, "--", output_file]) 181 | 182 | # Get its contents starting from the second line 183 | with open(output_file, "r") as existing_changelog: 184 | return "\n".join( 185 | [line.strip() for line in existing_changelog.readlines()[1:]], 186 | ).strip() 187 | return None 188 | 189 | 190 | def update_changelog( 191 | before_ref: str, 192 | new_commits: List[Commit], 193 | provider: str, 194 | llm: BaseChatModel, 195 | prompt: ChatPromptTemplate, 196 | verbose: bool = True, 197 | max_concurrency: int = 0, 198 | output_file: str = "AI_CHANGELOG.md", 199 | ) -> None: 200 | new_commit_infos: List[CommitInfo] = get_descriptions( 201 | new_commits, 202 | provider, 203 | llm, 204 | prompt, 205 | verbose, 206 | max_concurrency, 207 | ) 208 | new_descriptions: str = CommitInfo.infos_to_str(new_commit_infos).strip() 209 | existing_content = get_existing_changelog(before_ref, output_file) or "" 210 | 211 | output = f"# AI CHANGELOG\n{new_descriptions.strip()}\n{existing_content.strip()}\n".strip() 212 | 213 | # Write the output to AI_CHANGELOG.md 214 | with open(output_file, "w") as new_changelog: 215 | new_changelog.write(output) 216 | -------------------------------------------------------------------------------- /AI_CHANGELOG-claude-2.md: -------------------------------------------------------------------------------- 1 | # AI CHANGELOG 2 | ## [Upgrade LangChain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/4184161f33540854af7d30e0cc98fa0846efa2ac) 3 | Mon Jan 8 09:02:52 2024 +0000 4 | - Upgrade LangChain from 0.0.353 to 0.1.0 5 | - This includes various bug fixes and improvements 6 | ## [Upgrade LangChain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/eb3c770e02bdc08ff8b00de9af105b54890d96c7) 7 | Mon Jan 1 08:23:24 2024 +0000 8 | - Bump LangChain version from 0.0.352 to 0.0.353 in requirements.txt 9 | ## [Update GitHub workflow token](https://github.com/joshuasundance-swca/ai_changelog/commit/0e5a3661bedbcfddcf2e7ed029e92992b6028185) 10 | Tue Dec 26 23:39:13 2023 -0500 11 | - Replace hardcoded workflow token with PAT secret 12 | - Fetch full git history to allow version bumping 13 | ## [Configure git user for bumpver](https://github.com/joshuasundance-swca/ai_changelog/commit/baef94d69e76105170ad917ca7084daae4cf7808) 14 | Tue Dec 26 23:35:58 2023 -0500 15 | - Add git config step to set local user email and name for bumpver commit 16 | - This prevents bumpver from failing due to missing git user config 17 | ## [Add workflow for bumping version on trigger](https://github.com/joshuasundance-swca/ai_changelog/commit/90fc4dee7df755b56d0e879b50b5c28eb9f0af4b) 18 | Tue Dec 26 23:16:15 2023 -0500 19 | - Add GitHub workflow definition file to repository 20 | - Workflow allows manually triggering patch, minor or major version bump 21 | - Installs bumpver package and runs it to update version files and push changes 22 | ## [Upgrade dependencies](https://github.com/joshuasundance-swca/ai_changelog/commit/86f4784f34b9230ccbf95962a060e3897a66c48c) 23 | Wed Dec 27 03:31:19 2023 +0000 24 | - Upgrade Anthropic to 0.8.1 25 | - Upgrade LangChain to 0.0.352 26 | - Upgrade OpenAI to 1.6.1 27 | - Upgrade Pydantic to 2.5.3 28 | ## [Configure Dependabot updates](https://github.com/joshuasundance-swca/ai_changelog/commit/ad7e56d40aeea883ab5294cc226600053c024848) 29 | Tue Dec 26 22:30:06 2023 -0500 30 | - Added app group to Dependabot config to enable version updates for all packages 31 | - This will keep dependencies up-to-date and reduce security vulnerabilities 32 | ## [Upgrade anthropic to 0.7.8](https://github.com/joshuasundance-swca/ai_changelog/commit/93bc21f70b40db74b02e5a3d922cbed4a54cd720) 33 | Mon Dec 18 13:12:29 2023 +0000 34 | - Upgrade anthropic dependency to latest version 0.7.8 35 | - Update requirements.txt file with new anthropic version 36 | ## [Upgrade LangChain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/e9a6f8469ddcb15bac26d7908354a40d0a15ff68) 37 | Mon Dec 18 08:39:48 2023 +0000 38 | - Bump LangChain version from 0.0.348 to 0.0.350 in requirements.txt 39 | ## [Upgrade LangChain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/6c1f419a93e12066e7569645979f92a254ce2a6d) 40 | Mon Dec 11 08:27:14 2023 +0000 41 | - Bump LangChain version from 0.0.345 to 0.0.348 in requirements.txt 42 | ## [Upgrade dependencies](https://github.com/joshuasundance-swca/ai_changelog/commit/fa3079be09dacbcee4b445855f7d6900a37dbd59) 43 | Tue Dec 5 10:05:39 2023 -0500 44 | - Upgrade Anthropic to 0.7.7 45 | - Upgrade LangChain to 0.0.345 46 | - Upgrade OpenAI to 1.3.7 47 | ## [Upgrade LangChain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/359441267c33f8e3d7d69be9273c2e5b9c79ca4a) 48 | Mon Nov 27 17:36:31 2023 -0500 49 | - Bump LangChain version from 0.0.340 to 0.0.341 50 | - Update requirements.txt file with latest LangChain release 51 | ## [Upgrade anthropic to 0.7.5](https://github.com/joshuasundance-swca/ai_changelog/commit/b6ab4298562d700487d075b497801b998637a40e) 52 | Mon Nov 27 17:35:07 2023 -0500 53 | - Upgrade anthropic dependency to latest version 0.7.5 54 | - Update requirements.txt file with new anthropic version 55 | ## [Upgrade dependencies](https://github.com/joshuasundance-swca/ai_changelog/commit/0cc7eb29bf779d53a8e67ae7580f097aae6b7091) 56 | Mon Nov 27 17:33:28 2023 -0500 57 | - Upgraded anthropic from 0.5.0 to 0.7.4 58 | - Upgraded langchain from 0.0.330 to 0.0.340 59 | - Upgraded langchainhub from 0.1.13 to 0.1.14 60 | - Upgraded openai from 0.28.1 to 1.3.5 61 | - Upgraded pydantic from 2.4.2 to 2.5.2 62 | ## [Upgrade langchain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/fa57cab0a4d52c9ef974c77ebc5f5bc68172de96) 63 | Mon Nov 6 08:30:02 2023 +0000 64 | - Upgrade langchain from 0.0.325 to 0.0.330 65 | - This includes bug fixes and new features added in recent langchain releases 66 | ## [Upgrade langchain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/82a3bc21a27fa85c03d694430c5894d44f6c9041) 67 | Mon Oct 30 08:08:53 2023 +0000 68 | - Upgrade langchain from 0.0.320 to 0.0.325 69 | - This includes bug fixes and new features added in the latest langchain release 70 | ## [Upgrade anthropic to 0.5.0](https://github.com/joshuasundance-swca/ai_changelog/commit/8ed257b2b13955b63ace51784a0308eb8bc36316) 71 | Mon Oct 23 16:45:30 2023 +0000 72 | - Upgrade anthropic dependency to latest version 0.5.0 73 | - This upgrades anthropic from 0.3.11 to 0.5.0 74 | ## [Automated GitHub workflows](https://github.com/joshuasundance-swca/ai_changelog/commit/c71975375374c80218b8c4369d7654d828fb50d9) 75 | Thu Oct 19 15:29:03 2023 -0400 76 | - Added GitHub workflow to publish Python package to PyPI 77 | - Added GitHub workflow to build and push Docker image to Docker Hub 78 | - Updated badges in README 79 | ## [Update project badges and README](https://github.com/joshuasundance-swca/ai_changelog/commit/4b34410086ac2d0e62afa10fb52a3612896946d4) 80 | Thu Oct 19 10:48:57 2023 -0400 81 | - Add Code Climate badges for maintainability, issues, and technical debt 82 | - Add Docker Hub badges for image version and size 83 | - Re-order badges for better visual hierarchy 84 | - Update vulnerability scanning badge to Snyk 85 | - Minor formatting updates 86 | ## [Upgrade langchain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/89946ea1796f331d698bb0b2106cd93b61ea6743) 87 | Mon Oct 16 08:43:41 2023 +0000 88 | - Upgrade langchain from 0.0.308 to 0.0.315 89 | - This includes bug fixes and new features added in langchain 90 | ## [Bump version 0.0.12 -> 0.0.13](https://github.com/joshuasundance-swca/ai_changelog/commit/39effeb73933bc7f7f47e0358f92fe3a3b13b3d9) 91 | Fri Oct 6 21:03:07 2023 -0400 92 | - Increment version number in __init__.py and pyproject.toml 93 | - Update CHANGELOG.md with new version 94 | ## [Upgrade langchain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/63d56639876f067797b382c94edeeba5b1c715ba) 95 | Thu Oct 5 13:54:40 2023 +0000 96 | - Upgrade langchain from 0.0.305 to 0.0.308 97 | - This includes bug fixes and new features added in 0.0.306 - 0.0.308 98 | ## [Bump version 0.0.11 -> 0.0.12](https://github.com/joshuasundance-swca/ai_changelog/commit/57c1da05f42208a57a1326bac6eaa42067c4cc5d) 99 | Mon Oct 2 09:01:46 2023 -0400 100 | - Bumped version number in __init__.py and pyproject.toml from 0.0.11 to 0.0.12 101 | - Ran bumpver to update version in pyproject.toml and commit changes 102 | ## [Bump pydantic to 2.4.2](https://github.com/joshuasundance-swca/ai_changelog/commit/0fb3a28fe832c7194073270dca51597c9894e689) 103 | Mon Oct 2 08:38:36 2023 +0000 104 | - Upgrade pydantic dependency to version 2.4.2 for improved type hints and bug fixes. 105 | - This includes fixes for issues with GenericModel and better support for Python 3.11. 106 | ## [Upgrade langchain dependency](https://github.com/joshuasundance-swca/ai_changelog/commit/cd7606d9f794816c90a5e582be8e56a574491e40) 107 | Mon Oct 2 08:38:27 2023 +0000 108 | - Upgrade langchain from 0.0.300 to 0.0.305 109 | - This includes bug fixes and new features added in langchain 0.0.301 through 0.0.305 110 | ## [Bump openai dependency to 0.28.1](https://github.com/joshuasundance-swca/ai_changelog/commit/8e28e72c875302ba17e62b8b34da7b214970ad89) 111 | Mon Oct 2 08:38:16 2023 +0000 112 | - Upgrade openai package to latest patch version 0.28.1 for bug fixes and improvements. 113 | - This includes fixes for issues with completions and embeddings. 114 | ## [Bump version 0.0.10 -> 0.0.11](https://github.com/joshuasundance-swca/ai_changelog/commit/1a15c0ebe991cbc32d5a01ab0e9ee949a2d201bf) 115 | Thu Sep 28 14:32:58 2023 -0400 116 | - Bump version in __init__.py 117 | - Bump version in pyproject.toml 118 | - Bump version via bumpver 119 | ## [Update GitHub workflow](https://github.com/joshuasundance-swca/ai_changelog/commit/2478280647ca2d5e865254b76ed0df71bf585b8d) 120 | Thu Sep 28 14:31:19 2023 -0400 121 | - Modify .github/workflows/ai_changelog_main_push.yml workflow to run changelog generation in parallel 122 | - Launch OpenAI, Anthropic, and CodeLlama jobs together and wait for completion 123 | - Remove commented-out CodeLlama job 124 | ## [Removed TODO task from README](https://github.com/joshuasundance-swca/ai_changelog/commit/a72e1649321d42f27645b6a42d50a6aebe289e97) 125 | Thu Sep 28 18:25:40 2023 +0000 126 | - This commit removes the task 'More robust chains for non-OpenAI LLMs' from the TODO list in the README file. 127 | - The task may have been completed or deemed unnecessary. -------------------------------------------------------------------------------- /AI_CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # AI CHANGELOG 2 | ## [Updated dependencies in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/2c550e1b5a1fb5923747f3caa8a4a7cc0b37394f) 3 | Mon Apr 15 08:29:03 2024 +0000 4 | - The commit updates the versions of all dependencies listed in the requirements.txt file. The versions of 'anthropic', 'langchain', 'langchainhub', 'openai', and 'pydantic' have been upgraded. 5 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/4184161f33540854af7d30e0cc98fa0846efa2ac) 6 | Mon Jan 8 09:02:52 2024 +0000 7 | - The langchain package version in requirements.txt has been updated from 0.0.353 to 0.1.0. This update might include new features or bug fixes in the langchain package. 8 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/eb3c770e02bdc08ff8b00de9af105b54890d96c7) 9 | Mon Jan 1 08:23:24 2024 +0000 10 | - The langchain package version in requirements.txt has been updated from 0.0.352 to 0.0.353. This update may include bug fixes, feature improvements or new features from the langchain package. 11 | ## [Updated token in Github workflow and Python version](https://github.com/joshuasundance-swca/ai_changelog/commit/0e5a3661bedbcfddcf2e7ed029e92992b6028185) 12 | Tue Dec 26 23:39:13 2023 -0500 13 | - This commit updates the token used for Github Actions in the bumpver workflow file from 'WORKFLOW_GIT_ACCESS_TOKEN' to 'PAT'. 14 | - It also updates the Python version used in the workflow to 3.11. 15 | ## [Added bot configuration to GitHub Actions workflow](https://github.com/joshuasundance-swca/ai_changelog/commit/baef94d69e76105170ad917ca7084daae4cf7808) 16 | Tue Dec 26 23:35:58 2023 -0500 17 | - This commit adds a new step to the GitHub Actions workflow that configures the bot's email and name. This is done to ensure that any commits made by the bot are correctly attributed to it. 18 | ## [Added a new GitHub workflow for version bumping](https://github.com/joshuasundance-swca/ai_changelog/commit/90fc4dee7df755b56d0e879b50b5c28eb9f0af4b) 19 | Tue Dec 26 23:16:15 2023 -0500 20 | - This commit introduces a new GitHub workflow file named 'bumpver.yml'. 21 | - The workflow is triggered manually and allows for three types of version bumps: major, minor, and patch. 22 | - The job runs on the latest Ubuntu, checks out the code, sets up Python, installs the 'bumpver' library, and finally bumps the version. 23 | - The type of version bump (major, minor, or patch) is provided as an input when the workflow is triggered. 24 | ## [Updated package versions in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/86f4784f34b9230ccbf95962a060e3897a66c48c) 25 | Wed Dec 27 03:31:19 2023 +0000 26 | - The commit includes updates to the versions of several packages in the requirements.txt file. The anthropic package was updated from version 0.7.8 to 0.8.1, the langchain package from version 0.0.350 to 0.0.352, the openai package from version 1.5.0 to 1.6.1, and the pydantic package from version 2.5.2 to 2.5.3. 27 | ## [Added grouping to Dependabot configuration](https://github.com/joshuasundance-swca/ai_changelog/commit/ad7e56d40aeea883ab5294cc226600053c024848) 28 | Tue Dec 26 22:30:06 2023 -0500 29 | - This commit introduces a new grouping configuration to the Dependabot settings. Now, all dependencies will be grouped under the 'app' group. This means that whenever Dependabot checks for updates, it will group all updates into a single pull request rather than creating separate pull requests for each update. 30 | ## [Updated anthropic package version](https://github.com/joshuasundance-swca/ai_changelog/commit/93bc21f70b40db74b02e5a3d922cbed4a54cd720) 31 | Mon Dec 18 13:12:29 2023 +0000 32 | - The anthropic package version in the requirements.txt file has been updated. The previous version was 0.7.7 and it has been updated to version 0.7.8. No other changes have been made to the requirements.txt file in this commit. 33 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/e9a6f8469ddcb15bac26d7908354a40d0a15ff68) 34 | Mon Dec 18 08:39:48 2023 +0000 35 | - The langchain version was updated in the requirements.txt file. The previous version was 0.0.348 and it has been updated to 0.0.350. 36 | ## [Updated project version to 0.0.14](https://github.com/joshuasundance-swca/ai_changelog/commit/543f0bf2a775e59bbab25e3a713040429653273b) 37 | Mon Dec 11 13:10:27 2023 -0500 38 | - This commit updates the project version from 0.0.13 to 0.0.14. The version number has been updated in three places: the __init__.py file, the pyproject.toml file, and the tool.bumpver section in the pyproject.toml file. 39 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/6c1f419a93e12066e7569645979f92a254ce2a6d) 40 | Mon Dec 11 08:27:14 2023 +0000 41 | - The langchain library version was updated from 0.0.345 to 0.0.348 in the requirements.txt file. This change ensures that the project is using the latest version of the langchain library. 42 | ## [Updated library versions in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/fa3079be09dacbcee4b445855f7d6900a37dbd59) 43 | Tue Dec 5 10:05:39 2023 -0500 44 | - Updated the versions of the anthropic, langchain, and openai libraries in the requirements.txt file. The anthropic library was updated from version 0.7.5 to 0.7.7, the langchain library from version 0.0.341 to 0.0.345, and the openai library from version 1.3.5 to 1.3.7. 45 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/359441267c33f8e3d7d69be9273c2e5b9c79ca4a) 46 | Mon Nov 27 17:36:31 2023 -0500 47 | - The langchain version in the requirements.txt file has been updated from 0.0.340 to 0.0.341. This update could include bug fixes or new features from the langchain library. 48 | ## [Updated anthropic package version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/b6ab4298562d700487d075b497801b998637a40e) 49 | Mon Nov 27 17:35:07 2023 -0500 50 | - The anthropic package version in the requirements.txt file was updated from 0.7.4 to 0.7.5. No other changes were made in this commit. 51 | ## [Updated package versions in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/0cc7eb29bf779d53a8e67ae7580f097aae6b7091) 52 | Mon Nov 27 17:33:28 2023 -0500 53 | - The commit updates the versions of several packages in the requirements.txt file. The packages updated include 'anthropic', 'langchain', 'langchainhub', 'openai', and 'pydantic'. The version updates ensure the application uses the latest and possibly more stable or secure versions of these packages. 54 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/fa57cab0a4d52c9ef974c77ebc5f5bc68172de96) 55 | Mon Nov 6 08:30:02 2023 +0000 56 | - The langchain package version has been updated in the requirements.txt file. The previous version was 0.0.325, and the new version is 0.0.330. This update may include new features or bug fixes from the langchain package. 57 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/82a3bc21a27fa85c03d694430c5894d44f6c9041) 58 | Mon Oct 30 08:08:53 2023 +0000 59 | - The langchain version in the requirements.txt file was updated from 0.0.320 to 0.0.325. This commit does not include any other changes. 60 | ## [Updated anthropic version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/8ed257b2b13955b63ace51784a0308eb8bc36316) 61 | Mon Oct 23 16:45:30 2023 +0000 62 | - The anthropic package version was updated from 0.3.11 to 0.5.0 in the requirements.txt file. No other changes were made to the file. 63 | ## [Updated README with new badges](https://github.com/joshuasundance-swca/ai_changelog/commit/c71975375374c80218b8c4369d7654d828fb50d9) 64 | Thu Oct 19 15:29:03 2023 -0400 65 | - The README.md file has been updated to include new badges for PyPI publishing and Docker Hub pushing. The Docker badge has been replaced with a new one that reflects the status of Docker Hub pushes. 66 | ## [Updated badges in README.md](https://github.com/joshuasundance-swca/ai_changelog/commit/4b34410086ac2d0e62afa10fb52a3612896946d4) 67 | Thu Oct 19 10:48:57 2023 -0400 68 | - This commit updates the badges displayed in the README.md file. Some badges have been added to provide more information about the project, such as Docker details, Code Climate metrics, and a known vulnerabilities badge. Some existing badges have been reordered. 69 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/89946ea1796f331d698bb0b2106cd93b61ea6743) 70 | Mon Oct 16 08:43:41 2023 +0000 71 | - The langchain version was updated from 0.0.308 to 0.0.315 in the requirements.txt file. This update may include bug fixes, new features, or improvements in the langchain package. 72 | ## [Updated project version from 0.0.12 to 0.0.13](https://github.com/joshuasundance-swca/ai_changelog/commit/39effeb73933bc7f7f47e0358f92fe3a3b13b3d9) 73 | Fri Oct 6 21:03:07 2023 -0400 74 | - The project's version number has been updated from 0.0.12 to 0.0.13 in three files: 75 | - 1. The __version__ variable in ai_changelog/__init__.py 76 | - 2. The version attribute in the [project] section of pyproject.toml 77 | - 3. The current_version attribute in the [tool.bumpver] section of pyproject.toml 78 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/63d56639876f067797b382c94edeeba5b1c715ba) 79 | Thu Oct 5 13:54:40 2023 +0000 80 | - The langchain version in the requirements.txt file was updated from 0.0.305 to 0.0.308. This update likely includes bug fixes or new features from the langchain library. 81 | ## [Version update from 0.0.11 to 0.0.12](https://github.com/joshuasundance-swca/ai_changelog/commit/57c1da05f42208a57a1326bac6eaa42067c4cc5d) 82 | Mon Oct 2 09:01:46 2023 -0400 83 | - This commit represents a version bump from 0.0.11 to 0.0.12. The version number has been updated in multiple places: the `__init__.py` file, the `pyproject.toml` file, and the `bumpver` tool configuration. This suggests that a new version of the software is being prepared for release, with changes that are significant enough to warrant a version number increment. 84 | ## [Updated Pydantic version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/0fb3a28fe832c7194073270dca51597c9894e689) 85 | Mon Oct 2 08:38:36 2023 +0000 86 | - This commit updates the Pydantic library version from 2.4.0 to 2.4.2 in the requirements.txt file. This update might include bug fixes, new features, or performance improvements in the Pydantic library. 87 | ## [Updated langchain version in requirements.txt](https://github.com/joshuasundance-swca/ai_changelog/commit/cd7606d9f794816c90a5e582be8e56a574491e40) 88 | Mon Oct 2 08:38:27 2023 +0000 89 | - The langchain version in the requirements.txt file was updated from 0.0.300 to 0.0.305. This update could include bug fixes or new features in the langchain library. 90 | ## [Updated OpenAI package version](https://github.com/joshuasundance-swca/ai_changelog/commit/8e28e72c875302ba17e62b8b34da7b214970ad89) 91 | Mon Oct 2 08:38:16 2023 +0000 92 | - The OpenAI package version in the requirements.txt file has been updated. The previous version was 0.28.0 and it has been upgraded to 0.28.1. This update may include bug fixes, security improvements, or new features from the OpenAI package. 93 | ## [Updated project version to 0.0.11](https://github.com/joshuasundance-swca/ai_changelog/commit/1a15c0ebe991cbc32d5a01ab0e9ee949a2d201bf) 94 | Thu Sep 28 14:32:58 2023 -0400 95 | - The project's version number in __init__.py, pyproject.toml, and tool.bumpver has been updated from 0.0.10 to 0.0.11. 96 | - This update reflects the new changes or features added to the project. 97 | ## [Refactored the AI Changelog workflow file](https://github.com/joshuasundance-swca/ai_changelog/commit/2478280647ca2d5e865254b76ed0df71bf585b8d) 98 | Thu Sep 28 14:31:19 2023 -0400 99 | - The commit involves the refactoring of the AI Changelog GitHub workflow file. The changes include the removal of unnecessary line breaks and comments, thereby improving the readability of the code. The Anyscale provider section has been commented out, suggesting it's not currently in use. The Python version used in the setup has been updated to 3.11. 100 | ## [Removed task from TODO list in README](https://github.com/joshuasundance-swca/ai_changelog/commit/a72e1649321d42f27645b6a42d50a6aebe289e97) 101 | Thu Sep 28 18:25:40 2023 +0000 102 | - This commit indicates a task was removed from the TODO list in the README file. The task 'More robust chains for non-OpenAI LLMs' is no longer listed, suggesting it has been completed or is no longer needed. 103 | ## [Updated file exclusion in pre-commit configuration](https://github.com/joshuasundance-swca/ai_changelog/commit/dcd6204393ab0424fc0cb478aa58d808efbb2fef) 104 | Wed Sep 27 18:56:58 2023 -0400 105 | - The .pre-commit-config.yaml file was modified to exclude AI_CHANGELOG.md instead of .idea and docs directories. The change ensures that the specified file is not included during pre-commit checks. 106 | ## [Adjusted format of AI changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/d12d4b911edd5c77325a49d092dceecffcff7eba) 107 | Wed Sep 27 18:53:08 2023 -0400 108 | - The output string in the update_changelog function in ai_changelog/utils.py was modified to include a newline character at the end of the existing content. This change ensures that the AI changelog is formatted correctly when new commit descriptions are added. 109 | ## [Refactored output file argument name in main function](https://github.com/joshuasundance-swca/ai_changelog/commit/80476ed0247b0cd8421a300ee21d69ef142405fa) 110 | Wed Sep 27 17:25:39 2023 -0400 111 | - In the main function, the argument for the output file has been renamed. Previously, it was referred to as 'output', but it has now been renamed to 'output_file' for better clarity and understanding. This change helps in making the code more readable and self-explanatory. 112 | ## [Renamed 'get_model' to 'get_llm' and updated references](https://github.com/joshuasundance-swca/ai_changelog/commit/f58faf5a129820aa16be21678616aab4f4e303c2) 113 | Wed Sep 27 17:23:40 2023 -0400 114 | - The function 'get_model' in ai_changelog/utils.py has been renamed to 'get_llm'. 115 | - All references to 'get_model' in ai_changelog/__main__.py have been updated to 'get_llm'. 116 | - The variable 'model' in ai_changelog/__main__.py has been renamed to 'llm' to reflect this change. 117 | ## [Added output file option to AI changelog generation script](https://github.com/joshuasundance-swca/ai_changelog/commit/6a319c8c3c750513c7d3f2a69a11182c56e0161c) 118 | Wed Sep 27 17:22:47 2023 -0400 119 | - This commit introduces an option to specify the output file for the AI changelog generation script. The '-o' or '--output_file' argument has been added to the argument parser in 'ai_changelog/__main__.py'. 120 | - The 'get_existing_changelog' and 'update_changelog' functions in 'ai_changelog/utils.py' have been updated to accept the 'output_file' as an argument and use it instead of the hardcoded 'AI_CHANGELOG.md'. 121 | - This change allows users to specify the output file and makes the script more flexible. 122 | ## [Bumped version from 0.0.9 to 0.0.10](https://github.com/joshuasundance-swca/ai_changelog/commit/67f2ec854bf55e33a638b81754b52c3aca57a3ff) 123 | Wed Sep 27 15:06:26 2023 -0400 124 | - Updated the version number in multiple files from 0.0.9 to 0.0.10. The files impacted are __init__.py, pyproject.toml, and tool.bumpver in the project configuration. 125 | ## [Refactor markdown_template in CommitInfo class](https://github.com/joshuasundance-swca/ai_changelog/commit/df0ea45e47fde46f6513c5fe889501a53488a797) 126 | Wed Sep 27 14:51:06 2023 -0400 127 | - The markdown_template string was moved from being a class attribute to a module-level constant in the pydantic_models.py file. This change was made to improve the structure of the code and to ensure that the markdown_template string is only defined once and reused, as it doesn't need to be an instance variable. 128 | ## [Added max_concurrency argument to ai_changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/d4db141f05cbb573081d38768b1073d434994f31) 129 | Wed Sep 27 14:48:10 2023 -0400 130 | - Added a new argument `--max_concurrency` to the main function in `ai_changelog/__main__.py`. This argument sets the maximum number of concurrent connections to the llm provider. A default value of 0 implies no limit. 131 | - In `ai_changelog/utils.py`, updated the `get_descriptions` and `update_changelog` functions to accept `max_concurrency` as an argument. This value is then passed to the `RunnableConfig` in the `chain.batch` call. 132 | ## [Added anthropic to requirements](https://github.com/joshuasundance-swca/ai_changelog/commit/dad3d562a7ab6b9dbb0eceabf05082bb3235756c) 133 | Wed Sep 27 14:33:11 2023 -0400 134 | - The anthropic package version 0.3.11 was added to the requirements.txt file. This change implies that this package is now a dependency for the project. 135 | ## [Refactored get_descriptions function in ai_changelog/utils.py](https://github.com/joshuasundance-swca/ai_changelog/commit/144cd8ce2c6a18c4ee155e51f559c5ef2ce3364f) 136 | Wed Sep 27 14:25:31 2023 -0400 137 | - In this commit, the get_descriptions function in ai_changelog/utils.py was refactored. The logic for creating the chain for getting commit descriptions was updated based on the provider. If the provider is 'openai', it uses the create_structured_output_chain function. Otherwise, it creates a new PydanticOutputParser object and a new ChatPromptTemplate object before creating the chain. The way outputs are extracted from the results was also modified to account for these changes. 138 | ## [Added provider support to commit description generation](https://github.com/joshuasundance-swca/ai_changelog/commit/55ca48dee8b878c971becd0d843307b3a7d5867e) 139 | Wed Sep 27 14:14:21 2023 -0400 140 | - The commit introduces the ability to specify a provider when generating descriptions for a list of commits. Depending on the provider, a different output chain is used to fetch and parse the descriptions. The 'provider' parameter was also added to the 'get_descriptions' and 'update_changelog' functions. Additionally, the commit includes the import and usage of the 'PydanticOutputParser' and 'RunnableConfig' classes, which are used when the provider is not 'openai'. 141 | ## [Added global git configuration to Dockerfile](https://github.com/joshuasundance-swca/ai_changelog/commit/7ec97dafe39aee4bcb27d6772c297c3351f6cd64) 142 | Wed Sep 27 13:50:43 2023 -0400 143 | - In the Dockerfile, a new git configuration has been added. This configuration sets the global 'safe.directory' to '*'. This change ensures that all directories are considered safe by git. 144 | ## [Updated langchainhub version](https://github.com/joshuasundance-swca/ai_changelog/commit/2e6db8e0edc475b4f67575c62cf10c1db4c34b41) 145 | Wed Sep 27 13:47:50 2023 -0400 146 | - The version of the langchainhub dependency in the requirements.txt file has been updated from 0.0.303 to 0.1.13. 147 | ## [Added langchainhub to requirements](https://github.com/joshuasundance-swca/ai_changelog/commit/6e5333f4b09425e19857aef0cbdd9f64494e88cd) 148 | Wed Sep 27 13:47:05 2023 -0400 149 | - A new requirement 'langchainhub' has been added to the requirements.txt file. The version specified for this new requirement is 0.0.303. 150 | ## [Renamed 'hub_prompt_str' argument to 'hub_prompt'](https://github.com/joshuasundance-swca/ai_changelog/commit/5b6b4b4902e5f1efa384b57aeb11808dbad6e940) 151 | Wed Sep 27 13:36:21 2023 -0400 152 | - In the main function of ai_changelog/__main__.py, the argument 'hub_prompt_str' has been renamed to 'hub_prompt'. This change is likely made to improve code readability and maintain a consistent naming convention. 153 | ## [Refactored command line arguments in ai_changelog/__main__.py](https://github.com/joshuasundance-swca/ai_changelog/commit/f653fa1f06cb3735a36a77b82b554f70bbf6fe59) 154 | Wed Sep 27 13:34:23 2023 -0400 155 | - This commit modifies the command line arguments in the ai_changelog/__main__.py script. Changes include: 156 | - 1. Updated the help text for the 'refs' argument to better reflect its purpose. 157 | - 2. Changed the 'provider', 'model', 'temperature', 'max_tokens', and 'hub_prompt_str' arguments to optional by adding '--' before their names. 158 | - 3. Added choice validation to the 'provider' argument, limiting the options to 'openai', 'anthropic', and 'anyscale'. 159 | - 4. Removed the duplicate 'refs' argument. 160 | ## [Refactor: Removed redundant import and updated markdown template usage](https://github.com/joshuasundance-swca/ai_changelog/commit/e71132c6f33bd4f7ba099849ebbd102db1a42111) 161 | Wed Sep 27 13:30:33 2023 -0400 162 | - This commit removes an unnecessary import statement from 'ai_changelog.pydantic_models.py'. The 'markdown_template' import from 'ai_changelog.string_templates' has been removed as it's no longer in use. 163 | - Additionally, the usage of 'markdown_template' in the 'CommitInfo' class has been updated. Instead of calling 'markdown_template.format()', it now calls 'self.markdown_template.format()'. This change indicates that the markdown template is now an instance variable of the 'CommitInfo' class. 164 | ## [Enhanced `ai_changelog` module with new features and refactored existing code](https://github.com/joshuasundance-swca/ai_changelog/commit/80a504a7e0f7fc46544edd7badaaf591025589ad) 165 | Wed Sep 27 13:28:14 2023 -0400 166 | - This commit introduces several enhancements and changes to the `ai_changelog` module. The `__main__.py` file has been updated to include more command-line arguments for the `main` function, allowing more granular control over the model and its parameters. This includes arguments for the model API provider, model name, model temperature, maximum tokens in output, and verbosity. 167 | - The `pydantic_models.py` file has been updated to include a markdown template in the `CommitInfo` class, providing a standard format for commit information. 168 | - A significant change is the deletion of the `string_templates.py` file, indicating a shift in the way strings are handled in the module. 169 | - Finally, the `utils.py` file has seen extensive updates, including the addition of `get_model` and `get_prompt` functions, which return a chat model and a chat prompt template respectively. The `get_descriptions` and `update_changelog` functions have also been updated to accommodate these changes. 170 | ## [Bumped version from 0.0.8 to 0.0.9](https://github.com/joshuasundance-swca/ai_changelog/commit/c267dcd4d5f10831854d905af16693183cfde5dd) 171 | Mon Sep 25 21:21:54 2023 -0400 172 | - Updated the version number in __init__.py, pyproject.toml, and the bumpver tool settings from 0.0.8 to 0.0.9. This is likely in preparation for a new release. 173 | ## [Implemented Docker Hub workflow, updated README, and made changes to AI Changelog and Dockerfile](https://github.com/joshuasundance-swca/ai_changelog/commit/ac03673eb2dbc3fbed2410deb2b8bce4d0334bfb) 174 | Mon Sep 25 21:19:38 2023 -0400 175 | - 1. Updated the AI Changelog workflow to ignore changes in the README file. 176 | - 2. Created a new workflow for pushing to Docker Hub upon tagging a new release. 177 | - 3. Updated the Dockerfile to change the default command from bash to running ai_changelog. 178 | - 4. Made various updates to the README, including changing the Python version badge, expanding on the usage instructions, and updating the TODO list. 179 | ## [Bumped project version from 0.0.6 to 0.0.7](https://github.com/joshuasundance-swca/ai_changelog/commit/c300f40199f7995f4127d87e86673ef1a5297ad5) 180 | Mon Sep 25 22:17:16 2023 +0000 181 | - This commit updates the project's version number from 0.0.6 to 0.0.7. The version number has been updated in three files: ai_changelog/__init__.py, pyproject.toml, and tool.bumpver's current_version. This indicates a new version release of the project. 182 | ## [Updated project version to 0.0.6](https://github.com/joshuasundance-swca/ai_changelog/commit/dd93d4e6a842227f134d70b50ddadec21b2cce72) 183 | Mon Sep 25 18:07:37 2023 -0400 184 | - The version of the project has been updated in multiple files including __init__.py, pyproject.toml. The new version is 0.0.6. 185 | ## [Updated project version to 0.0.5](https://github.com/joshuasundance-swca/ai_changelog/commit/e0089715678d5566e53d3451d0058a7fa554cba8) 186 | Mon Sep 25 18:00:14 2023 -0400 187 | - The project version in multiple files (__init__.py, pyproject.toml) has been updated from 0.0.4 to 0.0.5. This includes the version information in the project metadata and the bumpver tool configuration. 188 | ## [Removed condition for changelog update](https://github.com/joshuasundance-swca/ai_changelog/commit/de2cb250e4511cd9f78d99ddc2cbb6f36e018836) 189 | Mon Sep 25 17:56:08 2023 -0400 190 | - This commit removes the condition that restricted the 'update-changelog' job to only run if a pull request was merged. Now, the job will run on every push to the 'AI_CHANGELOG.md' file. 191 | ## [Bump project version to 0.0.4](https://github.com/joshuasundance-swca/ai_changelog/commit/7b378b121c752d86cbd83afa4d46b9989bd1b122) 192 | Mon Sep 25 17:42:00 2023 -0400 193 | - The project's version number has been incremented from 0.0.3 to 0.0.4. This change has been reflected in the project's main __init__.py file, the pyproject.toml file, and the bumpver tool's configuration. 194 | ## [Modified GitHub Actions workflow and updated AI_CHANGELOG.md](https://github.com/joshuasundance-swca/ai_changelog/commit/93cec296e86418f26cf1df2c1c36790666145a47) 195 | Mon Sep 25 17:41:50 2023 -0400 196 | - In the GitHub Actions workflow, the trigger for the build job was changed. It now only runs on push events that start with 'refs/tags', instead of on all push events to the 'main' branch and any tags. The 'AI_CHANGELOG.md' file was also updated, but the changes were not specified. 197 | ## [Refactored GitHub workflows for AI Changelog and PyPi publishing](https://github.com/joshuasundance-swca/ai_changelog/commit/640d8401422e768be6c5e8abfa45f0381cde6d43) 198 | Mon Sep 25 16:00:04 2023 -0400 199 | - Removed the REPO_NAME environment variable from the AI Changelog workflow as it was not being used. 200 | - Added tags trigger to the PyPi publishing workflow to ensure package publishing occurs whenever a new tag is pushed. 201 | - Removed the condition to only publish to PyPi on tag pushes as it's now redundant with the new tags trigger. 202 | ## [Bumped up the version from 0.0.2 to 0.0.3](https://github.com/joshuasundance-swca/ai_changelog/commit/8999719b7183627be97bfdaa4e64b40a349e6518) 203 | Mon Sep 25 15:50:27 2023 -0400 204 | - This commit includes an update to the version number of the 'ai_changelog' project. The version number has been incremented from 0.0.2 to 0.0.3. This change has been made in the '__init__.py', 'pyproject.toml' files, and the 'tool.bumpver' section of the project. 205 | ## [Renamed environment names in GitHub actions](https://github.com/joshuasundance-swca/ai_changelog/commit/1e75f6c64f95cfe4b8d2ffe638a172e928bd6ce1) 206 | Mon Sep 25 15:47:41 2023 -0400 207 | - This commit changes the 'name' property of the 'environment' in the GitHub action workflows for publishing to PyPI and TestPyPI. The name 'pypi' and 'testpypi' have been replaced with 'release' in both workflows. 208 | ## [Added GitHub workflow for Python package publishing](https://github.com/joshuasundance-swca/ai_changelog/commit/dc06aeef1fa8540f8e60c5fdc140ed94c12601f7) 209 | Mon Sep 25 15:42:42 2023 -0400 210 | - A new GitHub workflow file has been added to automate the process of publishing the Python package to PyPI and TestPyPI. The workflow triggers on push events to the main branch, excluding changes to the 'AI_CHANGELOG.md' file. 211 | - The workflow includes several jobs: building the distribution package, publishing the package to PyPI and TestPyPI, signing the distribution with Sigstore, and uploading the signed package to a GitHub Release. 212 | - The building process uses Python 3.11 and the pypa/build module. The distribution packages are stored as artifacts for later jobs. 213 | - The publishing process to PyPI only triggers on tag pushes. The publishing to TestPyPI happens regardless of the push event type. 214 | - The signing process uses the sigstore/gh-action-sigstore-python GitHub action and the signatures are uploaded to a GitHub Release. 215 | ## [Updated the project version to 0.0.2](https://github.com/joshuasundance-swca/ai_changelog/commit/d05f7c9c14c411f81f3e9b4e157dae990eb77ff3) 216 | Mon Sep 25 15:16:19 2023 -0400 217 | - The version of the 'ai_changelog' project has been updated from 0.0.1 to 0.0.2. This change is reflected in the '__init__.py' file, the 'pyproject.toml' file, and the 'bumpver' tool settings. 218 | ## [Updated AI_CHANGELOG.md, __init__.py, and pyproject.toml files](https://github.com/joshuasundance-swca/ai_changelog/commit/fb81aaffc7902b4960ede066299cc73d5804066e) 219 | Mon Sep 25 15:15:47 2023 -0400 220 | - Updated AI_CHANGELOG.md to include a newline at the end of the file. 221 | - Added a version variable to __init__.py in the ai_changelog module. 222 | - Updated the pyproject.toml file to include the author's name, changed the keywords, added optional dependencies, and included bumpver tool configurations. 223 | ## [Adjusted changelog parsing start line](https://github.com/joshuasundance-swca/ai_changelog/commit/275a1b053f5cd5f8e6fa8d1787347f3950129325) 224 | Mon Sep 25 13:23:18 2023 -0400 225 | - Updated the line from which the AI_CHANGELOG.md file starts being read. Previously, it was starting from the 3rd line, now it starts from the 2nd line. 226 | ## [Updated GitHub Actions Workflow](https://github.com/joshuasundance-swca/ai_changelog/commit/1e52ffe64077caa49ff22719e8b35a16c54ae956) 227 | Mon Sep 25 13:12:38 2023 -0400 228 | - In this commit, the token used for the Checkout code step in the GitHub Actions workflow (ai_changelog_main_push.yml) was changed from GITHUB_TOKEN to PAT. Additionally, the force push option was removed from the Commit changes step. 229 | Mon Sep 25 12:47:54 2023 -0400 230 | - This commit introduces a README.md file for the AI Changelog project. The README provides details about the project, such as its licensing, Python version compatibility, and security measures. It also includes usage instructions for local and GitHub workflow environments, configuration tips, and a list of pending tasks. 231 | ## [Fixed argument parsing bug in ai_changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/981e5d9ca2d97f43ba265dab079e9c46fd7aa9d7) 232 | Mon Sep 25 12:17:57 2023 -0400 233 | - This commit fixes a bug in the argument parsing section of the ai_changelog script. The bug was causing the script to fail when trying to split the 'ref' argument. The argument name has been corrected from 'ref' to 'refs'. 234 | ## [Refactored AI Changelog Script and Updated Changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/a153a21df0da27dbbdd8fb4bc7bb20d79f0b6a98) 235 | Mon Sep 25 12:17:03 2023 -0400 236 | - The commit includes changes in three files: ai_changelog_main_push.yml, AI_CHANGELOG.md, and __main__.py in the ai_changelog directory. 237 | - In ai_changelog_main_push.yml, the run command for the ai_changelog script was simplified to 'ai_changelog origin/main^..origin/main'. 238 | - In AI_CHANGELOG.md, a newline character was added at the end of the file. 239 | - In __main__.py, the argument parser in the main function was refactored. The '--before_ref' and '--after_ref' arguments were replaced with a single 'refs' argument. This argument takes a range of references in the format 'origin/main^..origin/main'. The before_ref and after_ref variables were then set by splitting the 'refs' argument. 240 | Mon Sep 25 11:31:17 2023 -0400 241 | - This commit introduces the MIT License to the project. The license grants permission for anyone to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software. It also includes a disclaimer of warranty. 242 | Mon Sep 25 14:13:28 2023 +0000 243 | - The Pydantic library version was upgraded from 2.3.0 to 2.4.0 in the requirements.txt file. 244 | - The langchain package version in the requirements.txt file has been updated from 0.0.298 to 0.0.300. 245 | Mon Sep 25 10:07:01 2023 -0400 246 | - This commit introduces several new files to the GitHub repository. It includes bug report and feature request templates, a pull request template, and a Dependabot configuration file. This will help streamline the issue reporting and feature request process, as well as ensure dependencies are kept up to date. 247 | - Additionally, the AI Changelog workflow has been updated to use the correct parameter names for the ai_changelog command. 248 | Sun Sep 24 00:56:46 2023 -0400 249 | - In the get_commits function, the outputs variable was refactored into two separate variables: dts and diffs. This change improves code readability by clearly separating the date time strings and diffs for each commit. 250 | ## [Refactored CommitInfo class in pydantic_models.py](https://github.com/joshuasundance-swca/ai_changelog/commit/66ed925d62e9e0c2933ed4f31efa4eed2289a89b) 251 | Sun Sep 24 00:43:32 2023 -0400 252 | - Removed unnecessary comment line in CommitDescription class. 253 | - Simplified the markdown method in the CommitInfo class by removing the optional repo_name parameter and the related error handling, instead directly using the get_repo_name method. 254 | ## [Refactored get_commits function in utils.py](https://github.com/joshuasundance-swca/ai_changelog/commit/7a2ad04177df1e1c1811f3823d8a78120cd34f3d) 255 | Sun Sep 24 00:39:38 2023 -0400 256 | - The get_commits function in utils.py was refactored to improve its readability and efficiency. The changes include the extraction of the dt_diffs_from_hashes function call to a separate variable 'outputs' before the return statement. This is followed by printing the 'outputs' to the console for debugging purposes. The diff attribute of the Commit object was also modified to strip any leading or trailing whitespace. 257 | ## [Refactoring and comment addition in `pydantic_models.py` and `utils.py`](https://github.com/joshuasundance-swca/ai_changelog/commit/47bedf192c67163a509856ef57e68c24732a9b82) 258 | Sun Sep 24 00:31:46 2023 -0400 259 | - Added a comment in `pydantic_models.py` for testing purposes. 260 | - Refactored the `get_commits` function in `utils.py` to call `dt_diffs_from_hashes` directly in the list comprehension. 261 | Sat Sep 23 21:17:03 2023 -0400 262 | - This commit includes a change to the AI Changelog GitHub Actions workflow. Specifically, it adds a commit message to the 'Commit changes' step of the workflow. 263 | Sun Sep 24 01:07:48 2023 +0000 264 | - This commit updates the Python setup and installation steps in the GitHub workflow. The Python version is now set to 3.11, and pip cache is enabled. The step for installing dependencies is renamed to 'Install Python libraries', and a command to install the current directory as a package is added. 265 | Sat Sep 23 20:37:34 2023 -0400 266 | - This commit refactors the import statements in __main__.py, pydantic_models.py, and utils.py. The changes involve removing the ai_changelog prefix from the import statements, which suggests a possible restructuring of the project's directory. 267 | Sat Sep 23 20:14:34 2023 -0400 268 | - This commit introduces several improvements to the formatting of the AI Changelog and Python scripts. 269 | - In the AI Changelog, leading and trailing whitespaces are now being stripped from each line. This ensures that the formatting of the commit descriptions is consistent and neat. 270 | - In the Python scripts, the 'infos_to_str' method in the 'CommitInfo' class now joins the commit descriptions with a single newline character instead of two, reducing the amount of whitespace in the output. Furthermore, the 'get_commits' function in 'utils.py' has been updated to strip leading and trailing whitespaces from the commit hash, date_time_str, and diff. 271 | ## [Improved whitespace handling in AI_CHANGELOG.md and refactored Python scripts](https://github.com/joshuasundance-swca/ai_changelog/commit/637ee98a2b90cdb527f5dd4778d0335f5567d5d9) 272 | Sat Sep 23 20:05:42 2023 -0400 273 | - This commit introduces several improvements to the handling of whitespace in the AI_CHANGELOG.md file and refactors parts of the Python scripts. 274 | - In the AI_CHANGELOG.md file, leading and trailing whitespaces are now being stripped from each line. This ensures that the formatting of the commit descriptions is consistent and neat. 275 | - In the Python scripts, the 'infos_to_str' method in the 'CommitInfo' class now joins the commit descriptions with a single newline character instead of two, reducing the amount of whitespace in the output. 276 | - Additionally, the 'main' function in the 'update.py' script now also strips leading and trailing whitespaces from each line of the existing content of the AI_CHANGELOG.md file. This prevents any unnecessary blank lines or spaces from appearing in the final output. 277 | ## [Added docstrings and refactored code in ai_changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/1851d1db5e81c109bde4a222c52cfcd54a7e6bba) 278 | Sat Sep 23 19:57:20 2023 -0400 279 | - Added descriptive docstrings to classes and functions in pydantic_models.py, update.py, and utils.py for better code understanding and readability. 280 | - Refactored the main function in update.py to handle command line arguments directly, simplifying the code structure. 281 | - Modified get_timestamp function in utils.py to rename the 'format' parameter to 'format_str' to avoid naming conflict with the built-in Python function 'format'. 282 | ## [Added .idea to .gitignore, updated AI_CHANGELOG.md, created Dockerfile, and refactored Python scripts](https://github.com/joshuasundance-swca/ai_changelog/commit/7ea969841abf61edc54cbf3ca78c3c35390b2bd7) 283 | Sat Sep 23 19:11:08 2023 -0400 284 | - The .idea directory was added to the .gitignore file to ignore files generated by the JetBrains IDE. 285 | - A newline character was added at the end of the AI_CHANGELOG.md file. 286 | - A new Dockerfile was created with instructions to build a Docker image for a Python 3.11 Alpine application. 287 | - The infos_to_str method was moved from the utils.py file to the pydantic_models.py file as a static method of the CommitInfo class. 288 | - The shebang line was added to the top of the update.py file to specify the Python 3 interpreter. 289 | - The call to the infos_to_str function in the update.py file was replaced with a call to the static method CommitInfo.infos_to_str. 290 | ## [Moved get_repo_name function from utils.py to pydantic_models.py](https://github.com/joshuasundance-swca/ai_changelog/commit/7250a98677a35700b431276f5c75fc0d17421e26) 291 | Sat Sep 23 13:08:14 2023 -0400 292 | - In this commit, the get_repo_name function was moved from the utils.py file to the pydantic_models.py file. This function is now a static method within the CommitInfo class. In addition, the function call in the markdown method has been updated to use the new location of the get_repo_name function. 293 | ## [Stripped extra whitespace from commit descriptions and existing content](https://github.com/joshuasundance-swca/ai_changelog/commit/37e40ab998fae03e4f54464b81a09945efd2cf10) 294 | Sat Sep 23 12:24:52 2023 -0400 295 | - The first commit removes any leading or trailing whitespace from the bullet points in the commit descriptions. This ensures that the formatting of the commit descriptions is consistent and neat. 296 | - The second commit makes sure that the existing content is stripped of any leading or trailing whitespace before it is appended to the new descriptions in the AI Changelog. This prevents any unnecessary blank lines or spaces from appearing in the final output. 297 | ## [Refactored commit fetching in update script](https://github.com/joshuasundance-swca/ai_changelog/commit/4e7d92dc02a93593824d2146fd30e3da6f08d210) 298 | Sat Sep 23 12:18:58 2023 -0400 299 | - The commit contains changes to the AI_CHANGELOG.md, ai_changelog/update.py, and ai_changelog/utils.py files. The changes in the update.py and utils.py scripts involve refactoring how commits are fetched. The 'base_ref' and 'head_ref' parameters were renamed to 'before_ref' and 'after_ref' to better reflect their purpose. The 'before_ref' represents the state of the repository before the changes, and the 'after_ref' represents the state after the changes. The way the commits are fetched was also changed. Instead of finding the common ancestor of 'before_ref' and 'after_ref', the commit hashes for 'before_ref' and 'after_ref' are fetched directly. The changes in the AI_CHANGELOG.md file involve adding a newline at the end of the file. 300 | ## [Refactored update.py to Encapsulate Logic in main() Function](https://github.com/joshuasundance-swca/ai_changelog/commit/d12fd25f591598805658854bfdaf2dc9eb5a3fb1) 301 | Fri Sep 22 17:58:04 2023 -0400 302 | - The code in update.py was refactored to encapsulate the main logic within a new main() function. This change improves the readability and structure of the code. The main() function now contains the logic for checking if AI_CHANGELOG.md exists, restoring the original version if it does, reading its contents, generating the new AI_CHANGELOG.md, writing the output, and adding the file to the git staging area. The script now calls the main() function if it is run as the main module. 303 | ## [Replaced bash script with python for updating changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/c21e386472d9aa04c8d73d6399e2103b83bc5357) 304 | Fri Sep 22 17:53:25 2023 -0400 305 | - The bash script used for updating the AI changelog has been replaced with a Python script. The Python script checks if the AI_CHANGELOG.md file exists. If it does, it restores the original version from the main branch and gets its contents starting from the 3rd line. 306 | - The script then generates new commit descriptions and combines them with the existing content. The new content is written to AI_CHANGELOG.md and the file is added to the git staging area. 307 | - In the GitHub workflow file, the run command has been updated to use the Python script instead of the bash script. 308 | ## [Updated Commit class field description](https://github.com/joshuasundance-swca/ai_changelog/commit/6f2e1077f88b32071a07dac5b1092b413ed61e20) 309 | Fri Sep 22 16:00:00 2023 -0400 310 | - The description for the 'date_time_str' field in the Commit class has been updated to improve clarity. The previous version lacked the 'description' keyword, which has now been added. 311 | ## [Added '--no-notes' option to git show command in get_commits function](https://github.com/joshuasundance-swca/ai_changelog/commit/f637f0de5bb2875872bb250b9f59d2d7607b8e0b) 312 | Fri Sep 22 15:58:51 2023 -0400 313 | - This commit introduces a modification to the 'get_commits' function in 'ai_changelog/utils.py'. 314 | - Specifically, the '--no-notes' option has been added to the git show command. This option suppresses the display of notes that annotate a commit, providing a cleaner output. 315 | ## [Added date and time to commit information](https://github.com/joshuasundance-swca/ai_changelog/commit/08866a85b73efb4cd7961ed695a5264569f2f337) 316 | Fri Sep 22 15:57:01 2023 -0400 317 | - The commit adds a formatted date and time string to the commit information. This is achieved by modifying the Commit class in the pydantic_models.py file, adding a new attribute 'date_time_str'. 318 | - In the string_templates.py file, the markdown template is updated to include the date and time string. The commit also simplifies the sys_msg and hum_msg templates in the same file. 319 | - The utils.py file is updated to include a new function 'get_timestamp' that retrieves the timestamp for a given commit hash. The 'get_commits' function is also modified to include the timestamp in the commit information. 320 | ## [Fixed issue with repeating commit summaries in changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/b84998fbdf949bc0daa9ac0d4f724b4406f67851) 321 | - This commit addresses the issue of repeating commit summaries in the changelog. Previously, the script would not properly rollback the previous additions to the AI_CHANGELOG.md file, leading to an accumulation of repeated summaries. 322 | - The fix involves changing the 'git checkout' command to specifically checkout the 'AI_CHANGELOG.md' file from the 'origin/main' branch, effectively discarding changes made in the working tree. 323 | ## [Updated AI Changelog](https://github.com/joshuasundance-swca/ai_changelog/commit/529609cb0748a803c601dee4408815a00cac8bfc) 324 | - The commit 529609cb0748a803c601dee4408815a00cac8bfc includes several updates to the AI Changelog: 325 | - 1) Fixed a typo in the markdown_template URL in the file ai_changelog/string_templates.py. 326 | - 2) Introduced a hyperlink to the commit in the markdown output by modifying the markdown template in 'string_templates.py' and updating the 'markdown' method in the 'CommitInfo' class of 'pydantic_models.py'. 327 | - 3) Added the 'REPO_NAME' environment variable in '.github/workflows/ai_changelog_main_pr.yml' to store the repository name. 328 | - 4) Included the functionality to create hyperlinks in markdown by modifying the markdown template in the 'string_templates.py' file and adding an optional 'repo_name' parameter to the 'markdown' method in the 'CommitInfo' class. 329 | ## [Fixed typo in markdown_template string](https://github.com/joshuasundance-swca/ai_changelog/commit/ddd9ce75383893fee14132a284eec573c46a002c) 330 | - The commit ddd9ce75383893fee14132a284eec573c46a002c by Joshua Sundance Bailey on Fri Sep 22 15:05:12 2023 is a minor fix for a typo in the 'markdown_template' string in the ai_changelog/string_templates.py file. 331 | - The change involves correcting the GitHub URL format in the markdown template. The word 'commits' has been changed to 'commit' in the hyperlink format. 332 | ## [Added hyperlink to commit in markdown](https://github.com/joshuasundance-swca/ai_changelog/commit/eb037d5ab4211fcfb8db3a96c96dbd4359fac967) 333 | - The commit '7e7e956c59fb42752f6f607b28427669e30c24f5' introduces a hyperlink to the commit in the markdown output. This was achieved by modifying the markdown template in 'string_templates.py' to include the repository name and commit hash in a GitHub URL format. 334 | - To accommodate this change, the 'markdown' method in 'CommitInfo' class of 'pydantic_models.py' was updated to accept an optional 'repo_name' parameter. If 'repo_name' is not provided, the method attempts to fetch it from the environment variables. 335 | - A new environment variable 'REPO_NAME' is added in '.github/workflows/ai_changelog_main_pr.yml' to store the repository name. 336 | ## [Added hyperlink functionality to markdown](https://github.com/joshuasundance-swca/ai_changelog/commit/7e7e956c59fb42752f6f607b28427669e30c24f5) 337 | - The commit introduces the functionality to create hyperlinks in markdown. Changes were made to the 'ai_changelog_main_pr.yml', 'pydantic_models.py', and 'string_templates.py' files. 338 | - In the 'ai_changelog_main_pr.yml', the REPO_NAME was added as an environment variable. 339 | - In 'pydantic_models.py', the 'markdown' method was updated to include the 'repo_name' parameter, which defaults to the REPO_NAME environment variable if not provided. If the 'repo_name' is not provided and the REPO_NAME environment variable is not set, a ValueError is raised. 340 | - In 'string_templates.py', the markdown template was modified to include a hyperlink to the commit in the short description. 341 | ## Added .gitignore file 342 | 7389ceff6fc1a2e81146f0215d83b58419e9cbdd 343 | ---------------- 344 | - This commit introduces a .gitignore file to the project. The .gitignore file specifies intentionally untracked files that Git should ignore. This includes various Python-related files and directories, such as .pyc files, __pycache__ directories, virtual environments (venv), and others. This helps to keep the repository clean from unnecessary files, especially those that are generated during code execution or by the development environment. 345 | ## Fixed pip install command in GitHub Actions workflow 346 | 3ac4b562ceb2b11b1edcb9d196c7086365274608 347 | ---------------- 348 | - Corrected the pip install command in the .github/workflows/ai_changelog_main_pr.yml GitHub Actions workflow file. The previous command attempted to install a package called 'requirements.txt', which is incorrect. The corrected command uses the -r flag to correctly install the packages listed in the requirements.txt file. 349 | ## Added requirements.txt 350 | 1f59a6ee1804d15af2d59eb047b178cc512ea969 351 | ---------------- 352 | - A new file named requirements.txt has been added to the project. This file contains the following Python dependencies: 353 | - 1. langchain version 0.0.298 354 | - 2. openai version 0.28.0 355 | - 3. pydantic version 2.3.0 356 | ## Separated Python setup and dependency installation steps in GitHub workflow 357 | 897ac1dd8135ed3099d660d15035504c425e3d3e 358 | ---------------- 359 | - In the GitHub workflow file 'ai_changelog_main_pr.yml', the Python setup and dependency installation steps were previously combined. This commit separates these two steps into individual actions. The Python setup now uses the 'actions/setup-python@v4' action with Python version 3.11 and pip caching. The installation of dependencies is now a separate step, which runs 'pip install --user requirements.txt'. 360 | ## Refactored Python setup in GitHub workflow and updated import statements in Python scripts 361 | 5df12c7f15ffeea1447734a3354dbc37bdb31df9 362 | ---------------- 363 | - Updated Python setup in GitHub workflow to use version 4 of the setup-python action and added pip cache. Also, changed the installation of dependencies to use a requirements file instead of installing packages individually. 364 | - Removed unnecessary __init__.py file from ai_changelog directory. 365 | - Refactored import statements in pydantic_models.py, update.py, and utils.py to import from local directories instead of ai_changelog. 366 | - Wrapped main execution block in update.py within a main() function. 367 | ## Fixed script execution command 368 | b88f695bf2f58c70e828077830fb4365aacff32e 369 | ---------------- 370 | - Updated the command to execute the 'update_changelog.sh' script in the GitHub workflow file 'ai_changelog_main_pr.yml'. 371 | - The script is now being run with '/bin/bash' to ensure the correct shell environment. 372 | ## Refactored AI Changelog Update Process 373 | ff7719e90b74122f6d326b5a4c1ff070fdcc698f 374 | ---------------- 375 | - This commit refactors the AI changelog update process. Previously, the update process was directly embedded in the Github Action workflow file (ai_changelog_main_pr.yml). This commit moves the update process into a separate shell script (update_changelog.sh) to improve code organization and readability. 376 | ## Installation and implementation of pre-commit hooks 377 | baa19fd17f49932c007e76fecf0dcda90e986283 378 | ---------------- 379 | - This commit introduces the installation and running of pre-commit hooks to ensure code quality before commits are pushed. The hooks include checks for syntax errors, merge conflicts, trailing whitespaces, and more. 380 | - The commit also includes minor modifications to the ai_changelog_main_pr.yml, AI_CHANGELOG.md, pydantic_models.py, and utils.py files. These changes mainly involve formatting adjustments and do not impact the functionality of the code. 381 | ## Updated GitHub action to call the update script from new location 382 | 2d28faafa321b4a3b38fff09d54e2d7025034d1c 383 | ---------------- 384 | - This commit updates the GitHub action workflow to call the update script from its new location. Previously, the script was called directly from the root directory. Now, it's located inside the 'ai_changelog' directory. 385 | ## Refactor main function to new file and rename ai_changelog.py to utils.py 386 | bad72996e057ae700e957f00a5a8dddd9827dfd7 387 | ---------------- 388 | - The main function that was previously in ai_changelog.py has been moved to a new file called update.py. This helps in organizing the codebase and separating concerns. 389 | - The ai_changelog.py file has been renamed to utils.py, indicating that this file is now primarily used for utility functions like get_commits, get_descriptions, and infos_to_str. 390 | ## Refactored main script into separate functions 391 | 610f994f9aeb242b76e9bfc0966079c96670a797 392 | ---------------- 393 | - This commit refactors the main script in 'ai_changelog.py' by splitting the main execution block into separate functions. This change improves the modularity and readability of the code. 394 | - The 'get_commits' function was already present. Two new functions were added: 'get_descriptions' and 'infos_to_str'. 395 | - 'get_descriptions' takes a list of commits as input and returns a list of 'CommitInfo' objects, which contain both the original commit and its generated description. 396 | - 'infos_to_str' takes a list of 'CommitInfo' objects and returns a formatted string representation of these objects, ready for printing. 397 | - The main execution block now simply calls these functions in sequence and prints the final string. 398 | ## Moved ai_changelog.py to a new directory 399 | 1cd076994b323ffb646df8428d2a7ad241be9d27 400 | ---------------- 401 | - The ai_changelog.py file was moved from the root directory to a new subdirectory named ai_changelog. This change does not affect the functionality of the file but helps in organizing the codebase. 402 | ## Refactored code by moving Pydantic models to a separate file 403 | 87294d34d1112c45376f6e8ae334208bf2c19e8b 404 | ---------------- 405 | - Moved the Pydantic models 'Commit', 'CommitDescription', and 'CommitInfo' from 'ai_changelog.py' to a new file named 'ai_changelog/pydantic_models.py'. 406 | - This change helps to keep the codebase organized and improves the readability of the 'ai_changelog.py' file by reducing its length and complexity. 407 | ## Refactored string templates to a separate file 408 | 5f9ac629d38703cc640456ac2474e5aef95aafcc 409 | ---------------- 410 | - The commit involves moving the string templates (sys_msg, hum_msg, markdown_template) used in the ai_changelog.py file to a separate file named string_templates.py within the same directory. 411 | - This change helps in improving the code organization and readability by separating the string templates from the main logic of the program. 412 | - The ai_changelog.py file was updated to import the string templates from the new location. 413 | ## Creation of ai_changelog/__init__.py 414 | b8b3377a6f0016108c8860d28fa23ef0098e4418 415 | ---------------- 416 | - This commit introduces a new file, ai_changelog/__init__.py. The file does not contain any code yet as it is an initialization file. 417 | ## Removed hello_world.py 418 | b79d5c378120eabad7062cbad29dc0e1e9b6b2b1 419 | ---------------- 420 | - This commit deletes the file hello_world.py from the repository. The file previously contained a simple script for printing a 'Hello, world!' message and testing the bot's ability to generate commit messages from diffs. 421 | ## Added additional print statements to hello_world.py 422 | a4273faacb57222dfcec6f3446efc2f12bf40fc5 423 | ---------------- 424 | - The commit adds two new print statements to the 'hello_world.py' script. These messages provide more information about the purpose of the script and how the diff is generated. 425 | ## Added hello_world.py 426 | 0fdc81b6b26fe9c8d3dfed936e8c692f369119a7 427 | ---------------- 428 | - This commit introduces a new Python file named 'hello_world.py'. 429 | - The file contains a simple script that prints 'Hello, world!' when run. --------------------------------------------------------------------------------