Package-level declarations

Types

Link copied to clipboard
@Serializable
data class AttributionSourceId(val groundingPassage: GroundingPassageId? = null, val semanticRetrieverChunk: SemanticRetrieverChunk? = null)

Identifies the source of an attribution, which can be either a grounding passage or a chunk retrieved by a semantic retriever. This class allows for specifying the origin of content or data used in processing or analysis.

Link copied to clipboard
@Serializable
data class BatchEmbedRequest(val requests: List<EmbedContentRequest>)

Represents a batch request for embedding content.

Link copied to clipboard
@Serializable
data class BatchEmbedResponse(val embeddings: List<Values>)

Represents the response for a batch embedding request.

Link copied to clipboard
@Serializable
data class Candidate(val content: Content, val finishReason: String, val index: Int, val safetyRatings: List<SafetyRating>, val citationMetadata: CitationMetadata? = null, val tokenCount: Int? = null, val groundingAttributions: List<GroundingAttribution> = emptyList())

Represents a candidate entity with associated content and metadata.

Link copied to clipboard
@Serializable
data class CitationMetadata(val citationSources: List<CitationSource>)

Contains metadata about citations within a document, including references to the sources of these citations.

Link copied to clipboard
@Serializable
data class CitationSource(val startIndex: Int, val endIndex: Int, val uri: String, val license: String)

Represents a source of citation, detailing the location within the text and providing reference information such as a URI and license.

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

Represents the content composed of multiple parts, optionally associated with a specific role.

Link copied to clipboard
@Serializable
data class CountTokensRequest(val contents: List<Content>)

Represents a request to count the number of tokens in a list of content items. This is typically used to ensure that input does not exceed model or system limits for processing.

Link copied to clipboard
@Serializable
data class EmbedContentRequest(val content: Content, val model: String, val taskType: TaskType? = null, val title: String? = null)

Represents a request to embed content using a specified model, optionally including additional parameters such as task type and title.

Link copied to clipboard
@Serializable
data class EmbedResponse(val embedding: Values)

Represents the response from an embedding operation, containing the computed embedding values.

Link copied to clipboard
@Serializable
data class FileData(val mimeType: String, val fileUri: String)

Encapsulates data about a file, including its MIME type and a URI pointing to its location.

Link copied to clipboard
@Serializable
data class FunctionCall(val name: String, val args: List<String>)

Represents a call to a function, specifying the function's name and the arguments to be passed to it.

Link copied to clipboard
@Serializable
data class FunctionCallingConfig(val mode: Mode, val allowedFunctionNames: List<String>)

Configures how function calls are handled within a certain context, specifying the mode of operation and restrictions on which functions can be called.

Link copied to clipboard
@Serializable
data class FunctionDeclaration(val name: String, val description: String, val parameters: Schema)

Describes a function, including its name, a description of its purpose or behavior, and a schema defining its parameters.

Link copied to clipboard
@Serializable
data class FunctionResponse(val name: String, val args: List<String>)

Represents the response from a function call, including the function's name and the arguments or values returned by the function.

Link copied to clipboard
class Gemini(apiKey: String)

Represents a client for interacting with the Gemini API, providing methods to extract content, embed content, and retrieve model information.

Link copied to clipboard
@Serializable
data class GenerateContentRequest(val contents: List<Content>, val tools: List<Tool> = emptyList(), val toolConfig: ToolConfig? = null, val safetySettings: List<SafetySetting> = emptyList(), val systemInstruction: Content? = null, val generationConfig: GenerationConfig? = null)

Represents a request to generate content, specifying the inputs, tools, and configurations required for content generation.

Link copied to clipboard
@Serializable
data class GenerateContentResponse(val candidates: List<Candidate>, val promptFeedback: PromptFeedback? = null)

Represents the response structure for a content generation or analysis request.

Link copied to clipboard
@Serializable
data class GenerationConfig(val stopSequences: List<String>, val temperature: Double, val maxOutputTokens: Int, val topP: Double, val topK: Int, val responseMimeType: String? = null)

Configures the parameters for content generation, including conditions for stopping generation, creativity controls, output limits, and the format of the generated content.

Link copied to clipboard
@Serializable
data class GroundingAttribution(val sourceId: AttributionSourceId, val content: Content)

Represents the attribution of grounding, linking content to its source.

Link copied to clipboard
@Serializable
data class GroundingPassageId(val passageId: String, val partIndex: Int)

Represents an identifier for a grounding passage, including its unique ID and the index of the part within the passage.

Link copied to clipboard

Enumerates categories of harm that content may be classified under, providing a structured way to identify and categorize potentially harmful or sensitive content.

Link copied to clipboard

Enum class representing different categories of harmful content.

Link copied to clipboard
@Serializable
data class InlineData(val mimeType: String, val data: String)

Represents inline data that can be included in a request or response, typically for media content.

Link copied to clipboard
class ITTest
Link copied to clipboard
enum Mode : Enum<Mode>

Enumerates the possible modes of operation or configuration settings, providing predefined options for various functionalities.

Link copied to clipboard
@Serializable
data class Model(val name: String, val version: String, val displayName: String, val description: String, val inputTokenLimit: Int, val outputTokenLimit: Int, val supportedGenerationMethods: List<String>, val temperature: Double? = null, val topP: Double? = null, val topK: Int? = null)

Represents a model with its metadata and configuration parameters, providing detailed information about its capabilities and restrictions.

Link copied to clipboard
@Serializable
data class ModelCollection(val models: List<Model>)

Represents a collection of models, encapsulating them in a list structure for easy management and access.

Link copied to clipboard
@Serializable
data class Part(val text: String? = null, val inlineData: InlineData? = null, val functionCall: FunctionCall? = null, val functionResponse: FunctionResponse? = null, val fileData: FileData? = null)

Represents a part of content, which can be one of several types such as text, inline data, function call, function response, or file data.

Link copied to clipboard
@Serializable
data class PromptFeedback(val safetyRatings: List<SafetyRating>)

Represents feedback on the safety of a prompt, including ratings across various harm categories.

Link copied to clipboard
@Serializable
data class SafetyRating(val category: HarmCategory, val probability: HarmProbability, val blocked: Boolean? = null)

Represents a safety assessment for a specific category of potential harm.

Link copied to clipboard
@Serializable
data class SafetySetting(val category: HarmCategory, val threshold: Threshold)

Defines a safety setting for filtering or evaluating content based on a specific harm category.

Link copied to clipboard
@Serializable
data class Schema(val type: String, val format: String, val description: String, val nullable: Boolean, val enum: List<String>, val properties: Map<String, Schema>, val required: List<String>, val items: Schema)

Represents the schema definition for a data model, detailing its structure, type, and various constraints.

Link copied to clipboard
@Serializable
data class SemanticRetrieverChunk(val source: String, val chunk: String)

Represents a chunk of data retrieved by a semantic retriever, containing both the source from which the chunk was extracted and the chunk content itself.

Link copied to clipboard
enum TaskType : Enum<TaskType>

Enumerates the types of tasks that can be performed.

Link copied to clipboard
enum Threshold : Enum<Threshold>

Enumerates the possible thresholds for content blocking or filtering based on safety assessments.

Link copied to clipboard
@Serializable
data class Tool(val functionDeclarations: FunctionDeclaration)

Represents a tool that encapsulates function declarations, providing a structured way to access the functionalities declared.

Link copied to clipboard
@Serializable
data class ToolConfig(val functionCallingConfig: FunctionCallingConfig)

Represents a tool that encapsulates function declarations, providing a structured way to access the functionalities declared.

Link copied to clipboard
@Serializable
data class TotalTokens(val totalTokens: Int)

Represents the total count of tokens, typically used to summarize the amount of processed or generated content in terms of tokens.

Link copied to clipboard
@Serializable
data class Values(val values: List<Double>)

Represents a container for a list of numeric values.

Properties

Link copied to clipboard
val embedModel: String

Functions

Link copied to clipboard
fun main()