返回提交历史
Modified
README.md
+23
-23
Modified
docker/Dockerfile-slim
+10
-7
Modified
g4f/Provider/PollinationsAI.py
+1
-1
Modified
g4f/constants.py
+1
-1
XFEstudio/gpt4free
Update static url
a570ace2
代码差异
4 个文件
+35
-32
@@ -45,15 +45,15 @@ docker pull hlohaus789/g4f
45
45
Reach out for help in our [Support Group: discord.gg/qXA4Wf4Fsm](https://discord.gg/qXA4Wf4Fsm).
46
46
47
47
- **Read our Documentation** 📖
48
Find detailed guidance and resources at [gpt4free.github.io/docs](https://github.com/gpt4free/gpt4free.github.io).
48
Find detailed guidance and resources at [g4f.dev/docs](https://github.com/gpt4free/g4f.dev).
49
49
50
50
## 🔻 Site Takedown
51
51
52
52
Is your site on this repository and you want to take it down? Send an email to takedown@g4f.ai with proof it is yours and it will be removed as fast as possible. To prevent reproduction please secure your API. 😉
53
53
54
## 🚀 G4F on GitHub Pages [](https://gpt4free.github.io/)
54
## 🚀 G4F on GitHub Pages [](https://g4f.dev/)
55
55
56
> Explore the [G4F on GitHub Pages](https://gpt4free.github.io/).
56
> Explore the [G4F on GitHub Pages](https://g4f.dev/).
57
57
58
58
---
59
59
@@ -69,12 +69,12 @@ Is your site on this repository and you want to take it down? Send an email to t
69
69
- [📝 Text Generation](#-text-generation)
70
70
- [🎨 Image Generation](#-image-generation)
71
71
- [🌐 Web Interface](#-web-interface)
72
- [🖥️ Local Inference](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/local.md)
72
- [🖥️ Local Inference](https://github.com/gpt4free/g4f.dev/blob/main/docs/local.md)
73
73
- [🤖 Interference API](#-interference-api)
74
- [🛠️ Configuration](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/configuration.md)
74
- [🛠️ Configuration](https://github.com/gpt4free/g4f.dev/blob/main/docs/configuration.md)
75
75
- [📱 Run on Smartphone](#-run-on-smartphone)
76
76
- [📘 Full Documentation for Python API](#-full-documentation-for-python-api)
77
- [🚀 Providers and Models](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs%2Fproviders-and-models.md)
77
- [🚀 Providers and Models](https://github.com/gpt4free/g4f.dev/blob/main/docs%2Fproviders-and-models.md)
78
78
- [🔗 Powered by gpt4free](#-powered-by-gpt4free)
79
79
- [🤝 Contribute](#-contribute)
80
80
- [How do i create a new Provider?](#guide-how-do-i-create-a-new-provider)
@@ -151,7 +151,7 @@ By following these steps, you should be able to successfully install and run the
151
151
pip install -U g4f[all]
152
152
```
153
153
154
> How do I install only parts or do disable parts? **Use partial requirements:** [/docs/requirements](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/requirements.md)
154
> How do I install only parts or do disable parts? **Use partial requirements:** [/docs/requirements](https://github.com/gpt4free/g4f.dev/blob/main/docs/requirements.md)
155
155
156
156
#### Install from Source:
157
157
```bash
@@ -160,7 +160,7 @@ cd gpt4free
160
160
pip install -r requirements.txt
161
161
```
162
162
163
> How do I load the project using git and installing the project requirements? **Read this tutorial and follow it step by step:** [/docs/git](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/git.md)
163
> How do I load the project using git and installing the project requirements? **Read this tutorial and follow it step by step:** [/docs/git](https://github.com/gpt4free/g4f.dev/blob/main/docs/git.md)
164
164
165
165
---
166
166
@@ -195,7 +195,7 @@ response = client.images.generate(
195
195
196
196
print(f"Generated image URL: {response.data[0].url}")
197
197
```
198
[](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/client.md)
198
[](https://github.com/gpt4free/g4f.dev/blob/main/docs/client.md)
199
199
200
200
### 🌐 Web Interface
201
201
**Run the GUI using Python:**
@@ -213,7 +213,7 @@ python -m g4f.cli gui --port 8080 --debug
213
213
python -m g4f --port 8080 --debug
214
214
```
215
215
216
> **Learn More About the GUI:** For detailed instructions on how to set up, configure, and use the GPT4Free GUI, refer to the [GUI Documentation](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/gui.md) . This guide includes step-by-step details on provider selection, managing conversations, using advanced features like speech recognition, and more.
216
> **Learn More About the GUI:** For detailed instructions on how to set up, configure, and use the GPT4Free GUI, refer to the [GUI Documentation](https://github.com/gpt4free/g4f.dev/blob/main/docs/gui.md) . This guide includes step-by-step details on provider selection, managing conversations, using advanced features like speech recognition, and more.
217
217
218
218
---
219
219
@@ -221,28 +221,28 @@ python -m g4f --port 8080 --debug
221
221
222
222
The **Interference API** enables seamless integration with OpenAI's services through G4F, allowing you to deploy efficient AI solutions.
223
223
224
- **Documentation**: [Interference API Docs](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/interference-api.md)
224
- **Documentation**: [Interference API Docs](https://github.com/gpt4free/g4f.dev/blob/main/docs/interference-api.md)
225
225
- **Endpoint**: `http://localhost:1337/v1`
226
226
- **Swagger UI**: Explore the OpenAPI documentation via Swagger UI at `http://localhost:1337/docs`
227
- **Provider Selection**: [How to Specify a Provider?](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/selecting_a_provider.md)
227
- **Provider Selection**: [How to Specify a Provider?](https://github.com/gpt4free/g4f.dev/blob/main/docs/selecting_a_provider.md)
228
228
229
229
This API is designed for straightforward implementation and enhanced compatibility with other OpenAI integrations.
230
230
231
231
---
232
232
233
233
### 📱 Run on Smartphone
234
Run the Web UI on your smartphone for easy access on the go. Check out the dedicated guide to learn how to set up and use the GUI on your mobile device: [Run on Smartphone Guide](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/guides/phone.md)
234
Run the Web UI on your smartphone for easy access on the go. Check out the dedicated guide to learn how to set up and use the GUI on your mobile device: [Run on Smartphone Guide](https://github.com/gpt4free/g4f.dev/blob/main/docs/guides/phone.md)
235
235
236
236
---
237
237
238
238
#### **📘 Full Documentation for Python API**
239
- **Client API from G4F:** [/docs/client](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/client.md)
240
- **AsyncClient API from G4F:** [/docs/async_client](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/async_client.md)
241
- **Requests API from G4F:** [/docs/requests](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/requests.md)
242
- **File API from G4F:** [/docs/file](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/file.md)
243
- **PydanticAI and LangChain Integration for G4F:** [/docs/pydantic_ai](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/pydantic_ai.md)
244
- **Legacy API with python modules:** [/docs/legacy](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/legacy.md)
245
- **G4F - Media Documentation (Image, Audio and Video)** [/docs/media](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/media.md) *(New)*
239
- **Client API from G4F:** [/docs/client](https://github.com/gpt4free/g4f.dev/blob/main/docs/client.md)
240
- **AsyncClient API from G4F:** [/docs/async_client](https://github.com/gpt4free/g4f.dev/blob/main/docs/async_client.md)
241
- **Requests API from G4F:** [/docs/requests](https://github.com/gpt4free/g4f.dev/blob/main/docs/requests.md)
242
- **File API from G4F:** [/docs/file](https://github.com/gpt4free/g4f.dev/blob/main/docs/file.md)
243
- **PydanticAI and LangChain Integration for G4F:** [/docs/pydantic_ai](https://github.com/gpt4free/g4f.dev/blob/main/docs/pydantic_ai.md)
244
- **Legacy API with python modules:** [/docs/legacy](https://github.com/gpt4free/g4f.dev/blob/main/docs/legacy.md)
245
- **G4F - Media Documentation (Image, Audio and Video)** [/docs/media](https://github.com/gpt4free/g4f.dev/blob/main/docs/media.md) *(New)*
246
246
247
247
---
248
248
@@ -268,16 +268,16 @@ MoneyPrinter V2 cranks up the automation for making money online. It’s a compl
268
268
269
269
> [FujiwaraChoki/MoneyPrinterV2 on GitHub](https://github.com/FujiwaraChoki/MoneyPrinterV2)
270
270
271
> [Full list of GPT4Free powered sites and tools](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/powered-by.md)
271
> [Full list of GPT4Free powered sites and tools](https://github.com/gpt4free/g4f.dev/blob/main/docs/powered-by.md)
272
272
273
273
## 🤝 Contribute
274
274
We welcome contributions from the community. Whether you're adding new providers or features, or simply fixing typos and making small improvements, your input is valued. Creating a pull request is all it takes – our co-pilot will handle the code review process. Once all changes have been addressed, we'll merge the pull request into the main branch and release the updates at a later time.
275
275
276
276
###### Guide: How do i create a new Provider?
277
- **Read:** [Create Provider Guide](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/guides/create_provider.md)
277
- **Read:** [Create Provider Guide](https://github.com/gpt4free/g4f.dev/blob/main/docs/guides/create_provider.md)
278
278
279
279
###### Guide: How can AI help me with writing code?
280
- **Read:** [AI Assistance Guide](https://github.com/gpt4free/gpt4free.github.io/blob/main/docs/guides/help_me.md)
280
- **Read:** [AI Assistance Guide](https://github.com/gpt4free/g4f.dev/blob/main/docs/guides/help_me.md)
281
281
282
282
283
283
@@ -21,8 +21,9 @@ RUN apt-get update && apt-get upgrade -y \
21
21
&& apt-get clean \
22
22
&& rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
23
23
24
RUN mkdir -p $G4F_DIR
25
RUN chown "${G4F_USER_ID}:${G4F_USER_ID}" $G4F_DIR
24
RUN mkdir -p $G4F_DIR && touch /var/log/cron.log
25
RUN chown "${G4F_USER_ID}:${G4F_USER_ID}" $G4F_DIR /var/log/cron.log \
26
&& chmod gu+rw /var/run && chmod gu+s /usr/sbin/cron
26
27
27
28
USER $G4F_USER_ID
28
29
WORKDIR $G4F_DIR
@@ -30,9 +31,11 @@ WORKDIR $G4F_DIR
30
31
ENV HOME /home/$G4F_USER
31
32
ENV PATH "${HOME}/.local/bin:${PATH}"
32
33
33
RUN git clone https://github.com/xtekky/gpt4free.git $G4F_DIR
34
RUN printf "0 * * * * python -m etc.tool.update\n" > cronfile
35
RUN crontab cronfile
36
RUN pip install --no-cache-dir -r requirements-slim.txt
34
RUN git clone https://github.com/xtekky/gpt4free.git $G4F_DIR \
35
&& printf "*/15 * * * * python -m etc.tool.update\n" > cronfile && crontab cronfile \
36
&& pip install --no-cache-dir -r requirements-slim.txt
37
RUN git clone https://github.com/hlohaus/deepseek4free.git \
38
&& cd deepseek4free && git checkout 21Feb \
39
&& pip install --no-cache-dir . && cd .. && rm -rf deepseek4free
37
40
38
CMD python -m g4f --port 8080 --debug --reload
41
CMD cron && tail -f /var/log/cron.log & python -m g4f --port 8080 --debug --reload
@@ -374,7 +374,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
374
374
if model == "gptimage":
375
375
n = 1
376
376
# Only remote images are supported
377
image = [item[0] for item in media if isinstance(item[0], str) and item[0].startswith("http")]
377
image = [item[0] for item in media if isinstance(item[0], str) and item[0].startswith("http")] if media else []
378
378
params = {
379
379
**params,
380
380
"image": ",".join(image) if image else "",
@@ -1,6 +1,6 @@
1
1
PACKAGE_NAME = "g4f"
2
2
ORGANIZATION = "gpt4free"
3
3
GITHUB_REPOSITORY = f"xtekky/{ORGANIZATION}"
4
STATIC_DOMAIN = f"{ORGANIZATION}.github.io"
4
STATIC_DOMAIN = f"g4f.dev"
5
5
STATIC_URL = f"https://{STATIC_DOMAIN}/"
6
6
DIST_DIR = f"./{STATIC_DOMAIN}/dist"