專案 IDX 仍在測試階段。Beta 版產品和功能僅提供有限支援,且 Beta 版產品和功能的變更可能與先前版本不相容。
使用 Gemini API 建構應用程式
只要按一下按鈕,Project IDX 就能透過 Gemini API 輕鬆打造 AI 應用程式。使用範本開始在應用程式中使用 Google 最新的生成式 AI 模型,該範本包含您需要的所有 Gemini API 管線。插入 API 金鑰,即可開始使用。
使用預先載入 Gemini API 建構新應用程式
從範本資訊主頁存取 IDX Gemini API 範本,並運用 AI 的強大功能進行建構。
- 在 IDX 範本資訊主頁中開啟 Gemini API 的 IDX 範本。
- 選取環境的語言和架構。IDX 中的 Gemini API 範本支援 JavaScript (搭配 Vite) 和 Python (搭配 Flask 的筆記本或網頁應用程式),日後將推出更多語言和架構。
- (選用) 如果您想在應用程式中新增 LangChain 架構,請選取「Use LangChain」選項。
- 工作區載入後,請開啟
main.js
或 main.py
檔案,並使用 Google AI Studio 中的 Gemini API 金鑰更新 API_KEY
變數。
- 在網頁預覽面板中測試基礎應用程式,觀察 Gemini API 的運作情形,並據此修改新的 Gemini API 應用程式。
將 Gemini API 新增至現有應用程式
您也可以直接透過 IDX,將 Gemini API 新增至現有應用程式。
開啟 Project IDX。
按一下導覽窗格中的 IDX 圖示,開啟 IDX 面板。
展開「Google 整合」部分,然後按一下「新增 Gemini API」。
按照提示驗證帳戶,並將 Gemini API 金鑰新增至應用程式。
保留所有權利。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-20 (世界標準時間)。
[null,null,["上次更新時間:2025-02-20 (世界標準時間)。"],[[["Project IDX enables effortless integration of Google's Gemini API into your applications, simplifying AI app development."],["Leverage pre-built templates within IDX to swiftly create new AI-powered applications with the Gemini API readily configured."],["Existing projects can seamlessly incorporate the Gemini API via Project IDX, enhancing functionality with AI capabilities."],["Choose from various language and framework options, including JavaScript and Python, for Gemini API integration within your preferred development environment."],["Customize the template by providing your Gemini API key to unlock the full potential of Google's generative AI models within your app."]]],[]]