Package-level declarations

Types

Link copied to clipboard
typealias Base64 = String
Link copied to clipboard
@Serializable
data class BlobContent(val mimeType: String, val data: Base64)
Link copied to clipboard
@Serializable
enum BlockReason : Enum<BlockReason>
Link copied to clipboard
@Serializable
class Candidate(val content: Content, val finishReason: FinishReason?)
Link copied to clipboard
@Serializable
data class Content(val role: Role, val parts: List<Part>)
Link copied to clipboard
@Serializable
class ErrorDetails(val code: Int, val message: String, val status: String)
Link copied to clipboard
@Serializable
data class ErrorResponse(val error: ErrorDetails)
Link copied to clipboard
@Serializable
data class FileDataContent(val mimeType: String, val fileUri: String)
Link copied to clipboard
@Serializable
enum FinishReason : Enum<FinishReason>
Link copied to clipboard
@Serializable
data class FunctionCallContent(val name: String, val args: JsonObject)
Link copied to clipboard
@Serializable
data class FunctionCallingConfig(val mode: FunctionCallingConfig.Mode)
Link copied to clipboard
@Serializable
data class FunctionDeclaration(val name: String, val description: String, val parameters: JsonObject?)
Link copied to clipboard
@Serializable
data class FunctionResponseContent(val name: String, val response: JsonElement)
Link copied to clipboard
@Serializable
data class GenerateContentRequest(val contents: List<Content>, val tools: List<Tool>? = null, val generationConfig: GenerationConfig, var toolConfig: ToolConfig? = null, val systemInstruction: Content? = null, val safetySettings: List<SafetySettings> = emptyList())
Link copied to clipboard
@Serializable
data class GenerateContentResponse(val candidates: List<Candidate>? = null, val promptFeedback: PromptFeedback? = null, val usageMetadata: UsageMetadata?)
Link copied to clipboard
@Serializable
data class GenerationConfig(val temperature: Float?, val topP: Float?, val topK: Int?, val candidateCount: Int? = null, val maxOutputTokens: Int? = null, val stopSequences: List<String>? = null, val responseMimeType: String? = null, val presencePenalty: Float? = null, val frequencyPenalty: Float? = null, val thinkingConfig: ThinkingConfig? = null, val responseSchema: JsonObject? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Serializable(with = PartSerializer::class)
interface Part
Link copied to clipboard
object PartSerializer : JsonContentPolymorphicSerializer<Part>
Link copied to clipboard
@Serializable
data class PromptFeedback(val blockReason: BlockReason? = null, val safetyRatings: List<SafetyRating>? = null)
Link copied to clipboard
@Serializable
value class Role(val value: String)
Link copied to clipboard
@Serializable
data class SafetyRating(val category: HarmCategory, val probability: HarmProbability, val blocked: Boolean)
Link copied to clipboard
@Serializable
data class SafetySettings(val category: HarmCategory, val threshold: HarmBlockThreshold)
Link copied to clipboard
@Serializable
data class Schema(val type: String, val description: String? = null, val format: String? = null, val enum: List<String>? = null, val properties: Map<String, Schema>? = null, val required: List<String>? = null, val items: Schema? = null)
Link copied to clipboard
@Serializable
data class ThinkingConfig(val thinkingBudget: Int? = null)
Link copied to clipboard
@Serializable
class Tool(val functionDeclarations: List<FunctionDeclaration>)
Link copied to clipboard
@Serializable
data class ToolConfig(val functionCallingConfig: FunctionCallingConfig)
Link copied to clipboard
@Serializable
data class UsageMetadata(val promptTokenCount: Int? = null, val candidatesTokenCount: Int? = null, val totalTokenCount: Int? = null, val thoughtsTokenCount: Int? = null, val cachedContentTokenCount: Int? = null)