Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 4d9eeb1

Browse files
committed
API token
1 parent 6c273e4 commit 4d9eeb1

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

.github/workflows/changelog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
name: changelog-${{ steps.date.outputs.date }}
4848
path: temp/**
4949
- name: Prompt
50+
env:
51+
LLM_JWT: ${{ secrets.LLM_JWT }}
5052
run: |
5153
python changelog.py --date ${{ steps.date.outputs.date }}
5254
git config user.name github-actions

changelog.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,31 @@ def main(vrn, d):
2727

2828
def gen_log(prompt):
2929

30-
log = None
3130
auth = os.environ.get('LLM_JWT')
32-
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {auth}"}
33-
payload = {
34-
"model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
35-
"messages": [
36-
{
37-
"role": "user",
38-
"content": prompt
39-
}
40-
]
41-
}
42-
43-
try:
44-
r = requests.post('https://openwebui.dev.devrev-eng.ai/api/chat/completions', json=payload,
45-
headers=headers)
46-
log = r.json()['choices'][0]['message']['content']
47-
log = re.sub(r"^Here's.*\n?", '', log, flags=re.MULTILINE)
48-
log = re.sub(r"^Let me know.*\n?", '', log, flags=re.MULTILINE)
49-
except Exception as e:
50-
print(
51-
f"Failed to generate changelog. Error: {type(e)} {e} {r}")
31+
if auth:
32+
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {auth}"}
33+
payload = {
34+
"model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
35+
"messages": [
36+
{
37+
"role": "user",
38+
"content": prompt
39+
}
40+
]
41+
}
42+
43+
try:
44+
r = requests.post('https://openwebui.dev.devrev-eng.ai/api/chat/completions', json=payload,
45+
headers=headers)
46+
log = r.json()['choices'][0]['message']['content']
47+
log = re.sub(r"^Here's.*\n?", '', log, flags=re.MULTILINE)
48+
log = re.sub(r"^Let me know.*\n?", '', log, flags=re.MULTILINE)
49+
except Exception as e:
50+
print(
51+
f"Failed to generate changelog. Error: {type(e)} {e} {r}")
52+
else:
53+
log = "No auth token"
54+
5255
return log
5356

5457

0 commit comments

Comments
 (0)