Class: Google::Apis::CesV1::Agent

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

Overview

An agent acts as the fundamental building block that provides instructions to the Large Language Model (LLM) for executing specific tasks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Agent

Returns a new instance of Agent.



240
241
242
# File 'lib/google/apis/ces_v1/classes.rb', line 240

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

Instance Attribute Details

#after_agent_callbacksArray<Google::Apis::CesV1::Callback>

Optional. The callbacks to execute after the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. Corresponds to the JSON property afterAgentCallbacks

Returns:



102
103
104
# File 'lib/google/apis/ces_v1/classes.rb', line 102

def after_agent_callbacks
  @after_agent_callbacks
end

#after_model_callbacksArray<Google::Apis::CesV1::Callback>

Optional. The callbacks to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. Corresponds to the JSON property afterModelCallbacks

Returns:



111
112
113
# File 'lib/google/apis/ces_v1/classes.rb', line 111

def after_model_callbacks
  @after_model_callbacks
end

#after_tool_callbacksArray<Google::Apis::CesV1::Callback>

Optional. The callbacks to execute after the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. Corresponds to the JSON property afterToolCallbacks

Returns:



120
121
122
# File 'lib/google/apis/ces_v1/classes.rb', line 120

def after_tool_callbacks
  @after_tool_callbacks
end

#before_agent_callbacksArray<Google::Apis::CesV1::Callback>

Optional. The callbacks to execute before the agent is called. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. Corresponds to the JSON property beforeAgentCallbacks

Returns:



128
129
130
# File 'lib/google/apis/ces_v1/classes.rb', line 128

def before_agent_callbacks
  @before_agent_callbacks
end

#before_model_callbacksArray<Google::Apis::CesV1::Callback>

Optional. The callbacks to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. Corresponds to the JSON property beforeModelCallbacks

Returns:



137
138
139
# File 'lib/google/apis/ces_v1/classes.rb', line 137

def before_model_callbacks
  @before_model_callbacks
end

#before_tool_callbacksArray<Google::Apis::CesV1::Callback>

Optional. The callbacks to execute before the tool is invoked. If there are multiple tool invocations, the callback will be executed multiple times. The provided callbacks are executed sequentially in the exact order they are given in the list. If a callback returns an overridden response, execution stops and any remaining callbacks are skipped. Corresponds to the JSON property beforeToolCallbacks

Returns:



146
147
148
# File 'lib/google/apis/ces_v1/classes.rb', line 146

def before_tool_callbacks
  @before_tool_callbacks
end

#child_agentsArray<String>

Optional. List of child agents in the agent tree. Format: projects/project/ locations/location/apps/app/agents/agent` Corresponds to the JSON propertychildAgents`

Returns:

  • (Array<String>)


152
153
154
# File 'lib/google/apis/ces_v1/classes.rb', line 152

def child_agents
  @child_agents
end

#create_timeString

Output only. Timestamp when the agent was created. Corresponds to the JSON property createTime

Returns:

  • (String)


157
158
159
# File 'lib/google/apis/ces_v1/classes.rb', line 157

def create_time
  @create_time
end

#descriptionString

Optional. Human-readable description of the agent. Corresponds to the JSON property description

Returns:

  • (String)


162
163
164
# File 'lib/google/apis/ces_v1/classes.rb', line 162

def description
  @description
end

#display_nameString

Required. Display name of the agent. Corresponds to the JSON property displayName

Returns:

  • (String)


167
168
169
# File 'lib/google/apis/ces_v1/classes.rb', line 167

def display_name
  @display_name
end

#etagString

Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes. Corresponds to the JSON property etag

Returns:

  • (String)


174
175
176
# File 'lib/google/apis/ces_v1/classes.rb', line 174

def etag
  @etag
end

#generated_summaryString

Output only. If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation. Corresponds to the JSON property generatedSummary

Returns:

  • (String)


180
181
182
# File 'lib/google/apis/ces_v1/classes.rb', line 180

def generated_summary
  @generated_summary
end

#guardrailsArray<String>

Optional. List of guardrails for the agent. Format: projects/project/ locations/location/apps/app/guardrails/guardrail` Corresponds to the JSON propertyguardrails`

Returns:

  • (Array<String>)


186
187
188
# File 'lib/google/apis/ces_v1/classes.rb', line 186

def guardrails
  @guardrails
end

#instructionString

Optional. Instructions for the LLM model to guide the agent's behavior. Corresponds to the JSON property instruction

Returns:

  • (String)


191
192
193
# File 'lib/google/apis/ces_v1/classes.rb', line 191

def instruction
  @instruction
end

#llm_agentGoogle::Apis::CesV1::AgentLlmAgent

Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model. Corresponds to the JSON property llmAgent



197
198
199
# File 'lib/google/apis/ces_v1/classes.rb', line 197

def llm_agent
  @llm_agent
end

#model_settingsGoogle::Apis::CesV1::ModelSettings

Model settings contains various configurations for the LLM model. Corresponds to the JSON property modelSettings



202
203
204
# File 'lib/google/apis/ces_v1/classes.rb', line 202

def model_settings
  @model_settings
end

#nameString

Identifier. The unique identifier of the agent. Format: projects/project/ locations/location/apps/app/agents/agent` Corresponds to the JSON propertyname`

Returns:

  • (String)


208
209
210
# File 'lib/google/apis/ces_v1/classes.rb', line 208

def name
  @name
end

#remote_dialogflow_agentGoogle::Apis::CesV1::AgentRemoteDialogflowAgent

The agent which will transfer execution to a remote Dialogflow CX agent. The Dialogflow agent will process subsequent user queries until the session ends or flow ends, and the control is transferred back to the parent CES agent. Corresponds to the JSON property remoteDialogflowAgent



216
217
218
# File 'lib/google/apis/ces_v1/classes.rb', line 216

def remote_dialogflow_agent
  @remote_dialogflow_agent
end

#toolsArray<String>

Optional. List of available tools for the agent. Format: projects/project/ locations/location/apps/app/tools/tool` Corresponds to the JSON propertytools`

Returns:

  • (Array<String>)


222
223
224
# File 'lib/google/apis/ces_v1/classes.rb', line 222

def tools
  @tools
end

#toolsetsArray<Google::Apis::CesV1::AgentAgentToolset>

Optional. List of toolsets for the agent. Corresponds to the JSON property toolsets



227
228
229
# File 'lib/google/apis/ces_v1/classes.rb', line 227

def toolsets
  @toolsets
end

#transfer_rulesArray<Google::Apis::CesV1::TransferRule>

Optional. Agent transfer rules. If multiple rules match, the first one in the list will be used. Corresponds to the JSON property transferRules



233
234
235
# File 'lib/google/apis/ces_v1/classes.rb', line 233

def transfer_rules
  @transfer_rules
end

#update_timeString

Output only. Timestamp when the agent was last updated. Corresponds to the JSON property updateTime

Returns:

  • (String)


238
239
240
# File 'lib/google/apis/ces_v1/classes.rb', line 238

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/google/apis/ces_v1/classes.rb', line 245

def update!(**args)
  @after_agent_callbacks = args[:after_agent_callbacks] if args.key?(:after_agent_callbacks)
  @after_model_callbacks = args[:after_model_callbacks] if args.key?(:after_model_callbacks)
  @after_tool_callbacks = args[:after_tool_callbacks] if args.key?(:after_tool_callbacks)
  @before_agent_callbacks = args[:before_agent_callbacks] if args.key?(:before_agent_callbacks)
  @before_model_callbacks = args[:before_model_callbacks] if args.key?(:before_model_callbacks)
  @before_tool_callbacks = args[:before_tool_callbacks] if args.key?(:before_tool_callbacks)
  @child_agents = args[:child_agents] if args.key?(:child_agents)
  @create_time = args[:create_time] if args.key?(:create_time)
  @description = args[:description] if args.key?(:description)
  @display_name = args[:display_name] if args.key?(:display_name)
  @etag = args[:etag] if args.key?(:etag)
  @generated_summary = args[:generated_summary] if args.key?(:generated_summary)
  @guardrails = args[:guardrails] if args.key?(:guardrails)
  @instruction = args[:instruction] if args.key?(:instruction)
  @llm_agent = args[:llm_agent] if args.key?(:llm_agent)
  @model_settings = args[:model_settings] if args.key?(:model_settings)
  @name = args[:name] if args.key?(:name)
  @remote_dialogflow_agent = args[:remote_dialogflow_agent] if args.key?(:remote_dialogflow_agent)
  @tools = args[:tools] if args.key?(:tools)
  @toolsets = args[:toolsets] if args.key?(:toolsets)
  @transfer_rules = args[:transfer_rules] if args.key?(:transfer_rules)
  @update_time = args[:update_time] if args.key?(:update_time)
end