google ยท Google AI Docs
Gemini API Migrate to the Google GenAI SDK
Provides a structured process and technical guidance for transitioning existing codebases from previous Gemini API implementations to the new Google GenAI SDK.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Gemini API Migrate to the Google GenAI SDK
Provides a structured process and technical guidance for transitioning existing codebases from previous Gemini API implementations to the new Google GenAI SDK.
When To Use
Use when updating existing Gemini API integrations to utilize the Google GenAI SDK or when refactoring code to comply with new SDK standards.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/gemini-api-migrate-to-the-google-genai-sdk-workflow-guide.md | A guide detailing the migration process from the Gemini API to the new Google GenAI SDK across Python, JavaScript, and Go. | Questions about a guide detailing the migration process from the Gemini API to the new Google GenAI SDK across Python, JavaScript, an... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen.text | The shell command to install the latest version of the google-generativeai Python library using pip. | Exact payloads, commands, or snippets shown in The shell command to install the latest version of the google-generativeai Python library using pip. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-2.text | The npm installation command required to add the Google Generative AI SDK to a project. | Exact payloads, commands, or snippets shown in The npm installation command required to add the Google Generative AI SDK to a project. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-3.text | The shell command to install the Google Generative AI SDK for Go using the go get module command. | Exact payloads, commands, or snippets shown in The shell command to install the Google Generative AI SDK for Go using the go get module command. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-4.text | The shell command to install the latest version of the google-genai Python SDK using pip. | Exact payloads, commands, or snippets shown in The shell command to install the latest version of the google-genai Python SDK using pip. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-5.text | The npm installation command required to add the Google GenAI SDK to a project. | Exact payloads, commands, or snippets shown in The npm installation command required to add the Google GenAI SDK to a project. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-go-sdk-ins.text | The shell command to install the Google GenAI SDK for Go using the go get module command. | Exact payloads, commands, or snippets shown in The shell command to install the Google GenAI SDK for Go using the go get module command. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen.text | A Python code example demonstrating how to use the google-generativeai SDK to create model objects and generate content. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the google-generativeai SDK to create model objects and generate content. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-6.text | A JavaScript code example demonstrating the transition from the Gemini API to the Google GenAI SDK using the @google/generative-ai library. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating the transition from the Gemini API to the Google GenAI SDK using the @google/... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-golang-sdk.text | A Go code example demonstrating how to migrate from the Gemini API to the Google GenAI SDK using the generative-ai-go package. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to migrate from the Gemini API to the Google GenAI SDK using the generative-ai-go... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p.text | A text-based comparison showing the syntax changes for initializing the client and calling core methods when migrating to the Google GenAI SDK in Python. | Exact payloads, commands, or snippets shown in A text-based comparison showing the syntax changes for initializing the client and calling core methods when migratin... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n.text | A JavaScript code snippet demonstrating how to initialize the Google GenAI SDK and use its client object for content generation, chat, file uploads, and caching. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to initialize the Google GenAI SDK and use its client object for content... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-7.text | A Go code example demonstrating how to initialize the Google GenAI SDK client and access core services like Models, Chats, Files, and Tunings. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to initialize the Google GenAI SDK client and access core services like Models, C... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-sdk.text | A Python code snippet demonstrating the initial import and configuration of the google-generativeai library for migrating to the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating the initial import and configuration of the google-generativeai library for migra... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-8.text | A code snippet demonstrating the import statement for the GoogleGenerativeAI class from the @google/generative-ai Node.js library. | Exact payloads, commands, or snippets shown in A code snippet demonstrating the import statement for the GoogleGenerativeAI class from the @google/generative-ai Nod... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-to-google-.text | A Go code example demonstrating the migration from the Gemini API to the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating the migration from the Gemini API to the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-to-google--2.text | A Go code snippet demonstrating how to initialize a new client using the Google GenAI SDK with an API key. | Exact payloads, commands, or snippets shown in A Go code snippet demonstrating how to initialize a new client using the Google GenAI SDK with an API key. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-environmen.text | A text snippet demonstrating how to export the GEMINI_API_KEY environment variable for the migration process. | Exact payloads, commands, or snippets shown in A text snippet demonstrating how to export the GEMINIAPIKEY environment variable for the migration process. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-2.text | A Python code snippet demonstrating how to initialize the Google GenAI client using an API key. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to initialize the Google GenAI client using an API key. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-9.text | A code snippet demonstrating the import and initialization of the GoogleGenAI class using the @google/genai Node.js library. | Exact payloads, commands, or snippets shown in A code snippet demonstrating the import and initialization of the GoogleGenAI class using the @google/genai Node.js l... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-golang-sdk-2.text | A text snippet showing the Go import statement for the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A text snippet showing the Go import statement for the new Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-10.text | A Go code snippet demonstrating how to initialize a new client using the Google GenAI SDK with the Gemini API backend. | Exact payloads, commands, or snippets shown in A Go code snippet demonstrating how to initialize a new client using the Google GenAI SDK with the Gemini API backend. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-3.text | A Python code example demonstrating how to use the new Google GenAI SDK to generate content with the gemini-2.0-flash model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new Google GenAI SDK to generate content with the gemini-2.0-flash... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-11.text | A Node.js code example demonstrating how to initialize the Google Generative AI SDK and generate content using the gemini-2.0-flash model. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initialize the Google Generative AI SDK and generate content using the ge... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-12.text | A Go code example demonstrating how to initialize a client and use the GenerateContent method with the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to initialize a client and use the GenerateContent method with the new Google Gen... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-4.text | A Python code example demonstrating how to use the Google GenAI SDK to call the generateContent method with a Gemini 2.0 Flash model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google GenAI SDK to call the generateContent method with a Gemini... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-2.text | A Node.js code example demonstrating how to use the Google GenAI SDK to call the generateContent method. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to call the generateContent method. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-g.text | A Go code example demonstrating how to use the Google GenAI SDK to call the GenerateContent method with a Gemini 2.0 Flash model. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to use the Google GenAI SDK to call the GenerateContent method with a Gemini 2.0... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen-2.text | A Python code example demonstrating the transition from the legacy Gemini API to the new Google GenAI SDK using the generativeai library. | Exact payloads, commands, or snippets shown in A Python code example demonstrating the transition from the legacy Gemini API to the new Google GenAI SDK using the g... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-13.text | A Node.js code example demonstrating the migration from the legacy Gemini API to the new Google GenAI SDK using the @google/generative-ai library. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating the migration from the legacy Gemini API to the new Google GenAI SDK using the @... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-14.text | A Go code example demonstrating how to use the Google GenAI SDK to call the GenerateContent method with an image and text prompt. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to use the Google GenAI SDK to call the GenerateContent method with an image and... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-5.text | A Python code example demonstrating how to use the new Google GenAI SDK to generate content from an image using the Gemini 2.0 Flash model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new Google GenAI SDK to generate content from an image using the G... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-3.text | A Node.js code example demonstrating how to use the Google GenAI SDK to upload a file and generate content from an image. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to upload a file and generate content from an im... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-15.text | A Go code example demonstrating how to use the Google GenAI SDK to send a multimodal prompt containing both text and image data. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to use the Google GenAI SDK to send a multimodal prompt containing both text and... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen-3.text | A Python code snippet demonstrating the transition from the legacy Gemini API to the new Google GenAI SDK using the generativeai library. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating the transition from the legacy Gemini API to the new Google GenAI SDK using the g... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-4.text | A Node.js code example demonstrating how to use the Google GenAI SDK to generate streaming content from a prompt. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to generate streaming content from a prompt. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-16.text | A Go code example demonstrating how to initialize a new client and generate content using the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to initialize a new client and generate content using the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-6.text | A Python code example demonstrating how to use the Google GenAI SDK to stream content generation from a Gemini model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google GenAI SDK to stream content generation from a Gemini model. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-17.text | A Node.js code example demonstrating how to use the Google GenAI SDK to perform a streaming content generation request. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to perform a streaming content generation request. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-18.text | A Go code example demonstrating how to use the GenerateContentStream method with the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to use the GenerateContentStream method with the new Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-7.text | A Python code snippet demonstrating how to initialize a GenerativeModel and generate content using the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to initialize a GenerativeModel and generate content using the new Google Gen... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-5.text | A Node.js code example demonstrating how to use the Google Generative AI SDK to generate content with a specific model and configuration. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google Generative AI SDK to generate content with a specific mode... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-19.text | A Go code example demonstrating how to initialize a new client and configure model parameters using the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to initialize a new client and configure model parameters using the Google GenAI... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-8.text | A Python code example demonstrating how to use the new Google GenAI SDK to generate content with specific configuration parameters. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new Google GenAI SDK to generate content with specific configurati... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-6.text | A Node.js code snippet demonstrating how to initialize the Google GenAI SDK and call the generateContent method. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to initialize the Google GenAI SDK and call the generateContent method. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-g-2.text | A Go code example demonstrating how to use the new Google GenAI SDK to call the GenerateContent method. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to use the new Google GenAI SDK to call the GenerateContent method. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-20.text | A Python code snippet demonstrating the migration from the legacy Gemini API to the new Google GenAI SDK using the GenerativeModel class. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating the migration from the legacy Gemini API to the new Google GenAI SDK using the Ge... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-21.text | A Node.js code example demonstrating how to configure safety settings using the Google GenAI SDK during a Gemini API migration. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to configure safety settings using the Google GenAI SDK during a Gemini API... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-9.text | A Python code snippet demonstrating how to initialize the Google GenAI SDK client and use the generate_content method with safety settings. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to initialize the Google GenAI SDK client and use the generatecontent method... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-7.text | A Node.js code example demonstrating how to initialize the Google GenAI SDK and use the generateContent method for content generation. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initialize the Google GenAI SDK and use the generateContent method for co... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen-4.text | A Python code example demonstrating the transition from the legacy Gemini API to the new Google GenAI SDK using the generativeai library. | Exact payloads, commands, or snippets shown in A Python code example demonstrating the transition from the legacy Gemini API to the new Google GenAI SDK using the g... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-10.text | A Python code snippet demonstrating how to initialize the Google GenAI client and use the generateContent method for model interaction. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to initialize the Google GenAI client and use the generateContent method for... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-11.text | A Python code example demonstrating how to migrate chat session interactions from the legacy Gemini API to the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to migrate chat session interactions from the legacy Gemini API to the new Go... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-22.text | A Node.js code example demonstrating how to migrate chat session logic from the Gemini API to the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to migrate chat session logic from the Gemini API to the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-g-3.text | A Go code example demonstrating how to initialize a client and start a chat session using the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to initialize a client and start a chat session using the new Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-12.text | A Python code example demonstrating how to initialize the Google GenAI SDK client and create a chat session to migrate from the legacy Gemini API. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initialize the Google GenAI SDK client and create a chat session to migrat... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-8.text | A Node.js code example demonstrating how to initialize the Google GenAI SDK and create a chat session with message history. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initialize the Google GenAI SDK and create a chat session with message hi... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-23.text | A Go code example demonstrating how to initialize a client and create a chat session using the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Go code example demonstrating how to initialize a client and create a chat session using the new Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen-5.text | A Python code example demonstrating how to migrate from the Gemini API to the Google GenAI SDK using function calling with a weather tool. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to migrate from the Gemini API to the Google GenAI SDK using function calling... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-13.text | A Python code example demonstrating how to use the new Google GenAI SDK to call the generateContent method. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new Google GenAI SDK to call the generateContent method. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-14.text | A Python code example demonstrating how to implement automatic function calling using the Google GenAI SDK for Gemini models. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to implement automatic function calling using the Google GenAI SDK for Gemini... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-15.text | A Python code example demonstrating how to migrate function calling implementation from the Gemini API to the new Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to migrate function calling implementation from the Gemini API to the new Goo... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-24.text | A Python code example demonstrating how to use the Google GenAI SDK to initialize a model with code execution capabilities. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google GenAI SDK to initialize a model with code execution capabil... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-9.text | A Node.js code snippet demonstrating how to use the Google GenAI SDK to perform code execution with the gemini-2.0-flash model. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to use the Google GenAI SDK to perform code execution with the gemini-2.0-fl... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-16.text | A Python code example demonstrating how to use the new Google GenAI SDK to call the generateContent method with code execution tools. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new Google GenAI SDK to call the generateContent method with code... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-10.text | A Node.js code example demonstrating how to use the Google GenAI SDK to call the generateContent method with a model configuration. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to call the generateContent method with a model... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-25.text | A Python code snippet demonstrating how to use the Google GenAI SDK to call the generateContent method with Google Search retrieval tools. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Google GenAI SDK to call the generateContent method with Google Se... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-17.text | A Python code snippet demonstrating the migration from the Gemini API to the Google GenAI SDK using the generateContent method with Google Search tool integration. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating the migration from the Gemini API to the Google GenAI SDK using the generateConte... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen-6.text | A Python code example demonstrating the migration from the legacy Gemini API to the new Google GenAI SDK using the generativeai library. | Exact payloads, commands, or snippets shown in A Python code example demonstrating the migration from the legacy Gemini API to the new Google GenAI SDK using the ge... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-26.text | A Node.js code example demonstrating how to define a structured schema using the Google Generative AI SDK for model responses. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to define a structured schema using the Google Generative AI SDK for model r... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-18.text | A Python code example demonstrating how to use the new Google GenAI SDK to generate content with a Pydantic model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the new Google GenAI SDK to generate content with a Pydantic model. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-11.text | A Node.js code snippet demonstrating how to initialize the Google GenAI SDK and use the generateContent method with a JSON schema. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to initialize the Google GenAI SDK and use the generateContent method with a... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-19.text | A Python code snippet demonstrating how to download a text file and upload it to the Gemini API using the Google GenAI SDK for content generation. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to download a text file and upload it to the Gemini API using the Google GenA... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-u.text | A Python code example demonstrating how to download a text file and upload it using the Google GenAI SDK for content generation. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to download a text file and upload it using the Google GenAI SDK for content... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-gen-7.text | A Python code snippet demonstrating how to list and retrieve files using the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to list and retrieve files using the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-20.text | A Python code snippet demonstrating how to use the Google GenAI SDK to list and retrieve files using the genai client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Google GenAI SDK to list and retrieve files using the genai client. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-m.text | A Python code snippet demonstrating how to upload and delete files using the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to upload and delete files using the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-u-2.text | A Python code example demonstrating how to upload and delete files using the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to upload and delete files using the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-python-cac.text | A Python code snippet demonstrating how to download a text file, upload it to the Gemini API, and create a cached content object using the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to download a text file, upload it to the Gemini API, and create a cached con... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-27.text | A Node.js code example demonstrating how to use the Google GenAI SDK to upload files and create content caches. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to upload files and create content caches. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-m-2.text | A Python script demonstrating how to use the Google GenAI SDK to list models that support content caching. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the Google GenAI SDK to list models that support content caching. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-28.text | A Node.js code example demonstrating how to upload a file and use the Google GenAI SDK to process it with the Gemini 2.0 Flash model. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to upload a file and use the Google GenAI SDK to process it with the Gemini... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-29.text | A Python code snippet demonstrating how to use the countTokens method with the Google GenAI SDK to migrate from the Gemini API. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the countTokens method with the Google GenAI SDK to migrate from the G... |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-c.text | A Node.js code example demonstrating how to use the Google GenAI SDK to count tokens in a prompt. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to count tokens in a prompt. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-c-2.text | A Python code example demonstrating how to use the Google GenAI SDK to count tokens for a given string. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google GenAI SDK to count tokens for a given string. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-c-3.text | A Node.js code example demonstrating how to use the Google GenAI SDK to count tokens for a given prompt. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to count tokens for a given prompt. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-python-imagen-imag.text | A Python code snippet demonstrating how to use the Google GenAI SDK to generate images using the Imagen model. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Google GenAI SDK to generate images using the Imagen model. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-21.text | A Python code example demonstrating how to use the Google GenAI SDK to generate images using the Gemini 2.5 Flash model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google GenAI SDK to generate images using the Gemini 2.5 Flash model. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-python-embedconten.text | A Python code snippet demonstrating the migration of the embedContent operation to the Google GenAI SDK. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating the migration of the embedContent operation to the Google GenAI SDK. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-n-12.text | A Node.js code snippet demonstrating how to initialize the Google Generative AI SDK and perform an embedding operation. | Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to initialize the Google Generative AI SDK and perform an embedding operation. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-google-genai-sdk-p-22.text | A Python code example demonstrating how to use the Google GenAI SDK to call the embedContent method. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Google GenAI SDK to call the embedContent method. |
examples/gemini-api-migrate-to-the-google-genai-sdk-gemini-api-migrate-google-gen-30.text | A Node.js code example demonstrating how to use the Google GenAI SDK to perform content embedding operations. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the Google GenAI SDK to perform content embedding operations. |
What This Skill Covers
- Starting with the Gemini 2.0 release in late 2024, we introduced a new set of libraries called the Google GenAI SDK. It offers an improved developer experien...
- Main sections:
Installation,Python,JavaScript,Go,Python.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://ai.google.dev/gemini-api/docs/migrate
