Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class Candidate(val content: Content, val finishReason: String? = null, val safetyRatings: List<SafetyRating>? = null)

Represents a candidate response from the model.

Link copied to clipboard
data class Content(val parts: List<Part>, val role: String? = null)

Represents a part of the content in a request or response.

Link copied to clipboard
data class FunctionDeclaration(val name: String, val description: String? = null, val parameters: Map<String, Any>? = null)

Represents a function declaration for a tool.

Link copied to clipboard
data class GenerateContentRequest(val contents: List<Content>, val model: String? = null, val generationConfig: GenerationConfig? = null, val safetySettings: List<SafetySetting>? = null, val tools: List<Tool>? = null, val systemInstruction: Content? = null)
Link copied to clipboard
data class GenerateContentResponse(val candidates: List<Candidate>, val promptFeedback: PromptFeedback? = null, val usageMetadata: UsageMetadata? = null, val modelVersion: String, val responseId: String? = null)

Represents a response from the Gemini API.

Link copied to clipboard
data class GenerationConfig(val temperature: Double? = null, val topP: Double? = null, val topK: Float? = null, val candidateCount: Int? = null, val maxOutputTokens: Int? = null, val stopSequences: List<String>? = null, val responseMimeType: String? = null, val responseSchema: Schema? = null, val responseModalities: List<Modality>? = null, val seed: Int? = null, val presencePenalty: Double? = null, val frequencyPenalty: Double? = null, val responseLogprobs: Boolean? = null, val logprobs: Int? = null, val enableEnhancedCivicAnswers: Boolean? = null, val speechConfig: SpeechConfig? = null, val thinkingConfig: ThinkingConfig? = null, val mediaResolution: MediaResolution? = null)

Configuration options for text generation.

Link copied to clipboard

Threshold levels for blocking harmful content.

Link copied to clipboard

Probability levels for harmful content.

Link copied to clipboard

Resolution for media generation.

Link copied to clipboard
open class MockGemini(port: Int = 0, verbose: Boolean = true) : AbstractMockLlm

Mock implementation of Google Gemini API for testing purposes.

Link copied to clipboard

Modality for the response.

Link copied to clipboard
data class ModalityTokenCount(val modality: Modality, val tokenCount: Int)

https://ai.google.dev/api/generate-content#v1beta.ModalityTokenCount

Link copied to clipboard
data class Part(val text: String? = null)

Represents a part of the content, which can be text or other media.

Link copied to clipboard
data class PromptFeedback(val blockReason: BlockReason? = null, val safetyRatings: List<SafetyRating>? = null)

Represents feedback related to the prompt.

Link copied to clipboard

Categories for safety settings.

Link copied to clipboard
data class SafetyRating(val category: SafetyCategory, val probability: HarmProbability)

Represents a safety rating for content.

Link copied to clipboard
data class SafetySetting(val category: SafetyCategory, val threshold: HarmBlockThreshold)

Settings to control the safety of generated content.

Link copied to clipboard
data class Schema(val type: String? = null, val properties: Map<String, Any>? = null)

Schema for the response.

Link copied to clipboard
data class SpeechConfig(val voice: String? = null)

Configuration for speech generation.

Link copied to clipboard
data class ThinkingConfig(val enabled: Boolean? = null)

Configuration for thinking.

Link copied to clipboard
data class Tool(val functionDeclarations: List<FunctionDeclaration>)

Represents a tool that the model may call.

Link copied to clipboard
data class UsageMetadata(val promptTokenCount: Int? = null, val cachedContentTokenCount: Int? = null, val candidatesTokenCount: Int? = null, val toolUsePromptTokenCount: Int? = null, val thoughtsTokenCount: Int? = null, val totalTokenCount: Int? = null, val promptTokensDetails: List<ModalityTokenCount>? = null, val cacheTokensDetails: List<ModalityTokenCount>? = null, val candidatesTokensDetails: List<ModalityTokenCount>? = null, val toolUsePromptTokensDetails: List<ModalityTokenCount>? = null)