Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1GenerateContentRequest

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1/classes.rb,
lib/google/apis/aiplatform_v1/representations.rb,
lib/google/apis/aiplatform_v1/representations.rb

Overview

Request message for [PredictionService.GenerateContent].

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1GenerateContentRequest

Returns a new instance of GoogleCloudAiplatformV1GenerateContentRequest.



15063
15064
15065
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15063

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cached_contentString

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 Corresponds to the JSON property cachedContent

Returns:

  • (String)


15004
15005
15006
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15004

def cached_content
  @cached_content
end

#contentsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1Content>

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. Corresponds to the JSON property contents



15011
15012
15013
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15011

def contents
  @contents
end

#generation_configGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1GenerationConfig

Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. Corresponds to the JSON property generationConfig



15018
15019
15020
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15018

def generation_config
  @generation_config
end

#labelsHash<String,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. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


15027
15028
15029
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15027

def labels
  @labels
end

#model_armor_configGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1ModelArmorConfig

Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. Corresponds to the JSON property modelArmorConfig



15035
15036
15037
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15035

def model_armor_config
  @model_armor_config
end

#safety_settingsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1SafetySetting>

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates. Corresponds to the JSON property safetySettings



15041
15042
15043
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15041

def safety_settings
  @safety_settings
end

#system_instructionGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1Content

The structured data content of a message. A Content message contains a role field, which indicates the producer of the content, and a parts field, which contains the multi-part data of the message. Corresponds to the JSON property systemInstruction



15048
15049
15050
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15048

def system_instruction
  @system_instruction
end

#tool_configGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1ToolConfig

Tool config. This config is shared for all tools provided in the request. Corresponds to the JSON property toolConfig



15053
15054
15055
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15053

def tool_config
  @tool_config
end

#toolsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1Tool>

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. Corresponds to the JSON property tools



15061
15062
15063
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15061

def tools
  @tools
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 15068

def update!(**args)
  @cached_content = args[:cached_content] if args.key?(:cached_content)
  @contents = args[:contents] if args.key?(:contents)
  @generation_config = args[:generation_config] if args.key?(:generation_config)
  @labels = args[:labels] if args.key?(:labels)
  @model_armor_config = args[:model_armor_config] if args.key?(:model_armor_config)
  @safety_settings = args[:safety_settings] if args.key?(:safety_settings)
  @system_instruction = args[:system_instruction] if args.key?(:system_instruction)
  @tool_config = args[:tool_config] if args.key?(:tool_config)
  @tools = args[:tools] if args.key?(:tools)
end