mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
fix: duplicate key
This commit is contained in:
parent
d2fdcc23d8
commit
d05d52913b
32
.github/workflows/sync-upstream.yml
vendored
32
.github/workflows/sync-upstream.yml
vendored
@ -25,15 +25,33 @@ jobs:
|
|||||||
const upstream = 'songquanpeng/one-api';
|
const upstream = 'songquanpeng/one-api';
|
||||||
const [owner, repo] = upstream.split('/');
|
const [owner, repo] = upstream.split('/');
|
||||||
|
|
||||||
// 获取上游仓库的PR
|
// 使用分页获取所有上游仓库的PR
|
||||||
const pulls = await github.rest.pulls.list({
|
async function getAllPRs() {
|
||||||
owner,
|
let page = 1;
|
||||||
repo,
|
let allPulls = [];
|
||||||
state: 'open'
|
while (true) {
|
||||||
});
|
const pulls = await github.rest.pulls.list({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
state: 'open',
|
||||||
|
per_page: 100, // 每页获取最大数量
|
||||||
|
page: page
|
||||||
|
});
|
||||||
|
|
||||||
|
if (pulls.data.length === 0) break;
|
||||||
|
|
||||||
|
allPulls = allPulls.concat(pulls.data);
|
||||||
|
page++;
|
||||||
|
}
|
||||||
|
return allPulls;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取所有PR
|
||||||
|
const pulls = await getAllPRs();
|
||||||
|
console.log(`Found ${pulls.length} open PRs in upstream repository`);
|
||||||
|
|
||||||
// 为每个PR创建或更新对应的PR
|
// 为每个PR创建或更新对应的PR
|
||||||
for (const pull of pulls.data) {
|
for (const pull of pulls) {
|
||||||
try {
|
try {
|
||||||
const branchName = `upstream-pr-${pull.number}`;
|
const branchName = `upstream-pr-${pull.number}`;
|
||||||
|
|
||||||
|
@ -101,8 +101,6 @@ var ModelRatio = map[string]float64{
|
|||||||
"claude-3-7-sonnet-20250219": 3.0 / 1000 * USD,
|
"claude-3-7-sonnet-20250219": 3.0 / 1000 * USD,
|
||||||
"claude-3-7-sonnet-latest": 3.0 / 1000 * USD,
|
"claude-3-7-sonnet-latest": 3.0 / 1000 * USD,
|
||||||
"claude-3-opus-20240229": 15.0 / 1000 * USD,
|
"claude-3-opus-20240229": 15.0 / 1000 * USD,
|
||||||
"claude-3-7-sonnet-20250219": 3.0 / 1000 * USD,
|
|
||||||
"claude-3-7-sonnet-latest": 3.0 / 1000 * USD,
|
|
||||||
// https://cloud.baidu.com/doc/WENXINWORKSHOP/s/hlrk4akp7
|
// https://cloud.baidu.com/doc/WENXINWORKSHOP/s/hlrk4akp7
|
||||||
"ERNIE-4.0-8K": 0.120 * RMB,
|
"ERNIE-4.0-8K": 0.120 * RMB,
|
||||||
"ERNIE-3.5-8K": 0.012 * RMB,
|
"ERNIE-3.5-8K": 0.012 * RMB,
|
||||||
|
Loading…
Reference in New Issue
Block a user