{"slug": "build-an-ai-changelog-generator-in-python", "title": "Build an AI Changelog Generator in Python", "summary": "Telnyx released a Python example that uses its AI Inference API to generate structured changelog JSON from commit messages or git diffs. The Flask app exposes endpoints to generate, list, and retrieve changelogs, storing them in memory with unique IDs. The project is available on GitHub as part of Telnyx's code examples repository.", "body_md": "Writing changelogs is one of those developer tasks that sounds simple until you are staring at a messy commit history.\n\nSome commits matter to users. Some are internal cleanup. Some are merge commits. Some are meaningful only if you already know the codebase. I built a small Python example that turns commit messages or git diffs into structured changelog JSON using Telnyx AI Inference.\n\nCode: [https://github.com/team-telnyx/telnyx-code-examples/tree/main/changelog-generator-python](https://github.com/team-telnyx/telnyx-code-examples/tree/main/changelog-generator-python)\n\nThe Flask app exposes:\n\n```\nPOST /generate\nPOST /generate/from-diff\nGET /changelogs\nGET /changelogs/<id>\nGET /health\n```\n\n`POST /generate`\n\naccepts a list of commit messages:\n\n```\n{\n  \"version\": \"v1.4.0\",\n  \"repo_name\": \"billing-service\",\n  \"commits\": [\n    \"feat: add Stripe webhook retry with exponential backoff\",\n    \"fix: correct tax calculation for EU VAT exemption\",\n    \"docs: update API reference for invoice endpoint\"\n  ]\n}\n```\n\nThe app asks Telnyx AI Inference to return grouped changelog JSON with sections like:\n\nThere is also a `POST /generate/from-diff`\n\nendpoint if you want to summarize a git diff instead of commit messages.\n\nFor a changelog tool, plain text is useful, but structured output is more flexible.\n\nIf the response comes back as JSON, you can:\n\nThe example stores generated changelogs in memory and gives each one an ID, so you can list recent changelogs or retrieve a specific one.\n\nClone the examples repo:\n\n```\ngit clone https://github.com/team-telnyx/telnyx-code-examples.git\ncd telnyx-code-examples/changelog-generator-python\n```\n\nCreate your `.env`\n\nfile:\n\n```\ncp .env.example .env\n```\n\nAdd your Telnyx API key:\n\n```\nTELNYX_API_KEY=your_telnyx_api_key\nAI_MODEL=moonshotai/Kimi-K2.6\nHOST=127.0.0.1\n```\n\nInstall and run:\n\n```\npip install -r requirements.txt\npython app.py\n```\n\nTry it:\n\n```\ncurl -X POST http://localhost:5000/generate \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"version\": \"v1.4.0\",\n    \"repo_name\": \"billing-service\",\n    \"commits\": [\n      \"feat: add Stripe webhook retry with exponential backoff\",\n      \"fix: correct tax calculation for EU VAT exemption\",\n      \"docs: update API reference for invoice endpoint\"\n    ]\n  }' | python3 -m json.tool\n```\n\nThis is a small example, but it is a pretty practical developer tooling pattern:\n\nThe Telnyx code examples repo is also agent-readable, so you can use this example as a starting point and ask a coding agent to add GitHub integration, tag comparison, a UI, or a docs publishing step.", "url": "https://wpnews.pro/news/build-an-ai-changelog-generator-in-python", "canonical_source": "https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-an-ai-changelog-generator-in-python-2le9", "published_at": "2026-07-10 00:27:18+00:00", "updated_at": "2026-07-10 00:36:17.396237+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models"], "entities": ["Telnyx", "Telnyx AI Inference", "Flask", "GitHub", "Stripe"], "alternates": {"html": "https://wpnews.pro/news/build-an-ai-changelog-generator-in-python", "markdown": "https://wpnews.pro/news/build-an-ai-changelog-generator-in-python.md", "text": "https://wpnews.pro/news/build-an-ai-changelog-generator-in-python.txt", "jsonld": "https://wpnews.pro/news/build-an-ai-changelog-generator-in-python.jsonld"}}