diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-11-25 01:28:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 01:28:10 +0100 |
commit | f2849fce1b1918c4cce1fd8209ffef41bd55d626 (patch) | |
tree | c3f234de80f370228f1f44d8ea8bab8758a97491 | |
parent | Merge pull request #2418 from hlohaus/arm3 (diff) | |
parent | Fix import Annotated typing (diff) | |
download | gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.tar gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.tar.gz gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.tar.bz2 gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.tar.lz gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.tar.xz gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.tar.zst gpt4free-f2849fce1b1918c4cce1fd8209ffef41bd55d626.zip |
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/publish-workflow.yaml | 4 | ||||
-rw-r--r-- | g4f/api/__init__.py | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/.github/workflows/publish-workflow.yaml b/.github/workflows/publish-workflow.yaml index 9ad68bd8..82d21cb7 100644 --- a/.github/workflows/publish-workflow.yaml +++ b/.github/workflows/publish-workflow.yaml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.13 uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.13" cache: 'pip' - name: Install requirements run: | diff --git a/g4f/api/__init__.py b/g4f/api/__init__.py index 2f34fa6a..fc8a4339 100644 --- a/g4f/api/__init__.py +++ b/g4f/api/__init__.py @@ -27,7 +27,12 @@ from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials from fastapi.middleware.cors import CORSMiddleware from starlette.responses import FileResponse from pydantic import BaseModel, Field -from typing import Union, Optional, List, Annotated +from typing import Union, Optional, List +try: + from typing import Annotated +except ImportError: + class Annotated: + pass import g4f import g4f.debug @@ -456,8 +461,6 @@ class Api: return FileResponse(target, media_type=content_type) - - def format_exception(e: Union[Exception, str], config: Union[ChatCompletionsConfig, ImageGenerationConfig] = None, image: bool = False) -> str: last_provider = {} if not image else g4f.get_last_provider(True) provider = (AppConfig.image_provider if image else AppConfig.provider) |