There is an issue with getcode, a feature that used to be supported in the Gemini AI Studio web interface. Previously, it provided complete code including the conversation history, but now it only provides a basic template and the conversation content has disappeared. We need a getcode feature that includes both the user’s questions and the AI’s answers so we can quickly integrate what we built in AI Studio into our APIs.
At the moment, when using the share feature, it only adds various files and an AI Studio shortcut to Google Drive. These are not interpretable by the model and are not suitable for coding.
Below is the current output of getcode.
# To run this code you need to install the following dependencies:
# pip install google-genai
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.5-pro"
contents = [
types.Content(
role="user",
parts=[
types.Part.from_text(text="""INSERT_INPUT_HERE"""),
],
),
]
generate_content_config = types.GenerateContentConfig(
temperature=1.3,
thinking_config = types.ThinkingConfig(
thinking_budget=-1,
),
)
for chunk in client.models.generate_content_stream(
model=model,
contents=contents,
config=generate_content_config,
):
print(chunk.text, end="")
if __name__ == "__main__":
generate()