GeminiRequestReadConfig

Configuration for how to read Gemini requests from a multimodal dataset.

Fields
read_config Union type
The read config for the dataset. read_config can be only one of the following:
templateConfig object (GeminiTemplateConfig)

Gemini request template with placeholders.

assembledRequestColumnName string

Optional. column name in the dataset table that contains already fully assembled Gemini requests.

JSON representation
{

  // read_config
  "templateConfig": {
    object (GeminiTemplateConfig)
  },
  "assembledRequestColumnName": string
  // Union type
}

GeminiTemplateConfig

Template configuration to create Gemini examples from a multimodal dataset.

Fields
geminiExample object (GeminiExample)

Required. The template that will be used for assembling the request to use for downstream applications.

fieldMapping map (key: string, value: string)

Required. Map of template parameters to the columns in the dataset table.

JSON representation
{
  "geminiExample": {
    object (GeminiExample)
  },
  "fieldMapping": {
    string: string,
    ...
  }
}

GeminiExample

Format for Gemini examples used for Vertex Multimodal datasets.

Fields
model string

Optional. The fully qualified name of the publisher model or tuned model endpoint to use.

Publisher model format: projects/{project}/locations/{location}/publishers/*/models/*

Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

contents[] object (Content)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

cachedContent string

Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: projects/{project}/locations/{location}/cachedContents/{cachedContent}

tools[] object (Tool)

Optional. A list of Tools the model may use to generate the next response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

toolConfig object (ToolConfig)

Optional. Tool config. This config is shared for all tools provided in the request.

labels map (key: string, value: string)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. label values are optional. label keys must start with a letter.

safetySettings[] object (SafetySetting)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

generationConfig object (GenerationConfig)

Optional. Generation config.

systemInstruction object (Content)

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

JSON representation
{
  "model": string,
  "contents": [
    {
      object (Content)
    }
  ],
  "cachedContent": string,
  "tools": [
    {
      object (Tool)
    }
  ],
  "toolConfig": {
    object (ToolConfig)
  },
  "labels": {
    string: string,
    ...
  },
  "safetySettings": [
    {
      object (SafetySetting)
    }
  ],
  "generationConfig": {
    object (GenerationConfig)
  },
  "systemInstruction": {
    object (Content)
  }
}

SafetySetting

A safety setting that affects the safety-blocking behavior.

A SafetySetting consists of a harm category and a threshold for that category.

Fields
category enum (HarmCategory)

Required. The harm category to be blocked.

threshold enum (HarmBlockThreshold)

Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.

method enum (HarmBlockMethod)

Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.

JSON representation
{
  "category": enum (HarmCategory),
  "threshold": enum (HarmBlockThreshold),
  "method": enum (HarmBlockMethod)
}

HarmCategory

Harm categories that can be detected in user input and model responses.

Enums
HARM_CATEGORY_UNSPECIFIED Default value. This value is unused.
HARM_CATEGORY_HATE_SPEECH Content that promotes violence or incites hatred against individuals or groups based on certain attributes.
HARM_CATEGORY_DANGEROUS_CONTENT Content that promotes, facilitates, or enables dangerous activities.
HARM_CATEGORY_HARASSMENT Abusive, threatening, or content intended to bully, torment, or ridicule.
HARM_CATEGORY_SEXUALLY_EXPLICIT Content that contains sexually explicit material.
HARM_CATEGORY_CIVIC_INTEGRITY

Deprecated: Election filter is not longer supported. The harm category is civic integrity.

HARM_CATEGORY_IMAGE_HATE Images that contain hate speech.
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT Images that contain dangerous content.
HARM_CATEGORY_IMAGE_HARASSMENT Images that contain harassment.
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT Images that contain sexually explicit content.
HARM_CATEGORY_JAILBREAK Prompts designed to bypass safety filters.

HarmBlockThreshold

Thresholds for blocking content based on harm probability.

Enums
HARM_BLOCK_THRESHOLD_UNSPECIFIED The harm block threshold is unspecified.
BLOCK_LOW_AND_ABOVE Block content with a low harm probability or higher.
BLOCK_MEDIUM_AND_ABOVE Block content with a medium harm probability or higher.
BLOCK_ONLY_HIGH Block content with a high harm probability.
BLOCK_NONE Do not block any content, regardless of its harm probability.
OFF Turn off the safety filter entirely.

HarmBlockMethod

The method for blocking content.

Enums
HARM_BLOCK_METHOD_UNSPECIFIED The harm block method is unspecified.
SEVERITY The harm block method uses both probability and severity scores.
PROBABILITY The harm block method uses the probability score.