GenerateContentRequest

@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.

Constructors

Link copied to clipboard
constructor(contents: List<Content>, tools: List<Tool> = emptyList(), toolConfig: ToolConfig? = null, safetySettings: List<SafetySetting> = emptyList(), systemInstruction: Content? = null, generationConfig: GenerationConfig? = null)

Properties

Link copied to clipboard
val contents: List<Content>

A list of Content objects that serve as the input for the content generation process. These can include text, data, or any form of content that needs processing or augmentation.

Link copied to clipboard

An optional GenerationConfig that specifies detailed configuration settings for the generation process, such as output format, generation methods, and other technical parameters. It is nullable, allowing for flexibility in cases where default configurations are sufficient.

Link copied to clipboard

An optional list of SafetySetting objects that define safety-related configurations and constraints for the content generation. This ensures that the generated content adheres to specified safety guidelines. Defaults to an empty list if no safety settings are specified.

Link copied to clipboard

An optional Content object that provides additional instructions or context to the system performing the content generation. This can guide the generation process in a specific direction or ensure certain considerations are made.

Link copied to clipboard
val toolConfig: ToolConfig? = null

An optional ToolConfig that provides global configuration settings for the tools involved in the generation process. It is nullable, allowing for cases where no specific configuration is needed.

Link copied to clipboard
val tools: List<Tool>

An optional list of Tool objects to be used in the content generation process. Each tool can apply specific transformations or analyses to the input contents. Defaults to an empty list if no tools are specified.