Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Below is an example `generate_content()` call using types from the types module:

```python
response = client.models.generate_content(
model='gemini-2.0-flash-001',
model='gemini-2.5-flash',
contents=types.Part.from_text(text='Why is the sky blue?'),
config=types.GenerateContentConfig(
temperature=0,
Expand All @@ -89,7 +89,7 @@ types:

```python
response = client.models.generate_content(
model='gemini-2.0-flash-001',
model='gemini-2.5-flash',
contents={'text': 'Why is the sky blue?'},
config={
'temperature': 0,
Expand Down Expand Up @@ -583,7 +583,7 @@ and [Gemini API docs](https://ai.google.dev/gemini-api/docs/models) respectively
from google.genai import types

response = client.models.generate_content(
model='gemini-2.0-flash-001',
model='gemini-2.5-flash',
contents='high',
config=types.GenerateContentConfig(
system_instruction='I say high, you say low',
Expand Down Expand Up @@ -1200,7 +1200,6 @@ print(response)
```python
from google.genai import types

# multiple contents with config
response = client.models.embed_content(
model='gemini-embedding-001',
contents=['why is the sky blue?', 'What is your age?'],
Expand All @@ -1214,12 +1213,9 @@ print(response)

#### Generate Images

Support for generate images in Gemini Developer API is behind an allowlist

```python
from google.genai import types

# Generate Image
response1 = client.models.generate_images(
model='imagen-4.0-generate-001',
prompt='An umbrella in the foreground, and a rainy night sky in the background',
Expand All @@ -1239,7 +1235,6 @@ Upscale image is only supported in Vertex AI.
```python
from google.genai import types

# Upscale the generated image from above
response2 = client.models.upscale_image(
model='imagen-4.0-upscale-preview',
image=response1.generated_images[0].image,
Expand Down Expand Up @@ -1939,7 +1934,7 @@ file = client.files.upload(

# Create a batch job with file name
batch_job = client.batches.create(
model="gemini-2.0-flash",
model="gemini-2.5-flash",
src="files/test-json",
)
```
Expand Down