From 1203c407e5884dcf29aca58e9035a159da7108a5 Mon Sep 17 00:00:00 2001 From: Suresh Shanujan <207912128+shanujans@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:34:07 +0000 Subject: [PATCH 1/2] docs: add CJK language limitation warning for Gemini 2.5 models --- codegen_instructions.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/codegen_instructions.md b/codegen_instructions.md index 2a6079d09..8b9f39576 100644 --- a/codegen_instructions.md +++ b/codegen_instructions.md @@ -85,6 +85,16 @@ client = genai.Client() - **Gemini 2.0 Series**: `gemini-2.0-flash`, `gemini-2.0-flash-lite` - **Gemini 2.5 Series**: `gemini-2.5-flash`, `gemini-2.5-pro` +> **⚠️ Known limitation — Gemini 2.5 series (CJK languages):** All Gemini 2.5 +> models (`gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-2.5-flash-lite`) +> currently fail to correctly process CJK (Japanese, Chinese, Korean) text +> input via the REST API. The model may interpret valid UTF-8 CJK characters as +> garbled/corrupted text. Google Search Grounding is also affected — +> `webSearchQueries` returns empty `[]` for CJK input on these models. +> **If your application requires CJK language input, use `gemini-3-pro-preview` +> or another Gemini 3.x model as a workaround until this is resolved.** +> See [issue #2134](https://github.com/googleapis/python-genai/issues/2134). + - Do not use the following deprecated models (or their variants like `gemini-1.5-flash-latest`): - **Prohibited:** `gemini-1.5-flash` @@ -410,7 +420,6 @@ response = client.models.generate_content( contents='What is the weather in Boston?', config=types.GenerateContentConfig( tools=[get_current_weather] # Make the function available to the model as a tool - ), ) @@ -457,6 +466,14 @@ print(f"Search Pages: {', '.join([site.web.title for site in response.candidates The output `response.text` will likely not be in JSON format, do not attempt to parse it as JSON. +> **⚠️ Known limitation — CJK languages with Gemini 2.5:** Search Grounding +> does not work correctly with CJK (Japanese, Chinese, Korean) input on any +> Gemini 2.5 model. `webSearchQueries` returns an empty list `[]` and the model +> treats the input as garbled text. English input on the same models works +> correctly. **Use a Gemini 3.x model (e.g. `gemini-3-pro-preview`) for Search +> Grounding with CJK queries.** +> See [issue #2134](https://github.com/googleapis/python-genai/issues/2134). + ## Media Generation ### Generate Images @@ -647,4 +664,4 @@ ai.google.dev/gemini-api/docs. - API Keys and Authentication: ai.google.dev/gemini-api/docs/api-key - Models: ai.google.dev/models - API Pricing: ai.google.dev/pricing -- Rate Limits: ai.google.dev/rate-limits +- Rate Limits: ai.google.dev/rate-limits \ No newline at end of file From 1029f4e4901abd065b8e593c7764ce0ba77fb8b1 Mon Sep 17 00:00:00 2001 From: Suresh Shanujan <207912128+shanujans@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:36:58 +0000 Subject: [PATCH 2/2] docs: add CJK language limitation warning for Gemini 2.5 models --- codegen_instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen_instructions.md b/codegen_instructions.md index 8b9f39576..f83ebd349 100644 --- a/codegen_instructions.md +++ b/codegen_instructions.md @@ -652,7 +652,7 @@ response = client.models.generate_content( print(response.text) ``` -## Other APIs +## Other APIs The list of APIs and capabilities above are not comprehensive. If users ask you to generate code for a capability not provided above, refer them to