Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion genai/controlled_generation/ctrlgen_with_class_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Recipe(BaseModel):

client = genai.Client(http_options=HttpOptions(api_version="v1"))
response = client.models.generate_content(
model="gemini-3.5-flash",
model="gemini-3.8-flash",
contents="List a few popular cookie recipes.",
config=GenerateContentConfig(
response_mime_type="application/json",
Expand Down
2 changes: 1 addition & 1 deletion genai/count_tokens/counttoken_with_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def count_tokens() -> int:

client = genai.Client(http_options=HttpOptions(api_version="v1"))
response = client.models.count_tokens(
model="gemini-3.5-flash",
model="gemini-3.8-flash",
contents="What's the highest mountain in Africa?",
)
print(response)
Expand Down
2 changes: 1 addition & 1 deletion genai/text_generation/textgen_chat_with_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def generate_content() -> str:

client = genai.Client(http_options=HttpOptions(api_version="v1"))
chat_session = client.chats.create(
model="gemini-3.5-flash",
model="gemini-3.8-flash",
history=[
UserContent(parts=[Part(text="Hello")]),
ModelContent(
Expand Down
2 changes: 1 addition & 1 deletion genai/text_generation/textgen_with_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def generate_content() -> str:

client = genai.Client(http_options=HttpOptions(api_version="v1"))
response = client.models.generate_content(
model="gemini-3.5-flash",
model="gemini-3.8-flash",
contents="How does AI work?",
)
print(response.text)
Expand Down
2 changes: 1 addition & 1 deletion genai/tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google-genai==1.45.0
google-genai==2.29.0
# PIl is required for tools_code_execution_with_txt_img.py
pillow==12.3.0; python_version >= "3.10"
3 changes: 1 addition & 2 deletions genai/tools/test_tools_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import tools_vais_with_txt

os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True"
os.environ["GOOGLE_CLOUD_LOCATION"] = "us-central1"
os.environ["GOOGLE_CLOUD_LOCATION"] = "global"
# The project name is included in the CICD pipeline
# os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name"

Expand Down Expand Up @@ -144,4 +144,3 @@ def test_tools_interactions_urlcontext_with_txt() -> None:

def test_tools_interactions_google_search_and_urlcontext_with_txt() -> None:
assert tools_interactions_google_search_and_urlcontext_with_txt.create_interaction()

3 changes: 1 addition & 2 deletions genai/tools/tools_func_def_with_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ def get_current_weather(location: str) -> str:
return weather_map.get(location, "unknown")

client = genai.Client(http_options=HttpOptions(api_version="v1"))
model_id = "gemini-3.5-flash"
model_id = "gemini-3.8-flash"

response = client.models.generate_content(
model=model_id,
contents="What is the weather like in Boston?",
config=GenerateContentConfig(
tools=[get_current_weather],
temperature=0,
),
)

Expand Down
Loading