com.google.mlkit.genai.prompt

Annotations

Candidate.FinishReason

The reason why this Candidate is returned.

Content.Role

Role associated with Content

Feature

Features (capabilities) that may be supported by a generative model.

ModelPreference

Defines the developer's preference to guide model selection, balancing characteristics like speed and capability.

ModelReleaseStage

Defines the release stage preference for model selection.

TypedCandidate.TypedFinishReason

The reason why this TypedCandidate is returned.

Interfaces

Caches

Provides an interface to explicitly manage caches for GenerativeModel.

GenerativeModel

Provides an interface for performing content generation.

Classes

CachedContext

Represents an identifier of a cached context that can be used in inference.

Candidate

A piece of a response from the model.

Content

Represents a single "turn" or message in a conversation.

Content.Builder

Builder for Content.

ContentKt
CountTokensResponse

Data class holding token count information.

CreateCachedContextRequest

A request to create a cached context.

CreateCachedContextRequest.Builder

Builder for CreateCachedContextRequest.

CreateCachedContextRequestKt
FunctionCallPart

A data class representing a function call part of a prompt.

FunctionResponsePart

A data class representing a function response part of a prompt.

GenerateContentRequest

A request to generate content.

GenerateContentRequest.Builder

Builder for GenerateContentRequest.

GenerateContentRequestKt
GenerateContentResponse

Represents a response from the model.

GenerateTypedContentRequest

A request to generate typed content.

GenerateTypedContentRequest.Builder

Builder for GenerateTypedContentRequest.

GenerateTypedContentRequestKt
GenerateTypedContentResponse

Represents a typed response from the model.

GenerationConfig

Configuration parameters to use for content generation.

GenerationConfig.Builder

Builder for GenerationConfig.

GenerationConfigKt
ImagePart

A data class representing an image part of a prompt.

ModelConfig

Specifies the desired model for content generation.

ModelConfig.Builder

Builder for ModelConfig.

ModelConfigKt
Part

A sealed class representing a part of a multimodal prompt.

PromptPrefix

Represents a prompt prefix for on-device prompt caching.

SystemInstruction

A data class representing a system text part of a prompt.

TextPart

A data class representing a text part of a prompt.

TypedCandidate

A piece of a response from the model.

Content.Companion
FunctionCallPart.Companion
FunctionResponsePart.Companion
GenerateContentRequest.Companion
GenerateTypedContentRequest.Companion
Generation

Entry class to get a GenerativeModel client.

GenerationConfig.Companion
ModelConfig.Companion