Skip to content

Commit 3227aff

Browse files
committed
Sync auto-advance-ball.yml from .github repo
1 parent d5d59c3 commit 3227aff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/auto-advance-ball.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ jobs:
144144
145145
async function callOpenAI({ apiKey, baseUrl, model, messages }) {
146146
if (!apiKey) throw new Error("OPENAI_API_KEY is not set.");
147-
const url = `${baseUrl.replace(/\\/$/, "")}/chat/completions`;
147+
const url = `${baseUrl.replace(new RegExp('/$'), "")}/chat/completions`;
148148
const payload = { model, messages };
149149
150-
const isGpt5ish = /gpt-?5/i.test(model) || /^o\\d/i.test(model) || /^o1/i.test(model);
150+
const gpt5Pattern = new RegExp('(gpt-?5|^o\\d|^o1)', 'i');
151+
const isGpt5ish = gpt5Pattern.test(model);
151152
if (isGpt5ish) {
152153
payload.max_completion_tokens = 2048;
153154
} else {

0 commit comments

Comments
 (0)