# Google AI Studio - Issue with Exported Python Code – Missing Input/Output Examples

**URL:** <https://discuss.ai.google.dev/t/google-ai-studio-issue-with-exported-python-code-missing-input-output-examples/74196>\
**Category:** Gemini API\
**Tags:** python, gemini-flash\
**Created:** [March 22, 2025, 10:08pm UTC](https://discuss.ai.google.dev/t/google-ai-studio-issue-with-exported-python-code-missing-input-output-examples/74196 "2025-03-22T22:08:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronald\_Chen](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ronald_chen/32/35157_2.png) [@Ronald\_Chen](https://discuss.ai.google.dev/u/Ronald_Chen)\
**Post date:** [March 22, 2025, 10:08pm UTC](https://discuss.ai.google.dev/t/google-ai-studio-issue-with-exported-python-code-missing-input-output-examples/74196/1 "2025-03-22T22:08:37Z")

</div>

Hi everyone,

I’ve fine-tuned an AI model using 10 example input/output pairs and also configured a structured output. However, when I click “Get Code” in the Python interface, I only see the structured output section—the example inputs and outputs I added are missing. Interestingly, when I switch to other languages like JavaScript or cURL, all my defined examples are visible in the exported code.

Has anyone else experienced this discrepancy? Is this behavior intended for the Python version, or is there a workaround to include the example inputs/outputs in the Python code export? FYI I am using Gemini 2.0-flash-lite

Thanks in advance for any insights or suggestions!

The code provided by ‘Get Code’:

import base64  
import os  
from google import genai  
from google.genai import types

def generate():  
client = genai.Client(  
api\_key=os.environ.get(“GEMINI\_API\_KEY”),  
)

```
model = "gemini-2.0-flash-lite"
contents = [
    types.Content(
        role="user",
        parts=[
            types.Part.from_text(text="""INSERT_INPUT_HERE"""),
        ],
    ),
]
generate_content_config = types.GenerateContentConfig(
    temperature=1,
    top_p=0.95,
    top_k=40,
    max_output_tokens=8192,
    response_mime_type="application/json",
    response_schema=genai.types.Schema(
        type = genai.types.Type.OBJECT,
        required = ["title", "body"],
        properties = {
            "title": genai.types.Schema(
                type = genai.types.Type.STRING,
                description = "The main title of the content",
            ),
            "body": genai.types.Schema(
                type = genai.types.Type.ARRAY,
                description = "An array of content sections",
                items = genai.types.Schema(
                    type = genai.types.Type.OBJECT,
                    required = ["subtitle", "body_content", "metadata"],
                    properties = {
                        "subtitle": genai.types.Schema(
                            type = genai.types.Type.STRING,
                            description = "Section subtitle",
                        ),
                        "body_content": genai.types.Schema(
                            type = genai.types.Type.OBJECT,
                            description = "The main content of this section - can be a string, array, or object",
                            properties = {
                            },
                        ),
                        "metadata": genai.types.Schema(
                            type = genai.types.Type.OBJECT,
                            required = ["content_type", "display_hint", "priority"],
                            properties = {
                                "content_type": genai.types.Schema(
                                    type = genai.types.Type.STRING,
                                    description = "Type of content in this section",
                                    enum = ["summary", "key_points", "introduction", "explanation", "strategy", "insight", "advice", "quotes", "characters"],
                                ),
                                "display_hint": genai.types.Schema(
                                    type = genai.types.Type.STRING,
                                    description = "Visual display suggestion for this content",
                                    enum = ["highlight", "bullet_list", "paragraph", "blockquote", "tag_cloud", "banner", "warning_banner"],
                                ),
                                "priority": genai.types.Schema(
                                    type = genai.types.Type.INTEGER,
                                    description = "Numerical priority/order for this section",
                                ),
                            },
                        ),
                    },
                ),
            ),
        },
    ),
)

for chunk in client.models.generate_content_stream(
    model=model,
    contents=contents,
    config=generate_content_config,
):
    print(chunk.text, end="")

```

if **name** == “ **main** ”:  
generate()

---

<div class="post-metadata">

**Author:** ![GUNAND\_MAYANGLAMBAM](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/gunand_mayanglambam/32/4964_2.png) [@GUNAND\_MAYANGLAMBAM](https://discuss.ai.google.dev/u/GUNAND_MAYANGLAMBAM)\
**Post date:** [March 24, 2025, 3:59am UTC](https://discuss.ai.google.dev/t/google-ai-studio-issue-with-exported-python-code-missing-input-output-examples/74196/2 "2025-03-24T03:59:25Z")

</div>

Hey @Ronald_Chen , Welcome to the forum.

Seems like it’s a genuine bug. Thanks for pointing out the issue.  
I will escalate it to the product engineering team.

---

<div class="post-metadata">

**Author:** ![Ronald\_Chen](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ronald_chen/32/35157_2.png) [@Ronald\_Chen](https://discuss.ai.google.dev/u/Ronald_Chen)\
**Post date:** [April 1, 2025, 2:31am UTC](https://discuss.ai.google.dev/t/google-ai-studio-issue-with-exported-python-code-missing-input-output-examples/74196/4 "2025-04-01T02:31:11Z")

</div>

Thanks! For now, I can work around this manually. Would you happen to know the format I should enter in my examples in, or be able to point me to the correct resources?

---

<div class="post-metadata">

**Author:** ![GUNAND\_MAYANGLAMBAM](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/gunand_mayanglambam/32/4964_2.png) [@GUNAND\_MAYANGLAMBAM](https://discuss.ai.google.dev/u/GUNAND_MAYANGLAMBAM)\
**Post date:** [April 1, 2025, 2:32pm UTC](https://discuss.ai.google.dev/t/google-ai-studio-issue-with-exported-python-code-missing-input-output-examples/74196/6 "2025-04-01T14:32:56Z")

</div>

Hey, I tried using simple input/output pairs. I’m not sure if it will be helpful to you.

```auto
import base64
import os
from google import genai
from google.genai import types

def generate():
    client = genai.Client(
        api_key="GEMINI_API_KEY",
    )

    model = "gemini-2.0-flash-lite"
    contents = [
        types.Content(
            role="user",
            parts=[
                types.Part.from_text(text="input: 1"),
                types.Part.from_text(text="output: 1"),
                types.Part.from_text(text="input: 2"),
                types.Part.from_text(text="output: 2"),
                types.Part.from_text(text="input: 3"),
                types.Part.from_text(text="output: 3"),
                types.Part.from_text(text="input: 9"),
            ],
        ),
    ]
    generate_content_config = types.GenerateContentConfig(
        response_mime_type="application/json",
        response_schema=genai.types.Schema(
            type = genai.types.Type.OBJECT,
            properties = {
                "output": genai.types.Schema(
                    type = genai.types.Type.STRING,
                ),
            },
        ),
    )

    for chunk in client.models.generate_content_stream(
        model=model,
        contents=contents,
        config=generate_content_config,
    ):
        print(chunk.text, end="")

    
if __name__ == " __main__":
    generate()
```
