返回提交历史
Modified
.github/workflows/publish-to-pypi.yml
+2
-2
Modified
g4f/providers/response.py
+6
-2
XFEstudio/gpt4free
Fix publish to pypi
6b8e6adc
代码差异
2 个文件
+8
-4
@@ -25,7 +25,7 @@ jobs:
25
25
- name: Build a binary wheel and a source tarball
26
26
run: python3 -m build
27
27
- name: Store the distribution packages
28
uses: actions/upload-artifact@v3
28
uses: actions/upload-artifact@v4
29
29
with:
30
30
name: python-package-distributions
31
31
path: dist/
@@ -44,7 +44,7 @@ jobs:
44
44
id-token: write
45
45
steps:
46
46
- name: Download all the dists
47
uses: actions/download-artifact@v3
47
uses: actions/download-artifact@v4
48
48
with:
49
49
name: python-package-distributions
50
50
path: dist/
@@ -71,7 +71,7 @@ def format_images_markdown(images: Union[str, list], alt: str, preview: Union[st
71
71
class ResponseType:
72
72
@abstractmethod
73
73
def __str__(self) -> str:
74
pass
74
raise NotImplementedError
75
75
76
76
class JsonMixin:
77
77
def __init__(self, **kwargs) -> None:
@@ -143,7 +143,11 @@ class Reasoning(ResponseType):
143
143
def __str__(self) -> str:
144
144
if self.is_thinking is not None:
145
145
return self.is_thinking
146
return f"{self.status}\n" if self.token is None else self.token
146
if self.token is not None:
147
return self.token
148
if self.status is not None:
149
return f"{self.status}\n"
150
return ""
147
151
148
152
class Sources(ResponseType):
149
153
def __init__(self, sources: list[dict[str, str]]) -> None: