קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ממשקי ה-API של GenAI ב-ML Kit מנצלים את העוצמה של Gemini Nano כדי לעזור לאפליקציות שלכם לבצע משימות. ממשקי ה-API האלה מספקים איכות גבוהה מחוץ לקופסה לתרחישי שימוש פופולריים באמצעות ממשק ברמה גבוהה. ממשקי ה-API של AI גנרטיבי ב-ML Kit מבוססים על AICore, שירות מערכת של Android שמאפשר הפעלה במכשיר של מודלים בסיסיים של AI גנרטיבי. כך אפשר להשתמש בתכונות כמו שיפור הפונקציונליות של האפליקציה ושיפור הפרטיות של המשתמשים על ידי עיבוד נתונים באופן מקומי.
ממשקי ה-API של GenAI ב-ML Kit תומכים בתכונות הבאות:
סיכום: סיכום מאמרים או שיחות בצ'אט כרשימת תבליטים.
הגהה: ליטוש של תוכן קצר על ידי שיפור הדקדוק ותיקון שגיאות איות.
שכתוב: שכתוב הודעות קצרות בטונים או בסגנונות שונים.
בדומה לתכונות אחרות של ML Kit, ממשקי ה-API של GenAI פועלים באופן מלא במכשיר, ולכן הם מספקים את היתרונות הבאים:
נתוני הקלט, המסקנות והפלט מעובדים באופן מקומי
הפונקציונליות נשארת זהה גם בלי חיבור אינטרנט אמין
אין עלות נוספת לשרת על כל קריאה ל-API
בנוסף, מכיוון ש-GenAI APIs מבוססים על AICore ומופעלים על ידי Gemini Nano, כל אפליקציה יכולה להשתמש במודל Gemini Nano המשותף שנמצא במכשיר. כך לא צריך לחכות להורדה של מודל אם הוא כבר קיים במכשיר, וגם נחסך מקום אחסון. מידע נוסף על האופן שבו AICore מבודד בקשות כדי להגן על הפרטיות
סטרימינג לעומת שידור לא בסטרימינג
ממשקי GenAI API של ML Kit מציעים אפשרויות של סטרימינג ושל קבלת תוצאות ללא סטרימינג. ה-API של הסטרימינג מספק תשובות מצטברות בזמן שהן נוצרות, וכך מתקבל זרם נתונים רציף. לעומת זאת, בממשק ה-API שאינו סטרימינג, המערכת מחכה עד שהתשובה כולה מוכנה לפני שהיא מחזירה אותה כבלוק יחיד.
כדאי לבחור את ה-API של הסטרימינג לתשובות ארוכות, כי הוא מאפשר לקבל משוב ראשוני מהיר יותר. ה-API ללא סטרימינג מתאים יותר לתשובות קצרות או כשמעבדים תוצאות באצווה.
תמיכה במכשיר
ממשקי ה-API של ML Kit GenAI זמינים במכשירים הבאים, ויש תוכניות להרחיב את התמיכה למכשירים נוספים:
Google: Pixel 10, Pixel 10 Pro, Pixel 10 Pro XL, Pixel 10 Pro Fold, Pixel 9, Pixel 9 Pro, Pixel 9 Pro XL, Pixel 9 Pro Fold
vivo: vivo X200, vivo X200 Pro, vivo X Fold3 Pro, vivo X Fold5
Xiaomi: Xiaomi 15 Ultra, Xiaomi 15
הזמינות של תמיכה בשפה מסוימת עשויה להשתנות בהתאם לתצורה של המכשיר הספציפי ולמודלים שהורדו למכשיר.
מכסה לכל אפליקציה
ב-AICore יש מכסת הסקה לכל אפליקציה. כלומר, אם תשלחו יותר מדי בקשות ל-GenAI API בפרק זמן קצר, תקבלו תגובה מסוג ErrorCode.BUSY. אם מקבלים שגיאה כזו, כדאי להשתמש בהשהיה מעריכית לפני ניסיון חוזר כדי לנסות שוב את הבקשה.
שימוש ברקע
הסקת מסקנות באמצעות GenAI API מותרת רק כשהאפליקציה היא האפליקציה העליונה בחזית. שימוש ב-API כשהאפליקציה לא פועלת בחזית, כולל שימוש בשירות שפועל בחזית, יגרום לתגובה ErrorCode.BUSY בגלל המכסה הנוכחית של שימוש ברקע.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-09-04 (שעון UTC)."],[],[],null,["| This API is offered in beta, and is not subject to any SLA or deprecation policy. Changes may be made to this API that break backward compatibility.\n\nML Kit's GenAI APIs harness the power of [Gemini Nano](https://developer.android.com/ai/gemini-nano/) to help your apps\nperform tasks. These APIs provide out-of-the-box quality for popular use cases\nthrough a high-level interface. The ML Kit GenAI APIs are built on top of\n[AICore](https://android-developers.googleblog.com/2023/12/a-new-foundation-for-ai-on-android.html), an Android system service that enables on-device execution of GenAI\nfoundation models to facilitate features such as enhanced app functionality and\nimproved user privacy by processing data locally.\n\nThe ML Kit GenAI APIs support the following features:\n\n- [**Summarization**](/ml-kit/genai/summarization/android): Summarize articles or chat conversations as a bulleted list.\n- [**Proofreading**](/ml-kit/genai/proofreading/android): Polish short content by refining grammar and fixing spelling errors.\n- [**Rewriting**](/ml-kit/genai/rewriting/android): Rewrite short messages in different tones or styles.\n- [**Image description**](/ml-kit/genai/image-description/android): Generate a short description of a given image.\n\nBenefits of GenAI APIs\n\nSimilar to other existing ML Kit features, GenAI APIs run entirely on-device and\nthus provide the following benefits:\n\n- Input, inference, and output data is processed locally\n- Functionality remains the same without reliable internet connection\n- No additional server cost incurred for each API call\n\nIn addition, since GenAI APIs are built on top of AICore and powered by Gemini\nNano, every app is able to use the shared Gemini Nano model that is on the\ndevice. This avoids the need to have to wait for a model to be downloaded if it\nalready exists on a device, and in turn conserves storage space. Learn [more\nabout how AICore isolates requests to protect privacy](https://android-developers.googleblog.com/2024/10/introduction-to-privacy-and-safety-gemini-nano.html).\n\nStreaming versus non-streaming\n\nML Kit GenAI APIs offer both streaming and non-streaming options for receiving\nresults. The streaming API delivers responses incrementally as they are\ngenerated, providing a continuous flow of data. In contrast, the non-streaming\nAPI waits until the entire response is complete before returning it as a single\nblock.\n\nChoose the streaming API for lengthy responses, as it allows for quicker initial\nfeedback. The non-streaming API is more suitable for short responses or when\nprocessing results in batches.\n\nDevice support\n\nThe ML Kit GenAI APIs are available on the following devices, with\nplans to expand support to additional devices:\n\n- Google: Pixel 10, Pixel 10 Pro, Pixel 10 Pro XL, Pixel 10 Pro Fold, Pixel 9, Pixel 9 Pro, Pixel 9 Pro XL, Pixel 9 Pro Fold\n- Honor: Honor 400 Pro, Magic 6 Pro, Magic 6 RSR, Magic 7, Magic 7 Pro, Magic V3\n- iQOO: iQOO 13\n- Motorola: Razr 60 Ultra\n- OnePlus: OnePlus 13, OnePlus 13s\n- OPPO: Find N5, Find X8, Find X8 Pro\n- POCO: POCO F7 Ultra\n- realme: realme GT 7 Pro\n- Samsung: Galaxy S25, Galaxy S25+, Galaxy S25 Ultra\n- vivo: vivo X200, vivo X200 Pro, vivo X Fold3 Pro, vivo X Fold5\n- Xiaomi: Xiaomi 15 Ultra, Xiaomi 15\n\nAvailability of specific language support may vary depending on the particular\ndevice's configuration and the models that have been downloaded to the device.\n\nQuota per application\n\nAICore enforces an inference quota per app. This means that making too many\nGenAI API requests in a short period will result in an `ErrorCode.BUSY`\nresponse. When receiving such an error, consider using exponential backoff to\nretry the request.\n\nBackground usage\n\nGenAI API inference is permitted only when the app is the top foreground\napplication. Using the API when the app is not in the foreground, including\nusing a foreground service, will result in an `ErrorCode.BUSY` response due to\nthe current lack of background usage quota.\n\nSample code\n\nTo get this code, check out the following samples:\n\n- [ML Kit GenAI Samples](https://github.com/googlesamples/mlkit/tree/master/android/genai)\n- [Android AI Catalog Sample](https://github.com/android/ai-samples/tree/main/ai-catalog)"]]