इंटरफ़ेस
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) डीएसएल की तरह भेजे और पाए गए कॉन्टेंट को बनाने के लिए फ़ंक्शन. |
GenerationConfig |
generationConfig(init: GenerationConfig.Builder.() -> Unit) डीएसएल (DSL) की तरह |
एक्सटेंशन फ़ंक्शन की खास जानकारी
टॉप-लेवल फ़ंक्शन
कॉन्टेंट
fun content(@Content.Role role: Int = Role.USER, init: Content.Builder.() -> Unit): Content
डीएसएल की तरह भेजे और पाए गए कॉन्टेंट को बनाने के लिए फ़ंक्शन.
इसमें टेक्स्ट, इमेज, और बाइनरी पार्ट का कलेक्शन होता है.
इस्तेमाल का उदाहरण:
content(Role.MODEL) {
text("Example string")
)
generationConfig
fun generationConfig(init: GenerationConfig.Builder.() -> Unit): GenerationConfig
डीएसएल (DSL) की तरह GenerationConfig
बनाने के लिए, सहायक तरीका.
इस्तेमाल का उदाहरण:
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")
}