You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add changelog context extraction and embedding generation scripts
This commit introduces several new scripts for generating changelog context and embeddings. Key additions include `extract_changelog_context.py`, which gathers repository context such as README content, module docstrings, project structure, and changelog history. The `create_changelog_embeddings.py` script generates embeddings for these context files, enhancing the efficiency of changelog entry generation. Additionally, a Dockerfile and entrypoint script are added to facilitate containerization of the application, along with a .dockerignore file to manage ignored files during the build process. GitHub workflows for testing and updating changelogs are also included, streamlining the CI/CD process for changelog management.
# Use the embedding-based approach for more efficient token usage
83
+
# Read the embeddings
84
+
EMBEDDINGS=$(cat changelog_embeddings.json)
85
+
86
+
# Create a temporary payload file for the API call
87
+
cat > payload.json << 'EOF'
88
+
{
89
+
"model": "gpt-4o",
90
+
"messages": [
91
+
{"role": "system", "content": "You are a changelog generator that creates detailed, structured entries for pull requests. Generate a concise changelog entry in markdown format for the PR."},
92
+
{"role": "user", "content": "Generate a changelog entry for PR #${{ github.event.pull_request.number }} with title: \"${{ github.event.pull_request.title }}\". The PR description is: \"${{ github.event.pull_request.body }}\". Use the context embeddings to understand the codebase and create an appropriate entry."}
93
+
],
94
+
"context_embeddings":
95
+
EOF
96
+
97
+
# Append the embeddings JSON content to the payload
98
+
cat changelog_embeddings.json >> payload.json
99
+
100
+
# Make the API call
101
+
curl -s -X POST https://api.openai.com/v1/chat/completions \
0 commit comments