ממשקים
DownloadCallback |
פונקציות קריאה חוזרת שמשמשות להורדת מודלים. |
Part |
ממשק שמייצג נתונים שנשלחים לבקשות ומקבלים מהן. |
שיעורים
Candidate |
קטע של תשובה מהמודל. |
Content |
מייצג תוכן שנשלח אל המודל ונשלח ממנו. |
Content.Builder |
|
DownloadConfig |
פרמטרים של תצורה לשימוש בהורדת מודל המערכת. |
GenerateContentResponse |
מייצגת תשובה מהמודל. |
GenerationConfig |
פרמטרים של הגדרות אישיות לשימוש ביצירת תוכן. |
GenerationConfig.Builder |
|
GenerativeModel |
מנחה של מודל מערכת נתון. |
TextPart |
מייצג נתונים מבוססי טקסט או מחרוזת שנשלחים לבקשות ומקבלים מהן. |
חריגים
ConnectionException |
שגיאה במהלך החיבור. |
DownloadException |
שגיאה במהלך ההורדה. |
GenerativeAIException |
הכיתה ההורה של כל השגיאות שמתרחשות ב- |
InferenceException |
שגיאה במהלך ההסקה. |
PreparationException |
שגיאה במהלך ההכנה. |
TokenizationException |
שגיאה במהלך יצירת הטוקן. |
UnknownException |
שגיאה לא ידועה. |
הערות
Candidate.FinishReason |
סיבת הסיום שמשויכת ל- |
Content.Role |
התפקיד שמשויך ל- |
GenerativeAIException.ErrorCode |
קבוצת קודי השגיאה |
סיכום של פונקציות ברמה העליונה
Content |
content(@Content.Role role: Int, init: Content.Builder.() -> Unit) פונקציה ליצירת תוכן שנשלח אליה ומקבלת אותו באופן דומה ל-DSL. |
GenerationConfig |
generationConfig(init: GenerationConfig.Builder.() -> Unit) שיטה לעזרה ביצירת |
סיכום של פונקציות התוספים
פונקציות ברמה העליונה
תוכן
fun content(@Content.Role role: Int = Role.USER, init: Content.Builder.() -> Unit): Content
פונקציה ליצירת תוכן שנשלח אליה ומקבלת אותו באופן דומה ל-DSL.
מכיל אוסף של חלקים של טקסט, תמונה ובינאריים.
דוגמה לשימוש:
content(Role.MODEL) {
text("Example string")
)
generationConfig
fun generationConfig(init: GenerationConfig.Builder.() -> Unit): GenerationConfig
שיטה לעזרה ביצירת GenerationConfig
באופן דומה ל-DSL.
דוגמה לשימוש:
generationConfig {
context = context // required
workerExecutor = workerThread // Set the [ExecutorService] on which background tasks should be run. If no value is specified, a background thread pool will be used.
callbackExecutor = callbackExecutor // Set the [Executor] on which callbacks should be invoked. If no value is specified, callbacks will be invoked on the UI thread.
temperature = 0.75f
topK = 30
candidateCount = 4
maxOutputTokens = 300
stopSequences = listOf("in conclusion", "-----", "do you need")
}