[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Google Gen AI libraries\n\nThis page provides information on downloading and installing the latest\nlibraries for the Gemini API. If you're new to the Gemini\nAPI, get started with the [API quickstart](/vertex-ai/generative-ai/docs/start/quickstart).\n\nImportant note about google-genai libraries\n-------------------------------------------\n\nWe've recently launched a new set of libraries that provide a more consistent\nand streamlined experience for accessing Google's generative AI models across\ndifferent Google services.\n\nVertex AI libraries are only supported on the Vertex AI platform.\n\nKey library updates\n-------------------\n\nUsers are encouraged to start with the new library and migrate from previous\nlibraries.\n\nInstall a library\n-----------------\n\nThe following examples can help you get started in various programming languages.\n\n### Python\n\nYou can install our [Python library](https://pypi.org/project/google-genai)\nby running: \n\n pip install google-genai\n\n### Go\n\nYou can install our [Go library](https://pkg.go.dev/google.golang.org/genai)\nby running: \n\n go get google.golang.org/genai\n\n### JavaScript and TypeScript\n\nYou can install our\n[JavaScript and TypeScript library](https://www.npmjs.com/package/@google/genai)\nby running: \n\n npm install @google/genai\n\nThe [new](https://ai.google.dev/gemini-api/docs/libraries) JavaScript and TypeScript library is available in\n*[preview](https://cloud.google.com/products#product-launch-stages)*, which means\nit may not be feature complete and that we may need to introduce breaking changes.\n\nHowever, we *highly recommend* you start using the [new SDK](https://www.npmjs.com/package/@google/genai)\nover the previous, deprecated version as long as you're comfortable with these caveats.\nWe're actively working towards a GA (General Availability) release for this library.\n\n### Java\n\nYou can install our [Java library](https://github.com/googleapis/java-genai)\nby adding the dependencies in Maven: \n\n \u003cdependencies\u003e\n \u003cdependency\u003e\n \u003cgroupId\u003ecom.google.genai\u003c/groupId\u003e\n \u003cartifactId\u003egoogle-genai\u003c/artifactId\u003e\n \u003cversion\u003e0.8.0\u003c/version\u003e\n \u003c/dependency\u003e\n \u003c/dependencies\u003e\n\nThe new Java library is available in\n*[preview](https://cloud.google.com/products#product-launch-stages)*, which means\nit may not be feature complete and that we may need to introduce breaking changes.\n\nHowever, we *highly recommend* you start using the\n[new](https://github.com/googleapis/java-genai) SDK over the\nprevious, deprecated version as long as you're comfortable with these caveats.\nWe're actively working towards a GA (General Availability) release for this library."]]