Skip to content

Commit

Permalink
Merge pull request #2657 from xtekky/New
Browse files Browse the repository at this point in the history
Fix publish to pypi
  • Loading branch information
hlohaus authored Feb 1, 2025
2 parents 4231fb0 + 6b8e6ad commit 0fc73eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -44,7 +44,7 @@ jobs:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
8 changes: 6 additions & 2 deletions g4f/providers/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def format_images_markdown(images: Union[str, list], alt: str, preview: Union[st
class ResponseType:
@abstractmethod
def __str__(self) -> str:
pass
raise NotImplementedError

class JsonMixin:
def __init__(self, **kwargs) -> None:
Expand Down Expand Up @@ -143,7 +143,11 @@ def __init__(
def __str__(self) -> str:
if self.is_thinking is not None:
return self.is_thinking
return f"{self.status}\n" if self.token is None else self.token
if self.token is not None:
return self.token
if self.status is not None:
return f"{self.status}\n"
return ""

class Sources(ResponseType):
def __init__(self, sources: list[dict[str, str]]) -> None:
Expand Down

0 comments on commit 0fc73eb

Please sign in to comment.