Skip to content

Commit

Permalink
Merge pull request xtekky#2419 from hlohaus/arm3
Browse files Browse the repository at this point in the history
Fix import Annotated typing
  • Loading branch information
hlohaus authored Nov 25, 2024
2 parents 73997bc + 8153668 commit f2849fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
9 changes: 6 additions & 3 deletions g4f/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
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
Expand Down Expand Up @@ -456,8 +461,6 @@ async def get_image(filename):

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)
Expand Down

0 comments on commit f2849fc

Please sign in to comment.