返回提交历史
Modified
.github/workflows/publish-workflow.yaml
+2
-2
Modified
g4f/api/__init__.py
+6
-3
XFEstudio/gpt4free
Fix import Annotated typing
8153668a
代码差异
2 个文件
+8
-5
@@ -10,10 +10,10 @@ jobs:
10
10
runs-on: ubuntu-latest
11
11
steps:
12
12
- uses: actions/checkout@v4
13
- name: Set up Python 3.8
13
- name: Set up Python 3.13
14
14
uses: actions/setup-python@v4
15
15
with:
16
python-version: "3.8"
16
python-version: "3.13"
17
17
cache: 'pip'
18
18
- name: Install requirements
19
19
run: |
@@ -27,7 +27,12 @@ from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
27
27
from fastapi.middleware.cors import CORSMiddleware
28
28
from starlette.responses import FileResponse
29
29
from pydantic import BaseModel, Field
30
from typing import Union, Optional, List, Annotated
30
from typing import Union, Optional, List
31
try:
32
from typing import Annotated
33
except ImportError:
34
class Annotated:
35
pass
31
36
32
37
import g4f
33
38
import g4f.debug
@@ -456,8 +461,6 @@ class Api:
456
461
457
462
return FileResponse(target, media_type=content_type)
458
463
459
460
461
464
def format_exception(e: Union[Exception, str], config: Union[ChatCompletionsConfig, ImageGenerationConfig] = None, image: bool = False) -> str:
462
465
last_provider = {} if not image else g4f.get_last_provider(True)
463
466
provider = (AppConfig.image_provider if image else AppConfig.provider)