返回提交历史
Modified
.github/workflows/build-packages.yml
+26
-26
Modified
g4f/Provider/needs_auth/Gemini.py
+1
-1
Modified
g4f/api/__init__.py
+1
-1
XFEstudio/gpt4free
chore: Update GitHub Actions to use stable versions and adjust refresh interval in Gemini provider
4e1f988e
代码差异
3 个文件
+28
-28
@@ -18,7 +18,7 @@ jobs:
18
18
version: ${{ steps.version.outputs.version }}
19
19
is_release: ${{ steps.version.outputs.is_release }}
20
20
steps:
21
- uses: actions/checkout@v6
21
- uses: actions/checkout@v4
22
22
- name: Determine version
23
23
id: version
24
24
run: |
@@ -41,9 +41,9 @@ jobs:
41
41
runs-on: ubuntu-latest
42
42
needs: prepare
43
43
steps:
44
- uses: actions/checkout@v6
44
- uses: actions/checkout@v4
45
45
- name: Set up Python
46
uses: actions/setup-python@v6
46
uses: actions/setup-python@v5
47
47
with:
48
48
python-version: "3.x"
49
49
- name: Install build tools
@@ -59,7 +59,7 @@ jobs:
59
59
python -m twine check dist/*
60
60
ls -la dist/
61
61
- name: Upload PyPI artifacts
62
uses: actions/upload-artifact@v6
62
uses: actions/upload-artifact@v4
63
63
with:
64
64
name: pypi-package
65
65
path: dist/
@@ -76,9 +76,9 @@ jobs:
76
76
# Note: ARM64 cross-compilation on Windows requires additional setup
77
77
# Keeping architecture in matrix for future expansion
78
78
steps:
79
- uses: actions/checkout@v6
79
- uses: actions/checkout@v4
80
80
- name: Set up Python
81
uses: actions/setup-python@v6
81
uses: actions/setup-python@v5
82
82
with:
83
83
python-version: "3.11"
84
84
- name: Install dependencies
@@ -123,7 +123,7 @@ jobs:
123
123
Compress-Archive "dist\${exeName}" "dist\g4f-windows-${version}-${architecture}.zip"
124
124
}
125
125
- name: Upload Windows zip archive
126
uses: actions/upload-artifact@v6
126
uses: actions/upload-artifact@v4
127
127
with:
128
128
name: windows-exe-${{ matrix.architecture }}
129
129
path: dist/g4f-windows-*.zip
@@ -142,9 +142,9 @@ jobs:
142
142
runner: ubuntu-24.04-arm
143
143
runner-arch: aarch64
144
144
steps:
145
- uses: actions/checkout@v6
145
- uses: actions/checkout@v4
146
146
- name: Set up Python
147
uses: actions/setup-python@v6
147
uses: actions/setup-python@v5
148
148
with:
149
149
python-version: "3.11"
150
150
- name: Install dependencies
@@ -178,7 +178,7 @@ jobs:
178
178
chmod +x scripts/build-nuitka.sh
179
179
./scripts/build-nuitka.sh
180
180
- name: Upload Linux executable
181
uses: actions/upload-artifact@v6
181
uses: actions/upload-artifact@v4
182
182
with:
183
183
name: linux-exe-${{ matrix.architecture }}
184
184
path: dist/g4f-linux-*
@@ -195,9 +195,9 @@ jobs:
195
195
- architecture: arm64
196
196
runner-arch: arm64
197
197
steps:
198
- uses: actions/checkout@v6
198
- uses: actions/checkout@v4
199
199
- name: Set up Python
200
uses: actions/setup-python@v6
200
uses: actions/setup-python@v5
201
201
with:
202
202
python-version: "3.11"
203
203
- name: Install dependencies
@@ -231,7 +231,7 @@ jobs:
231
231
chmod +x scripts/build-nuitka.sh
232
232
./scripts/build-nuitka.sh
233
233
- name: Upload macOS executable
234
uses: actions/upload-artifact@v6
234
uses: actions/upload-artifact@v4
235
235
with:
236
236
name: macos-exe-${{ matrix.architecture }}
237
237
path: dist/g4f-macos-*
@@ -243,7 +243,7 @@ jobs:
243
243
if: needs.prepare.outputs.is_release == 'true'
244
244
steps:
245
245
- name: Checkout repository
246
uses: actions/checkout@v6
246
uses: actions/checkout@v4
247
247
- name: Set up QEMU
248
248
uses: docker/setup-qemu-action@v3
249
249
- name: Set up Docker Buildx
@@ -260,7 +260,7 @@ jobs:
260
260
username: ${{ secrets.DOCKER_USERNAME }}
261
261
password: ${{ secrets.DOCKER_PASSWORD }}
262
262
- name: Build and push armv7 image
263
uses: docker/build-push-action@v6
263
uses: docker/build-push-action@v5
264
264
with:
265
265
context: .
266
266
file: docker/Dockerfile-armv7
@@ -273,7 +273,7 @@ jobs:
273
273
build-args: |
274
274
G4F_VERSION=${{ needs.prepare.outputs.version }}
275
275
- name: Build and push slim images
276
uses: docker/build-push-action@v6
276
uses: docker/build-push-action@v5
277
277
with:
278
278
context: .
279
279
file: docker/Dockerfile-slim
@@ -286,7 +286,7 @@ jobs:
286
286
build-args: |
287
287
G4F_VERSION=${{ needs.prepare.outputs.version }}
288
288
- name: Build and push image
289
uses: docker/build-push-action@v6
289
uses: docker/build-push-action@v5
290
290
with:
291
291
context: .
292
292
file: docker/Dockerfile
@@ -305,9 +305,9 @@ jobs:
305
305
# matrix:
306
306
# architecture: [amd64, arm64, armhf]
307
307
# steps:
308
# - uses: actions/checkout@v6
308
# - uses: actions/checkout@v4
309
309
# - name: Set up Python
310
# uses: actions/setup-python@v6
310
# uses: actions/setup-python@v5
311
311
# with:
312
312
# python-version: "3.x"
313
313
# - name: Install build dependencies
@@ -325,7 +325,7 @@ jobs:
325
325
# chmod +x scripts/build-deb.sh
326
326
# ./scripts/build-deb.sh
327
327
# - name: Upload Debian package
328
# uses: actions/upload-artifact@v6
328
# uses: actions/upload-artifact@v4
329
329
# with:
330
330
# name: debian-${{ matrix.architecture }}
331
331
# path: g4f-*-${{ matrix.architecture }}.deb
@@ -336,9 +336,9 @@ jobs:
336
336
needs: [prepare, build-windows-exe]
337
337
if: needs.prepare.outputs.is_release == 'true'
338
338
steps:
339
- uses: actions/checkout@v6
339
- uses: actions/checkout@v4
340
340
- name: Download Windows executable zip (x64)
341
uses: actions/download-artifact@v7
341
uses: actions/download-artifact@v4
342
342
with:
343
343
name: windows-exe-x64
344
344
path: ./artifacts/x64
@@ -403,7 +403,7 @@ jobs:
403
403
ManifestVersion: 1.4.0
404
404
EOF
405
405
- name: Upload WinGet manifest
406
uses: actions/upload-artifact@v6
406
uses: actions/upload-artifact@v4
407
407
with:
408
408
name: winget-manifest
409
409
path: winget/
@@ -416,9 +416,9 @@ jobs:
416
416
permissions:
417
417
contents: write
418
418
steps:
419
- uses: actions/checkout@v6
419
- uses: actions/checkout@v4
420
420
- name: Download all artifacts
421
uses: actions/download-artifact@v7
421
uses: actions/download-artifact@v4
422
422
with:
423
423
path: ./artifacts
424
424
- name: Display artifact structure
@@ -482,7 +482,7 @@ jobs:
482
482
# id-token: write
483
483
# steps:
484
484
# - name: Download PyPI artifacts
485
# uses: actions/download-artifact@v7
485
# uses: actions/download-artifact@v4
486
486
# with:
487
487
# name: pypi-package
488
488
# path: dist/
@@ -101,7 +101,7 @@ class Gemini(AsyncGeneratorProvider, ProviderModelMixin):
101
101
_sid: str = None
102
102
103
103
auto_refresh = True
104
refresh_interval = 540
104
refresh_interval = 60 * 15 # 15 minutes
105
105
rotate_tasks = {}
106
106
107
107
@classmethod
@@ -229,7 +229,7 @@ class Api:
229
229
230
230
def register_authorization(self):
231
231
if AppConfig.g4f_api_key:
232
print(f"Register authentication key: {''.join(['*' for _ in range(len(AppConfig.g4f_api_key))])}")
232
print("Register authentication key:", ''.join(['*' for _ in range(len(AppConfig.g4f_api_key))]))
233
233
if has_crypto:
234
234
private_key, _ = create_or_read_keys()
235
235
session_key = get_session_key()