summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--docs/client.md3
2 files changed, 8 insertions, 7 deletions
diff --git a/README.md b/README.md
index 84cfdabf..1b7aa87e 100644
--- a/README.md
+++ b/README.md
@@ -170,8 +170,8 @@ from g4f.client import Client
client = Client()
response = client.chat.completions.create(
model="gpt-3.5-turbo",
- messages=[{"role": "user", "content": "Hello"}],
- ...
+ messages=[{"role": "user", "content": "Say this is a test"}],
+ # Add any other necessary parameters
)
print(response.choices[0].message.content)
```
@@ -187,11 +187,13 @@ from g4f.client import Client
client = Client()
response = client.images.generate(
- model="gemini",
- prompt="a white siamese cat",
- ...
+ model="dall-e-3",
+ prompt="a white siamese cat",
+ # Add any other necessary parameters
)
+
image_url = response.data[0].url
+print(f"Generated image URL: {image_url}")
```
[![Image with cat](/docs/cat.jpeg)](https://github.com/xtekky/gpt4free/blob/main/docs/client.md)
diff --git a/docs/client.md b/docs/client.md
index 5e6b79ba..e95c510d 100644
--- a/docs/client.md
+++ b/docs/client.md
@@ -61,8 +61,8 @@ You can use the `ChatCompletions` endpoint to generate text completions as follo
```python
from g4f.client import Client
-client = Client()
+client = Client()
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Say this is a test"}],
@@ -77,7 +77,6 @@ Also streaming are supported:
from g4f.client import Client
client = Client()
-
stream = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Say this is a test"}],