XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix import Annotated typing

8153668a
Heiner Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +8 -5
Modified .github/workflows/publish-workflow.yaml +2 -2
@@ -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: |
Modified g4f/api/__init__.py +6 -3
@@ -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)