返回提交历史
Modified
docker-compose.yml
+2
-1
Deleted
g4f.dev
+0
-1
Deleted
main.js
+0
-8
Deleted
test.py
+0
-55
XFEstudio/gpt4free
Git reset
a4bb6a87
代码差异
4 个文件
+2
-65
@@ -10,7 +10,8 @@ services:
10
10
volumes:
11
11
- .:/app
12
12
ports:
13
- '8090:8080'
13
- '8080:8080'
14
- '1337:8080'
14
15
- '7900:7900'
15
16
environment:
16
17
- OLLAMA_HOST=host.docker.internal
@@ -1 +0,0 @@
1
Subproject commit a4a9da6333d5fb69982230edf28fd27f8cb16933
@@ -1,8 +0,0 @@
1
import Client from '@gpt4free/g4f.dev';
2
3
const client = new Client();
4
const result = await client.chat.completions.create({
5
model: 'gpt-4.1', // Or "gpt-4o", "deepseek-v3"
6
messages: [{ role: 'user', content: 'Explain quantum computing' }]
7
});
8
process.stdout.write(result.choices[0].message.content);
@@ -1,55 +0,0 @@
1
import asyncio
2
from pathlib import Path
3
4
import g4f.debug
5
g4f.debug.logging = True
6
7
from g4f.Provider import PollinationsAI, Together, OpenaiAccount, CopilotAccount, BlackForestLabs_Flux1KontextDev
8
from g4f.client import AsyncClient
9
10
client = AsyncClient(provider=PollinationsAI)
11
12
# Example usage of the client to create image variations with different providers
13
14
## This examples needs a absolute URL to the source image:
15
16
async def main():
17
result = await client.images.create_variation(
18
image="https://g4f.dev/docs/images/strawberry.jpg",
19
prompt="Remove background",
20
model="gpt-image",
21
response_format="url",
22
transparent=True)
23
print(result)
24
25
async def main_with_together():
26
result = await client.images.create_variation(
27
image="https://g4f.dev/docs/images/strawberry.jpg",
28
model="flux-kontext-pro",
29
provider=Together,
30
prompt="Add nature background",
31
response_format="url"
32
)
33
print(result)
34
35
36
async def main_with_copilot():
37
result = await client.images.create_variation(
38
image=Path("g4f.dev/docs/images/strawberry.jpg"),
39
provider=CopilotAccount,
40
prompt="Generate a variant of this image",
41
response_format="url"
42
)
43
print(result)
44
45
46
async def main_with_copilot():
47
result = await client.images.create_variation(
48
image=Path("g4f.dev/docs/images/strawberry.jpg"),
49
provider=BlackForestLabs_Flux1KontextDev,
50
prompt="Generate a variant of this image",
51
response_format="url"
52
)
53
print(result)
54
55
asyncio.run(main_with_copilot())