Description
Example Usage
Ces Agent Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const cesAppForAgent = new gcp.ces.App("ces_app_for_agent", {
appId: "app-id",
location: "us",
description: "App used as parent for CES Agent example",
displayName: "my-app",
languageSettings: {
defaultLanguageCode: "en-US",
supportedLanguageCodes: [
"es-ES",
"fr-FR",
],
enableMultilingualSupport: true,
fallbackAction: "escalate",
},
timeZoneSettings: {
timeZone: "America/Los_Angeles",
},
});
const cesToolForAgent = new gcp.ces.Tool("ces_tool_for_agent", {
location: "us",
app: cesAppForAgent.appId,
toolId: "tool-1",
executionType: "SYNCHRONOUS",
pythonFunction: {
name: "example_function",
pythonCode: "def example_function() -> int: return 0",
},
});
const cesToolsetForAgent = new gcp.ces.Toolset("ces_toolset_for_agent", {
toolsetId: "toolset-id",
location: "us",
app: cesAppForAgent.appId,
displayName: "Basic toolset display name",
openApiToolset: {
openApiSchema: `openapi: 3.0.0
info:
title: My Sample API
version: 1.0.0
description: A simple API example
servers:
- url: https://api.example.com/v1
paths: {}
`,
ignoreUnknownFields: false,
tlsConfig: {
caCerts: [{
displayName: "example",
cert: "ZXhhbXBsZQ==",
}],
},
serviceDirectoryConfig: {
service: "projects/example/locations/us/namespaces/namespace/services/service",
},
apiAuthentication: {
serviceAgentIdTokenAuthConfig: {},
},
},
});
const cesChildAgent = new gcp.ces.Agent("ces_child_agent", {
agentId: "child-agent-id",
location: "us",
app: cesAppForAgent.appId,
displayName: "child agent",
instruction: "You are a helpful assistant for this example.",
modelSettings: {
model: "gemini-1.5-flash",
temperature: 0.5,
},
llmAgent: {},
});
const cesGuardrailForAgent = new gcp.ces.Guardrail("ces_guardrail_for_agent", {
guardrailId: "guardrail-id",
location: cesAppForAgent.location,
app: cesAppForAgent.appId,
displayName: "Example guardrail",
description: "Guardrail description",
action: {
respondImmediately: {
responses: [{
text: "Text",
disabled: false,
}],
},
},
enabled: true,
modelSafety: {
safetySettings: [{
category: "HARM_CATEGORY_HATE_SPEECH",
threshold: "BLOCK_NONE",
}],
},
});
const cesAgentBasic = new gcp.ces.Agent("ces_agent_basic", {
agentId: "agent-id",
location: "us",
app: cesAppForAgent.appId,
displayName: "my-agent",
description: "test agent",
instruction: "You are a helpful assistant for this example.",
modelSettings: {
model: "gemini-1.5-flash",
temperature: 0.5,
},
afterAgentCallbacks: [{
description: "Example callback",
disabled: true,
pythonCode: `def callback(context):
return {'override': False}`,
}],
beforeAgentCallbacks: [{
description: "Example callback",
disabled: false,
pythonCode: `def callback(context):
return {'override': False}`,
}],
afterModelCallbacks: [{
description: "Example callback",
disabled: true,
pythonCode: `def callback(context):
return {'override': False}`,
}],
beforeModelCallbacks: [{
description: "Example callback",
disabled: true,
pythonCode: `def callback(context):
return {'override': False}`,
}],
afterToolCallbacks: [{
description: "Example callback",
disabled: true,
pythonCode: `def callback(context):
return {'override': False}`,
}],
beforeToolCallbacks: [{
description: "Example callback",
disabled: true,
pythonCode: `def callback(context):
return {'override': False}`,
}],
tools: [cesToolForAgent.id],
guardrails: [cesGuardrailForAgent.id],
toolsets: [{
toolset: cesToolsetForAgent.id,
toolIds: ["testtoolid"],
}],
childAgents: [pulumi.all([cesAppForAgent.project, cesAppForAgent.appId, cesChildAgent.agentId]).apply(([project, appId, agentId]) => `projects/${project}/locations/us/apps/${appId}/agents/${agentId}`)],
llmAgent: {},
});
import pulumi
import pulumi_gcp as gcp
ces_app_for_agent = gcp.ces.App("ces_app_for_agent",
app_id="app-id",
location="us",
description="App used as parent for CES Agent example",
display_name="my-app",
language_settings={
"default_language_code": "en-US",
"supported_language_codes": [
"es-ES",
"fr-FR",
],
"enable_multilingual_support": True,
"fallback_action": "escalate",
},
time_zone_settings={
"time_zone": "America/Los_Angeles",
})
ces_tool_for_agent = gcp.ces.Tool("ces_tool_for_agent",
location="us",
app=ces_app_for_agent.app_id,
tool_id="tool-1",
execution_type="SYNCHRONOUS",
python_function={
"name": "example_function",
"python_code": "def example_function() -> int: return 0",
})
ces_toolset_for_agent = gcp.ces.Toolset("ces_toolset_for_agent",
toolset_id="toolset-id",
location="us",
app=ces_app_for_agent.app_id,
display_name="Basic toolset display name",
open_api_toolset={
"open_api_schema": """openapi: 3.0.0
info:
title: My Sample API
version: 1.0.0
description: A simple API example
servers:
- url: https://api.example.com/v1
paths: {}
""",
"ignore_unknown_fields": False,
"tls_config": {
"ca_certs": [{
"display_name": "example",
"cert": "ZXhhbXBsZQ==",
}],
},
"service_directory_config": {
"service": "projects/example/locations/us/namespaces/namespace/services/service",
},
"api_authentication": {
"service_agent_id_token_auth_config": {},
},
})
ces_child_agent = gcp.ces.Agent("ces_child_agent",
agent_id="child-agent-id",
location="us",
app=ces_app_for_agent.app_id,
display_name="child agent",
instruction="You are a helpful assistant for this example.",
model_settings={
"model": "gemini-1.5-flash",
"temperature": 0.5,
},
llm_agent={})
ces_guardrail_for_agent = gcp.ces.Guardrail("ces_guardrail_for_agent",
guardrail_id="guardrail-id",
location=ces_app_for_agent.location,
app=ces_app_for_agent.app_id,
display_name="Example guardrail",
description="Guardrail description",
action={
"respond_immediately": {
"responses": [{
"text": "Text",
"disabled": False,
}],
},
},
enabled=True,
model_safety={
"safety_settings": [{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "BLOCK_NONE",
}],
})
ces_agent_basic = gcp.ces.Agent("ces_agent_basic",
agent_id="agent-id",
location="us",
app=ces_app_for_agent.app_id,
display_name="my-agent",
description="test agent",
instruction="You are a helpful assistant for this example.",
model_settings={
"model": "gemini-1.5-flash",
"temperature": 0.5,
},
after_agent_callbacks=[{
"description": "Example callback",
"disabled": True,
"python_code": """def callback(context):
return {'override': False}""",
}],
before_agent_callbacks=[{
"description": "Example callback",
"disabled": False,
"python_code": """def callback(context):
return {'override': False}""",
}],
after_model_callbacks=[{
"description": "Example callback",
"disabled": True,
"python_code": """def callback(context):
return {'override': False}""",
}],
before_model_callbacks=[{
"description": "Example callback",
"disabled": True,
"python_code": """def callback(context):
return {'override': False}""",
}],
after_tool_callbacks=[{
"description": "Example callback",
"disabled": True,
"python_code": """def callback(context):
return {'override': False}""",
}],
before_tool_callbacks=[{
"description": "Example callback",
"disabled": True,
"python_code": """def callback(context):
return {'override': False}""",
}],
tools=[ces_tool_for_agent.id],
guardrails=[ces_guardrail_for_agent.id],
toolsets=[{
"toolset": ces_toolset_for_agent.id,
"tool_ids": ["testtoolid"],
}],
child_agents=[pulumi.Output.all(
project=ces_app_for_agent.project,
app_id=ces_app_for_agent.app_id,
agent_id=ces_child_agent.agent_id
).apply(lambda resolved_outputs: f"projects/{resolved_outputs['project']}/locations/us/apps/{resolved_outputs['app_id']}/agents/{resolved_outputs['agent_id']}")
],
llm_agent={})
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/ces"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cesAppForAgent, err := ces.NewApp(ctx, "ces_app_for_agent", &ces.AppArgs{
AppId: pulumi.String("app-id"),
Location: pulumi.String("us"),
Description: pulumi.String("App used as parent for CES Agent example"),
DisplayName: pulumi.String("my-app"),
LanguageSettings: &ces.AppLanguageSettingsArgs{
DefaultLanguageCode: pulumi.String("en-US"),
SupportedLanguageCodes: pulumi.StringArray{
pulumi.String("es-ES"),
pulumi.String("fr-FR"),
},
EnableMultilingualSupport: pulumi.Bool(true),
FallbackAction: pulumi.String("escalate"),
},
TimeZoneSettings: &ces.AppTimeZoneSettingsArgs{
TimeZone: pulumi.String("America/Los_Angeles"),
},
})
if err != nil {
return err
}
cesToolForAgent, err := ces.NewTool(ctx, "ces_tool_for_agent", &ces.ToolArgs{
Location: pulumi.String("us"),
App: cesAppForAgent.AppId,
ToolId: pulumi.String("tool-1"),
ExecutionType: pulumi.String("SYNCHRONOUS"),
PythonFunction: &ces.ToolPythonFunctionArgs{
Name: pulumi.String("example_function"),
PythonCode: pulumi.String("def example_function() -> int: return 0"),
},
})
if err != nil {
return err
}
cesToolsetForAgent, err := ces.NewToolset(ctx, "ces_toolset_for_agent", &ces.ToolsetArgs{
ToolsetId: pulumi.String("toolset-id"),
Location: pulumi.String("us"),
App: cesAppForAgent.AppId,
DisplayName: pulumi.String("Basic toolset display name"),
OpenApiToolset: &ces.ToolsetOpenApiToolsetArgs{
OpenApiSchema: pulumi.String(`openapi: 3.0.0
info:
title: My Sample API
version: 1.0.0
description: A simple API example
servers:
- url: https://api.example.com/v1
paths: {}
`),
IgnoreUnknownFields: pulumi.Bool(false),
TlsConfig: &ces.ToolsetOpenApiToolsetTlsConfigArgs{
CaCerts: ces.ToolsetOpenApiToolsetTlsConfigCaCertArray{
&ces.ToolsetOpenApiToolsetTlsConfigCaCertArgs{
DisplayName: pulumi.String("example"),
Cert: pulumi.String("ZXhhbXBsZQ=="),
},
},
},
ServiceDirectoryConfig: &ces.ToolsetOpenApiToolsetServiceDirectoryConfigArgs{
Service: pulumi.String("projects/example/locations/us/namespaces/namespace/services/service"),
},
ApiAuthentication: &ces.ToolsetOpenApiToolsetApiAuthenticationArgs{
ServiceAgentIdTokenAuthConfig: &ces.ToolsetOpenApiToolsetApiAuthenticationServiceAgentIdTokenAuthConfigArgs{},
},
},
})
if err != nil {
return err
}
cesChildAgent, err := ces.NewAgent(ctx, "ces_child_agent", &ces.AgentArgs{
AgentId: pulumi.String("child-agent-id"),
Location: pulumi.String("us"),
App: cesAppForAgent.AppId,
DisplayName: pulumi.String("child agent"),
Instruction: pulumi.String("You are a helpful assistant for this example."),
ModelSettings: &ces.AgentModelSettingsArgs{
Model: pulumi.String("gemini-1.5-flash"),
Temperature: pulumi.Float64(0.5),
},
LlmAgent: &ces.AgentLlmAgentArgs{},
})
if err != nil {
return err
}
cesGuardrailForAgent, err := ces.NewGuardrail(ctx, "ces_guardrail_for_agent", &ces.GuardrailArgs{
GuardrailId: pulumi.String("guardrail-id"),
Location: cesAppForAgent.Location,
App: cesAppForAgent.AppId,
DisplayName: pulumi.String("Example guardrail"),
Description: pulumi.String("Guardrail description"),
Action: &ces.GuardrailActionArgs{
RespondImmediately: &ces.GuardrailActionRespondImmediatelyArgs{
Responses: ces.GuardrailActionRespondImmediatelyResponseArray{
&ces.GuardrailActionRespondImmediatelyResponseArgs{
Text: pulumi.String("Text"),
Disabled: pulumi.Bool(false),
},
},
},
},
Enabled: pulumi.Bool(true),
ModelSafety: &ces.GuardrailModelSafetyArgs{
SafetySettings: ces.GuardrailModelSafetySafetySettingArray{
&ces.GuardrailModelSafetySafetySettingArgs{
Category: pulumi.String("HARM_CATEGORY_HATE_SPEECH"),
Threshold: pulumi.String("BLOCK_NONE"),
},
},
},
})
if err != nil {
return err
}
_, err = ces.NewAgent(ctx, "ces_agent_basic", &ces.AgentArgs{
AgentId: pulumi.String("agent-id"),
Location: pulumi.String("us"),
App: cesAppForAgent.AppId,
DisplayName: pulumi.String("my-agent"),
Description: pulumi.String("test agent"),
Instruction: pulumi.String("You are a helpful assistant for this example."),
ModelSettings: &ces.AgentModelSettingsArgs{
Model: pulumi.String("gemini-1.5-flash"),
Temperature: pulumi.Float64(0.5),
},
AfterAgentCallbacks: ces.AgentAfterAgentCallbackArray{
&ces.AgentAfterAgentCallbackArgs{
Description: pulumi.String("Example callback"),
Disabled: pulumi.Bool(true),
PythonCode: pulumi.String("def callback(context):\n return {'override': False}"),
},
},
BeforeAgentCallbacks: ces.AgentBeforeAgentCallbackArray{
&ces.AgentBeforeAgentCallbackArgs{
Description: pulumi.String("Example callback"),
Disabled: pulumi.Bool(false),
PythonCode: pulumi.String("def callback(context):\n return {'override': False}"),
},
},
AfterModelCallbacks: ces.AgentAfterModelCallbackArray{
&ces.AgentAfterModelCallbackArgs{
Description: pulumi.String("Example callback"),
Disabled: pulumi.Bool(true),
PythonCode: pulumi.String("def callback(context):\n return {'override': False}"),
},
},
BeforeModelCallbacks: ces.AgentBeforeModelCallbackArray{
&ces.AgentBeforeModelCallbackArgs{
Description: pulumi.String("Example callback"),
Disabled: pulumi.Bool(true),
PythonCode: pulumi.String("def callback(context):\n return {'override': False}"),
},
},
AfterToolCallbacks: ces.AgentAfterToolCallbackArray{
&ces.AgentAfterToolCallbackArgs{
Description: pulumi.String("Example callback"),
Disabled: pulumi.Bool(true),
PythonCode: pulumi.String("def callback(context):\n return {'override': False}"),
},
},
BeforeToolCallbacks: ces.AgentBeforeToolCallbackArray{
&ces.AgentBeforeToolCallbackArgs{
Description: pulumi.String("Example callback"),
Disabled: pulumi.Bool(true),
PythonCode: pulumi.String("def callback(context):\n return {'override': False}"),
},
},
Tools: pulumi.StringArray{
cesToolForAgent.ID(),
},
Guardrails: pulumi.StringArray{
cesGuardrailForAgent.ID(),
},
Toolsets: ces.AgentToolsetArray{
&ces.AgentToolsetArgs{
Toolset: cesToolsetForAgent.ID(),
ToolIds: pulumi.StringArray{
pulumi.String("testtoolid"),
},
},
},
ChildAgents: pulumi.StringArray{
pulumi.All(cesAppForAgent.Project, cesAppForAgent.AppId, cesChildAgent.AgentId).ApplyT(func(_args []interface{}) (string, error) {
project := _args[0].(string)
appId := _args[1].(string)
agentId := _args[2].(*string)
return fmt.Sprintf("projects/%v/locations/us/apps/%v/agents/%v", project, appId, agentId), nil
}).(pulumi.StringOutput),
},
LlmAgent: &ces.AgentLlmAgentArgs{},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var cesAppForAgent = new Gcp.Ces.App("ces_app_for_agent", new()
{
AppId = "app-id",
Location = "us",
Description = "App used as parent for CES Agent example",
DisplayName = "my-app",
LanguageSettings = new Gcp.Ces.Inputs.AppLanguageSettingsArgs
{
DefaultLanguageCode = "en-US",
SupportedLanguageCodes = new[]
{
"es-ES",
"fr-FR",
},
EnableMultilingualSupport = true,
FallbackAction = "escalate",
},
TimeZoneSettings = new Gcp.Ces.Inputs.AppTimeZoneSettingsArgs
{
TimeZone = "America/Los_Angeles",
},
});
var cesToolForAgent = new Gcp.Ces.Tool("ces_tool_for_agent", new()
{
Location = "us",
App = cesAppForAgent.AppId,
ToolId = "tool-1",
ExecutionType = "SYNCHRONOUS",
PythonFunction = new Gcp.Ces.Inputs.ToolPythonFunctionArgs
{
Name = "example_function",
PythonCode = "def example_function() -> int: return 0",
},
});
var cesToolsetForAgent = new Gcp.Ces.Toolset("ces_toolset_for_agent", new()
{
ToolsetId = "toolset-id",
Location = "us",
App = cesAppForAgent.AppId,
DisplayName = "Basic toolset display name",
OpenApiToolset = new Gcp.Ces.Inputs.ToolsetOpenApiToolsetArgs
{
OpenApiSchema = @"openapi: 3.0.0
info:
title: My Sample API
version: 1.0.0
description: A simple API example
servers:
- url: https://api.example.com/v1
paths: {}
",
IgnoreUnknownFields = false,
TlsConfig = new Gcp.Ces.Inputs.ToolsetOpenApiToolsetTlsConfigArgs
{
CaCerts = new[]
{
new Gcp.Ces.Inputs.ToolsetOpenApiToolsetTlsConfigCaCertArgs
{
DisplayName = "example",
Cert = "ZXhhbXBsZQ==",
},
},
},
ServiceDirectoryConfig = new Gcp.Ces.Inputs.ToolsetOpenApiToolsetServiceDirectoryConfigArgs
{
Service = "projects/example/locations/us/namespaces/namespace/services/service",
},
ApiAuthentication = new Gcp.Ces.Inputs.ToolsetOpenApiToolsetApiAuthenticationArgs
{
ServiceAgentIdTokenAuthConfig = null,
},
},
});
var cesChildAgent = new Gcp.Ces.Agent("ces_child_agent", new()
{
AgentId = "child-agent-id",
Location = "us",
App = cesAppForAgent.AppId,
DisplayName = "child agent",
Instruction = "You are a helpful assistant for this example.",
ModelSettings = new Gcp.Ces.Inputs.AgentModelSettingsArgs
{
Model = "gemini-1.5-flash",
Temperature = 0.5,
},
LlmAgent = null,
});
var cesGuardrailForAgent = new Gcp.Ces.Guardrail("ces_guardrail_for_agent", new()
{
GuardrailId = "guardrail-id",
Location = cesAppForAgent.Location,
App = cesAppForAgent.AppId,
DisplayName = "Example guardrail",
Description = "Guardrail description",
Action = new Gcp.Ces.Inputs.GuardrailActionArgs
{
RespondImmediately = new Gcp.Ces.Inputs.GuardrailActionRespondImmediatelyArgs
{
Responses = new[]
{
new Gcp.Ces.Inputs.GuardrailActionRespondImmediatelyResponseArgs
{
Text = "Text",
Disabled = false,
},
},
},
},
Enabled = true,
ModelSafety = new Gcp.Ces.Inputs.GuardrailModelSafetyArgs
{
SafetySettings = new[]
{
new Gcp.Ces.Inputs.GuardrailModelSafetySafetySettingArgs
{
Category = "HARM_CATEGORY_HATE_SPEECH",
Threshold = "BLOCK_NONE",
},
},
},
});
var cesAgentBasic = new Gcp.Ces.Agent("ces_agent_basic", new()
{
AgentId = "agent-id",
Location = "us",
App = cesAppForAgent.AppId,
DisplayName = "my-agent",
Description = "test agent",
Instruction = "You are a helpful assistant for this example.",
ModelSettings = new Gcp.Ces.Inputs.AgentModelSettingsArgs
{
Model = "gemini-1.5-flash",
Temperature = 0.5,
},
AfterAgentCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentAfterAgentCallbackArgs
{
Description = "Example callback",
Disabled = true,
PythonCode = @"def callback(context):
return {'override': False}",
},
},
BeforeAgentCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentBeforeAgentCallbackArgs
{
Description = "Example callback",
Disabled = false,
PythonCode = @"def callback(context):
return {'override': False}",
},
},
AfterModelCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentAfterModelCallbackArgs
{
Description = "Example callback",
Disabled = true,
PythonCode = @"def callback(context):
return {'override': False}",
},
},
BeforeModelCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentBeforeModelCallbackArgs
{
Description = "Example callback",
Disabled = true,
PythonCode = @"def callback(context):
return {'override': False}",
},
},
AfterToolCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentAfterToolCallbackArgs
{
Description = "Example callback",
Disabled = true,
PythonCode = @"def callback(context):
return {'override': False}",
},
},
BeforeToolCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentBeforeToolCallbackArgs
{
Description = "Example callback",
Disabled = true,
PythonCode = @"def callback(context):
return {'override': False}",
},
},
Tools = new[]
{
cesToolForAgent.Id,
},
Guardrails = new[]
{
cesGuardrailForAgent.Id,
},
Toolsets = new[]
{
new Gcp.Ces.Inputs.AgentToolsetArgs
{
Toolset = cesToolsetForAgent.Id,
ToolIds = new[]
{
"testtoolid",
},
},
},
ChildAgents = new[]
{
Output.Tuple(cesAppForAgent.Project, cesAppForAgent.AppId, cesChildAgent.AgentId).Apply(values =>
{
var project = values.Item1;
var appId = values.Item2;
var agentId = values.Item3;
return $"projects/{project}/locations/us/apps/{appId}/agents/{agentId}";
}),
},
LlmAgent = null,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.ces.App;
import com.pulumi.gcp.ces.AppArgs;
import com.pulumi.gcp.ces.inputs.AppLanguageSettingsArgs;
import com.pulumi.gcp.ces.inputs.AppTimeZoneSettingsArgs;
import com.pulumi.gcp.ces.Tool;
import com.pulumi.gcp.ces.ToolArgs;
import com.pulumi.gcp.ces.inputs.ToolPythonFunctionArgs;
import com.pulumi.gcp.ces.Toolset;
import com.pulumi.gcp.ces.ToolsetArgs;
import com.pulumi.gcp.ces.inputs.ToolsetOpenApiToolsetArgs;
import com.pulumi.gcp.ces.inputs.ToolsetOpenApiToolsetTlsConfigArgs;
import com.pulumi.gcp.ces.inputs.ToolsetOpenApiToolsetServiceDirectoryConfigArgs;
import com.pulumi.gcp.ces.inputs.ToolsetOpenApiToolsetApiAuthenticationArgs;
import com.pulumi.gcp.ces.inputs.ToolsetOpenApiToolsetApiAuthenticationServiceAgentIdTokenAuthConfigArgs;
import com.pulumi.gcp.ces.Agent;
import com.pulumi.gcp.ces.AgentArgs;
import com.pulumi.gcp.ces.inputs.AgentModelSettingsArgs;
import com.pulumi.gcp.ces.inputs.AgentLlmAgentArgs;
import com.pulumi.gcp.ces.Guardrail;
import com.pulumi.gcp.ces.GuardrailArgs;
import com.pulumi.gcp.ces.inputs.GuardrailActionArgs;
import com.pulumi.gcp.ces.inputs.GuardrailActionRespondImmediatelyArgs;
import com.pulumi.gcp.ces.inputs.GuardrailModelSafetyArgs;
import com.pulumi.gcp.ces.inputs.AgentAfterAgentCallbackArgs;
import com.pulumi.gcp.ces.inputs.AgentBeforeAgentCallbackArgs;
import com.pulumi.gcp.ces.inputs.AgentAfterModelCallbackArgs;
import com.pulumi.gcp.ces.inputs.AgentBeforeModelCallbackArgs;
import com.pulumi.gcp.ces.inputs.AgentAfterToolCallbackArgs;
import com.pulumi.gcp.ces.inputs.AgentBeforeToolCallbackArgs;
import com.pulumi.gcp.ces.inputs.AgentToolsetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var cesAppForAgent = new App("cesAppForAgent", AppArgs.builder()
.appId("app-id")
.location("us")
.description("App used as parent for CES Agent example")
.displayName("my-app")
.languageSettings(AppLanguageSettingsArgs.builder()
.defaultLanguageCode("en-US")
.supportedLanguageCodes(
"es-ES",
"fr-FR")
.enableMultilingualSupport(true)
.fallbackAction("escalate")
.build())
.timeZoneSettings(AppTimeZoneSettingsArgs.builder()
.timeZone("America/Los_Angeles")
.build())
.build());
var cesToolForAgent = new Tool("cesToolForAgent", ToolArgs.builder()
.location("us")
.app(cesAppForAgent.appId())
.toolId("tool-1")
.executionType("SYNCHRONOUS")
.pythonFunction(ToolPythonFunctionArgs.builder()
.name("example_function")
.pythonCode("def example_function() -> int: return 0")
.build())
.build());
var cesToolsetForAgent = new Toolset("cesToolsetForAgent", ToolsetArgs.builder()
.toolsetId("toolset-id")
.location("us")
.app(cesAppForAgent.appId())
.displayName("Basic toolset display name")
.openApiToolset(ToolsetOpenApiToolsetArgs.builder()
.openApiSchema("""
openapi: 3.0.0
info:
title: My Sample API
version: 1.0.0
description: A simple API example
servers:
- url: https://api.example.com/v1
paths: {}
""")
.ignoreUnknownFields(false)
.tlsConfig(ToolsetOpenApiToolsetTlsConfigArgs.builder()
.caCerts(ToolsetOpenApiToolsetTlsConfigCaCertArgs.builder()
.displayName("example")
.cert("ZXhhbXBsZQ==")
.build())
.build())
.serviceDirectoryConfig(ToolsetOpenApiToolsetServiceDirectoryConfigArgs.builder()
.service("projects/example/locations/us/namespaces/namespace/services/service")
.build())
.apiAuthentication(ToolsetOpenApiToolsetApiAuthenticationArgs.builder()
.serviceAgentIdTokenAuthConfig(ToolsetOpenApiToolsetApiAuthenticationServiceAgentIdTokenAuthConfigArgs.builder()
.build())
.build())
.build())
.build());
var cesChildAgent = new Agent("cesChildAgent", AgentArgs.builder()
.agentId("child-agent-id")
.location("us")
.app(cesAppForAgent.appId())
.displayName("child agent")
.instruction("You are a helpful assistant for this example.")
.modelSettings(AgentModelSettingsArgs.builder()
.model("gemini-1.5-flash")
.temperature(0.5)
.build())
.llmAgent(AgentLlmAgentArgs.builder()
.build())
.build());
var cesGuardrailForAgent = new Guardrail("cesGuardrailForAgent", GuardrailArgs.builder()
.guardrailId("guardrail-id")
.location(cesAppForAgent.location())
.app(cesAppForAgent.appId())
.displayName("Example guardrail")
.description("Guardrail description")
.action(GuardrailActionArgs.builder()
.respondImmediately(GuardrailActionRespondImmediatelyArgs.builder()
.responses(GuardrailActionRespondImmediatelyResponseArgs.builder()
.text("Text")
.disabled(false)
.build())
.build())
.build())
.enabled(true)
.modelSafety(GuardrailModelSafetyArgs.builder()
.safetySettings(GuardrailModelSafetySafetySettingArgs.builder()
.category("HARM_CATEGORY_HATE_SPEECH")
.threshold("BLOCK_NONE")
.build())
.build())
.build());
var cesAgentBasic = new Agent("cesAgentBasic", AgentArgs.builder()
.agentId("agent-id")
.location("us")
.app(cesAppForAgent.appId())
.displayName("my-agent")
.description("test agent")
.instruction("You are a helpful assistant for this example.")
.modelSettings(AgentModelSettingsArgs.builder()
.model("gemini-1.5-flash")
.temperature(0.5)
.build())
.afterAgentCallbacks(AgentAfterAgentCallbackArgs.builder()
.description("Example callback")
.disabled(true)
.pythonCode("""
def callback(context):
return {'override': False} """)
.build())
.beforeAgentCallbacks(AgentBeforeAgentCallbackArgs.builder()
.description("Example callback")
.disabled(false)
.pythonCode("""
def callback(context):
return {'override': False} """)
.build())
.afterModelCallbacks(AgentAfterModelCallbackArgs.builder()
.description("Example callback")
.disabled(true)
.pythonCode("""
def callback(context):
return {'override': False} """)
.build())
.beforeModelCallbacks(AgentBeforeModelCallbackArgs.builder()
.description("Example callback")
.disabled(true)
.pythonCode("""
def callback(context):
return {'override': False} """)
.build())
.afterToolCallbacks(AgentAfterToolCallbackArgs.builder()
.description("Example callback")
.disabled(true)
.pythonCode("""
def callback(context):
return {'override': False} """)
.build())
.beforeToolCallbacks(AgentBeforeToolCallbackArgs.builder()
.description("Example callback")
.disabled(true)
.pythonCode("""
def callback(context):
return {'override': False} """)
.build())
.tools(cesToolForAgent.id())
.guardrails(cesGuardrailForAgent.id())
.toolsets(AgentToolsetArgs.builder()
.toolset(cesToolsetForAgent.id())
.toolIds("testtoolid")
.build())
.childAgents(Output.tuple(cesAppForAgent.project(), cesAppForAgent.appId(), cesChildAgent.agentId()).applyValue(values -> {
var project = values.t1;
var appId = values.t2;
var agentId = values.t3;
return String.format("projects/%s/locations/us/apps/%s/agents/%s", project,appId,agentId);
}))
.llmAgent(AgentLlmAgentArgs.builder()
.build())
.build());
}
}
resources:
cesAppForAgent:
type: gcp:ces:App
name: ces_app_for_agent
properties:
appId: app-id
location: us
description: App used as parent for CES Agent example
displayName: my-app
languageSettings:
defaultLanguageCode: en-US
supportedLanguageCodes:
- es-ES
- fr-FR
enableMultilingualSupport: true
fallbackAction: escalate
timeZoneSettings:
timeZone: America/Los_Angeles
cesToolForAgent:
type: gcp:ces:Tool
name: ces_tool_for_agent
properties:
location: us
app: ${cesAppForAgent.appId}
toolId: tool-1
executionType: SYNCHRONOUS
pythonFunction:
name: example_function
pythonCode: 'def example_function() -> int: return 0'
cesToolsetForAgent:
type: gcp:ces:Toolset
name: ces_toolset_for_agent
properties:
toolsetId: toolset-id
location: us
app: ${cesAppForAgent.appId}
displayName: Basic toolset display name
openApiToolset:
openApiSchema: |
openapi: 3.0.0
info:
title: My Sample API
version: 1.0.0
description: A simple API example
servers:
- url: https://api.example.com/v1
paths: {}
ignoreUnknownFields: false
tlsConfig:
caCerts:
- displayName: example
cert: ZXhhbXBsZQ==
serviceDirectoryConfig:
service: projects/example/locations/us/namespaces/namespace/services/service
apiAuthentication:
serviceAgentIdTokenAuthConfig: {}
cesChildAgent:
type: gcp:ces:Agent
name: ces_child_agent
properties:
agentId: child-agent-id
location: us
app: ${cesAppForAgent.appId}
displayName: child agent
instruction: You are a helpful assistant for this example.
modelSettings:
model: gemini-1.5-flash
temperature: 0.5
llmAgent: {}
cesGuardrailForAgent:
type: gcp:ces:Guardrail
name: ces_guardrail_for_agent
properties:
guardrailId: guardrail-id
location: ${cesAppForAgent.location}
app: ${cesAppForAgent.appId}
displayName: Example guardrail
description: Guardrail description
action:
respondImmediately:
responses:
- text: Text
disabled: false
enabled: true
modelSafety:
safetySettings:
- category: HARM_CATEGORY_HATE_SPEECH
threshold: BLOCK_NONE
cesAgentBasic:
type: gcp:ces:Agent
name: ces_agent_basic
properties:
agentId: agent-id
location: us
app: ${cesAppForAgent.appId}
displayName: my-agent
description: test agent
instruction: You are a helpful assistant for this example.
modelSettings:
model: gemini-1.5-flash
temperature: 0.5
afterAgentCallbacks:
- description: Example callback
disabled: true
pythonCode: |-
def callback(context):
return {'override': False}
beforeAgentCallbacks:
- description: Example callback
disabled: false
pythonCode: |-
def callback(context):
return {'override': False}
afterModelCallbacks:
- description: Example callback
disabled: true
pythonCode: |-
def callback(context):
return {'override': False}
beforeModelCallbacks:
- description: Example callback
disabled: true
pythonCode: |-
def callback(context):
return {'override': False}
afterToolCallbacks:
- description: Example callback
disabled: true
pythonCode: |-
def callback(context):
return {'override': False}
beforeToolCallbacks:
- description: Example callback
disabled: true
pythonCode: |-
def callback(context):
return {'override': False}
tools:
- ${cesToolForAgent.id}
guardrails:
- ${cesGuardrailForAgent.id}
toolsets:
- toolset: ${cesToolsetForAgent.id}
toolIds:
- testtoolid
childAgents:
- projects/${cesAppForAgent.project}/locations/us/apps/${cesAppForAgent.appId}/agents/${cesChildAgent.agentId}
llmAgent: {}
Ces Agent Remote Dialogflow Agent
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const cesAppForAgent = new gcp.ces.App("ces_app_for_agent", {
appId: "app-id",
location: "us",
description: "App used as parent for CES Agent example",
displayName: "my-app",
languageSettings: {
defaultLanguageCode: "en-US",
supportedLanguageCodes: [
"es-ES",
"fr-FR",
],
enableMultilingualSupport: true,
fallbackAction: "escalate",
},
timeZoneSettings: {
timeZone: "America/Los_Angeles",
},
});
const cesAgentRemoteDialogflowAgent = new gcp.ces.Agent("ces_agent_remote_dialogflow_agent", {
agentId: "agent-id",
location: "us",
app: cesAppForAgent.appId,
displayName: "my-agent",
modelSettings: {
model: "gemini-1.5-flash",
temperature: 0.5,
},
remoteDialogflowAgent: {
agent: "projects/example/locations/us/agents/fake-agent",
flowId: "fake-flow",
environmentId: "fake-env",
inputVariableMapping: {
example: "1",
},
outputVariableMapping: {
example: "1",
},
},
});
import pulumi
import pulumi_gcp as gcp
ces_app_for_agent = gcp.ces.App("ces_app_for_agent",
app_id="app-id",
location="us",
description="App used as parent for CES Agent example",
display_name="my-app",
language_settings={
"default_language_code": "en-US",
"supported_language_codes": [
"es-ES",
"fr-FR",
],
"enable_multilingual_support": True,
"fallback_action": "escalate",
},
time_zone_settings={
"time_zone": "America/Los_Angeles",
})
ces_agent_remote_dialogflow_agent = gcp.ces.Agent("ces_agent_remote_dialogflow_agent",
agent_id="agent-id",
location="us",
app=ces_app_for_agent.app_id,
display_name="my-agent",
model_settings={
"model": "gemini-1.5-flash",
"temperature": 0.5,
},
remote_dialogflow_agent={
"agent": "projects/example/locations/us/agents/fake-agent",
"flow_id": "fake-flow",
"environment_id": "fake-env",
"input_variable_mapping": {
"example": "1",
},
"output_variable_mapping": {
"example": "1",
},
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/ces"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cesAppForAgent, err := ces.NewApp(ctx, "ces_app_for_agent", &ces.AppArgs{
AppId: pulumi.String("app-id"),
Location: pulumi.String("us"),
Description: pulumi.String("App used as parent for CES Agent example"),
DisplayName: pulumi.String("my-app"),
LanguageSettings: &ces.AppLanguageSettingsArgs{
DefaultLanguageCode: pulumi.String("en-US"),
SupportedLanguageCodes: pulumi.StringArray{
pulumi.String("es-ES"),
pulumi.String("fr-FR"),
},
EnableMultilingualSupport: pulumi.Bool(true),
FallbackAction: pulumi.String("escalate"),
},
TimeZoneSettings: &ces.AppTimeZoneSettingsArgs{
TimeZone: pulumi.String("America/Los_Angeles"),
},
})
if err != nil {
return err
}
_, err = ces.NewAgent(ctx, "ces_agent_remote_dialogflow_agent", &ces.AgentArgs{
AgentId: pulumi.String("agent-id"),
Location: pulumi.String("us"),
App: cesAppForAgent.AppId,
DisplayName: pulumi.String("my-agent"),
ModelSettings: &ces.AgentModelSettingsArgs{
Model: pulumi.String("gemini-1.5-flash"),
Temperature: pulumi.Float64(0.5),
},
RemoteDialogflowAgent: &ces.AgentRemoteDialogflowAgentArgs{
Agent: pulumi.String("projects/example/locations/us/agents/fake-agent"),
FlowId: pulumi.String("fake-flow"),
EnvironmentId: pulumi.String("fake-env"),
InputVariableMapping: pulumi.StringMap{
"example": pulumi.String("1"),
},
OutputVariableMapping: pulumi.StringMap{
"example": pulumi.String("1"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var cesAppForAgent = new Gcp.Ces.App("ces_app_for_agent", new()
{
AppId = "app-id",
Location = "us",
Description = "App used as parent for CES Agent example",
DisplayName = "my-app",
LanguageSettings = new Gcp.Ces.Inputs.AppLanguageSettingsArgs
{
DefaultLanguageCode = "en-US",
SupportedLanguageCodes = new[]
{
"es-ES",
"fr-FR",
},
EnableMultilingualSupport = true,
FallbackAction = "escalate",
},
TimeZoneSettings = new Gcp.Ces.Inputs.AppTimeZoneSettingsArgs
{
TimeZone = "America/Los_Angeles",
},
});
var cesAgentRemoteDialogflowAgent = new Gcp.Ces.Agent("ces_agent_remote_dialogflow_agent", new()
{
AgentId = "agent-id",
Location = "us",
App = cesAppForAgent.AppId,
DisplayName = "my-agent",
ModelSettings = new Gcp.Ces.Inputs.AgentModelSettingsArgs
{
Model = "gemini-1.5-flash",
Temperature = 0.5,
},
RemoteDialogflowAgent = new Gcp.Ces.Inputs.AgentRemoteDialogflowAgentArgs
{
Agent = "projects/example/locations/us/agents/fake-agent",
FlowId = "fake-flow",
EnvironmentId = "fake-env",
InputVariableMapping =
{
{ "example", "1" },
},
OutputVariableMapping =
{
{ "example", "1" },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.ces.App;
import com.pulumi.gcp.ces.AppArgs;
import com.pulumi.gcp.ces.inputs.AppLanguageSettingsArgs;
import com.pulumi.gcp.ces.inputs.AppTimeZoneSettingsArgs;
import com.pulumi.gcp.ces.Agent;
import com.pulumi.gcp.ces.AgentArgs;
import com.pulumi.gcp.ces.inputs.AgentModelSettingsArgs;
import com.pulumi.gcp.ces.inputs.AgentRemoteDialogflowAgentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var cesAppForAgent = new App("cesAppForAgent", AppArgs.builder()
.appId("app-id")
.location("us")
.description("App used as parent for CES Agent example")
.displayName("my-app")
.languageSettings(AppLanguageSettingsArgs.builder()
.defaultLanguageCode("en-US")
.supportedLanguageCodes(
"es-ES",
"fr-FR")
.enableMultilingualSupport(true)
.fallbackAction("escalate")
.build())
.timeZoneSettings(AppTimeZoneSettingsArgs.builder()
.timeZone("America/Los_Angeles")
.build())
.build());
var cesAgentRemoteDialogflowAgent = new Agent("cesAgentRemoteDialogflowAgent", AgentArgs.builder()
.agentId("agent-id")
.location("us")
.app(cesAppForAgent.appId())
.displayName("my-agent")
.modelSettings(AgentModelSettingsArgs.builder()
.model("gemini-1.5-flash")
.temperature(0.5)
.build())
.remoteDialogflowAgent(AgentRemoteDialogflowAgentArgs.builder()
.agent("projects/example/locations/us/agents/fake-agent")
.flowId("fake-flow")
.environmentId("fake-env")
.inputVariableMapping(Map.of("example", "1"))
.outputVariableMapping(Map.of("example", "1"))
.build())
.build());
}
}
resources:
cesAppForAgent:
type: gcp:ces:App
name: ces_app_for_agent
properties:
appId: app-id
location: us
description: App used as parent for CES Agent example
displayName: my-app
languageSettings:
defaultLanguageCode: en-US
supportedLanguageCodes:
- es-ES
- fr-FR
enableMultilingualSupport: true
fallbackAction: escalate
timeZoneSettings:
timeZone: America/Los_Angeles
cesAgentRemoteDialogflowAgent:
type: gcp:ces:Agent
name: ces_agent_remote_dialogflow_agent
properties:
agentId: agent-id
location: us
app: ${cesAppForAgent.appId}
displayName: my-agent
modelSettings:
model: gemini-1.5-flash
temperature: 0.5
remoteDialogflowAgent:
agent: projects/example/locations/us/agents/fake-agent
flowId: fake-flow
environmentId: fake-env
inputVariableMapping:
example: 1
outputVariableMapping:
example: 1
Create Agent Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Agent(name: string, args: AgentArgs, opts?: CustomResourceOptions);@overload
def Agent(resource_name: str,
args: AgentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Agent(resource_name: str,
opts: Optional[ResourceOptions] = None,
app: Optional[str] = None,
location: Optional[str] = None,
display_name: Optional[str] = None,
before_agent_callbacks: Optional[Sequence[AgentBeforeAgentCallbackArgs]] = None,
instruction: Optional[str] = None,
after_agent_callbacks: Optional[Sequence[AgentAfterAgentCallbackArgs]] = None,
before_model_callbacks: Optional[Sequence[AgentBeforeModelCallbackArgs]] = None,
before_tool_callbacks: Optional[Sequence[AgentBeforeToolCallbackArgs]] = None,
child_agents: Optional[Sequence[str]] = None,
description: Optional[str] = None,
after_tool_callbacks: Optional[Sequence[AgentAfterToolCallbackArgs]] = None,
guardrails: Optional[Sequence[str]] = None,
agent_id: Optional[str] = None,
llm_agent: Optional[AgentLlmAgentArgs] = None,
after_model_callbacks: Optional[Sequence[AgentAfterModelCallbackArgs]] = None,
model_settings: Optional[AgentModelSettingsArgs] = None,
project: Optional[str] = None,
remote_dialogflow_agent: Optional[AgentRemoteDialogflowAgentArgs] = None,
tools: Optional[Sequence[str]] = None,
toolsets: Optional[Sequence[AgentToolsetArgs]] = None)func NewAgent(ctx *Context, name string, args AgentArgs, opts ...ResourceOption) (*Agent, error)public Agent(string name, AgentArgs args, CustomResourceOptions? opts = null)type: gcp:ces:Agent
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AgentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AgentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AgentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AgentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AgentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var agentResource = new Gcp.Ces.Agent("agentResource", new()
{
App = "string",
Location = "string",
DisplayName = "string",
BeforeAgentCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentBeforeAgentCallbackArgs
{
PythonCode = "string",
Description = "string",
Disabled = false,
},
},
Instruction = "string",
AfterAgentCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentAfterAgentCallbackArgs
{
PythonCode = "string",
Description = "string",
Disabled = false,
},
},
BeforeModelCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentBeforeModelCallbackArgs
{
PythonCode = "string",
Description = "string",
Disabled = false,
},
},
BeforeToolCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentBeforeToolCallbackArgs
{
PythonCode = "string",
Description = "string",
Disabled = false,
},
},
ChildAgents = new[]
{
"string",
},
Description = "string",
AfterToolCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentAfterToolCallbackArgs
{
PythonCode = "string",
Description = "string",
Disabled = false,
},
},
Guardrails = new[]
{
"string",
},
AgentId = "string",
LlmAgent = null,
AfterModelCallbacks = new[]
{
new Gcp.Ces.Inputs.AgentAfterModelCallbackArgs
{
PythonCode = "string",
Description = "string",
Disabled = false,
},
},
ModelSettings = new Gcp.Ces.Inputs.AgentModelSettingsArgs
{
Model = "string",
Temperature = 0,
},
Project = "string",
RemoteDialogflowAgent = new Gcp.Ces.Inputs.AgentRemoteDialogflowAgentArgs
{
Agent = "string",
FlowId = "string",
EnvironmentId = "string",
InputVariableMapping =
{
{ "string", "string" },
},
OutputVariableMapping =
{
{ "string", "string" },
},
},
Tools = new[]
{
"string",
},
Toolsets = new[]
{
new Gcp.Ces.Inputs.AgentToolsetArgs
{
Toolset = "string",
ToolIds = new[]
{
"string",
},
},
},
});
example, err := ces.NewAgent(ctx, "agentResource", &ces.AgentArgs{
App: pulumi.String("string"),
Location: pulumi.String("string"),
DisplayName: pulumi.String("string"),
BeforeAgentCallbacks: ces.AgentBeforeAgentCallbackArray{
&ces.AgentBeforeAgentCallbackArgs{
PythonCode: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
},
},
Instruction: pulumi.String("string"),
AfterAgentCallbacks: ces.AgentAfterAgentCallbackArray{
&ces.AgentAfterAgentCallbackArgs{
PythonCode: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
},
},
BeforeModelCallbacks: ces.AgentBeforeModelCallbackArray{
&ces.AgentBeforeModelCallbackArgs{
PythonCode: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
},
},
BeforeToolCallbacks: ces.AgentBeforeToolCallbackArray{
&ces.AgentBeforeToolCallbackArgs{
PythonCode: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
},
},
ChildAgents: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
AfterToolCallbacks: ces.AgentAfterToolCallbackArray{
&ces.AgentAfterToolCallbackArgs{
PythonCode: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
},
},
Guardrails: pulumi.StringArray{
pulumi.String("string"),
},
AgentId: pulumi.String("string"),
LlmAgent: &ces.AgentLlmAgentArgs{},
AfterModelCallbacks: ces.AgentAfterModelCallbackArray{
&ces.AgentAfterModelCallbackArgs{
PythonCode: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
},
},
ModelSettings: &ces.AgentModelSettingsArgs{
Model: pulumi.String("string"),
Temperature: pulumi.Float64(0),
},
Project: pulumi.String("string"),
RemoteDialogflowAgent: &ces.AgentRemoteDialogflowAgentArgs{
Agent: pulumi.String("string"),
FlowId: pulumi.String("string"),
EnvironmentId: pulumi.String("string"),
InputVariableMapping: pulumi.StringMap{
"string": pulumi.String("string"),
},
OutputVariableMapping: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
Tools: pulumi.StringArray{
pulumi.String("string"),
},
Toolsets: ces.AgentToolsetArray{
&ces.AgentToolsetArgs{
Toolset: pulumi.String("string"),
ToolIds: pulumi.StringArray{
pulumi.String("string"),
},
},
},
})
var agentResource = new com.pulumi.gcp.ces.Agent("agentResource", com.pulumi.gcp.ces.AgentArgs.builder()
.app("string")
.location("string")
.displayName("string")
.beforeAgentCallbacks(AgentBeforeAgentCallbackArgs.builder()
.pythonCode("string")
.description("string")
.disabled(false)
.build())
.instruction("string")
.afterAgentCallbacks(AgentAfterAgentCallbackArgs.builder()
.pythonCode("string")
.description("string")
.disabled(false)
.build())
.beforeModelCallbacks(AgentBeforeModelCallbackArgs.builder()
.pythonCode("string")
.description("string")
.disabled(false)
.build())
.beforeToolCallbacks(AgentBeforeToolCallbackArgs.builder()
.pythonCode("string")
.description("string")
.disabled(false)
.build())
.childAgents("string")
.description("string")
.afterToolCallbacks(AgentAfterToolCallbackArgs.builder()
.pythonCode("string")
.description("string")
.disabled(false)
.build())
.guardrails("string")
.agentId("string")
.llmAgent(AgentLlmAgentArgs.builder()
.build())
.afterModelCallbacks(AgentAfterModelCallbackArgs.builder()
.pythonCode("string")
.description("string")
.disabled(false)
.build())
.modelSettings(AgentModelSettingsArgs.builder()
.model("string")
.temperature(0.0)
.build())
.project("string")
.remoteDialogflowAgent(AgentRemoteDialogflowAgentArgs.builder()
.agent("string")
.flowId("string")
.environmentId("string")
.inputVariableMapping(Map.of("string", "string"))
.outputVariableMapping(Map.of("string", "string"))
.build())
.tools("string")
.toolsets(AgentToolsetArgs.builder()
.toolset("string")
.toolIds("string")
.build())
.build());
agent_resource = gcp.ces.Agent("agentResource",
app="string",
location="string",
display_name="string",
before_agent_callbacks=[{
"python_code": "string",
"description": "string",
"disabled": False,
}],
instruction="string",
after_agent_callbacks=[{
"python_code": "string",
"description": "string",
"disabled": False,
}],
before_model_callbacks=[{
"python_code": "string",
"description": "string",
"disabled": False,
}],
before_tool_callbacks=[{
"python_code": "string",
"description": "string",
"disabled": False,
}],
child_agents=["string"],
description="string",
after_tool_callbacks=[{
"python_code": "string",
"description": "string",
"disabled": False,
}],
guardrails=["string"],
agent_id="string",
llm_agent={},
after_model_callbacks=[{
"python_code": "string",
"description": "string",
"disabled": False,
}],
model_settings={
"model": "string",
"temperature": 0,
},
project="string",
remote_dialogflow_agent={
"agent": "string",
"flow_id": "string",
"environment_id": "string",
"input_variable_mapping": {
"string": "string",
},
"output_variable_mapping": {
"string": "string",
},
},
tools=["string"],
toolsets=[{
"toolset": "string",
"tool_ids": ["string"],
}])
const agentResource = new gcp.ces.Agent("agentResource", {
app: "string",
location: "string",
displayName: "string",
beforeAgentCallbacks: [{
pythonCode: "string",
description: "string",
disabled: false,
}],
instruction: "string",
afterAgentCallbacks: [{
pythonCode: "string",
description: "string",
disabled: false,
}],
beforeModelCallbacks: [{
pythonCode: "string",
description: "string",
disabled: false,
}],
beforeToolCallbacks: [{
pythonCode: "string",
description: "string",
disabled: false,
}],
childAgents: ["string"],
description: "string",
afterToolCallbacks: [{
pythonCode: "string",
description: "string",
disabled: false,
}],
guardrails: ["string"],
agentId: "string",
llmAgent: {},
afterModelCallbacks: [{
pythonCode: "string",
description: "string",
disabled: false,
}],
modelSettings: {
model: "string",
temperature: 0,
},
project: "string",
remoteDialogflowAgent: {
agent: "string",
flowId: "string",
environmentId: "string",
inputVariableMapping: {
string: "string",
},
outputVariableMapping: {
string: "string",
},
},
tools: ["string"],
toolsets: [{
toolset: "string",
toolIds: ["string"],
}],
});
type: gcp:ces:Agent
properties:
afterAgentCallbacks:
- description: string
disabled: false
pythonCode: string
afterModelCallbacks:
- description: string
disabled: false
pythonCode: string
afterToolCallbacks:
- description: string
disabled: false
pythonCode: string
agentId: string
app: string
beforeAgentCallbacks:
- description: string
disabled: false
pythonCode: string
beforeModelCallbacks:
- description: string
disabled: false
pythonCode: string
beforeToolCallbacks:
- description: string
disabled: false
pythonCode: string
childAgents:
- string
description: string
displayName: string
guardrails:
- string
instruction: string
llmAgent: {}
location: string
modelSettings:
model: string
temperature: 0
project: string
remoteDialogflowAgent:
agent: string
environmentId: string
flowId: string
inputVariableMapping:
string: string
outputVariableMapping:
string: string
tools:
- string
toolsets:
- toolIds:
- string
toolset: string
Agent Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Agent resource accepts the following input properties:
- App string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - Display
Name string - Display name of the agent.
- Location string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - After
Agent List<AgentCallbacks After Agent Callback> - 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. Structure is documented below.
- After
Model List<AgentCallbacks After Model Callback> - 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. Structure is documented below.
- After
Tool List<AgentCallbacks After Tool Callback> - 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. Structure is documented below.
- Agent
Id string - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- Before
Agent List<AgentCallbacks Before Agent Callback> - 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. Structure is documented below.
- Before
Model List<AgentCallbacks Before Model Callback> - 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. Structure is documented below.
- Before
Tool List<AgentCallbacks Before Tool Callback> - 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. Structure is documented below.
- Child
Agents List<string> - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Description string
- Human-readable description of the agent.
- Guardrails List<string>
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - Instruction string
- Instructions for the LLM model to guide the agent's behavior.
- Llm
Agent AgentLlm Agent - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- Model
Settings AgentModel Settings - Model settings contains various configurations for the LLM model. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remote
Dialogflow AgentAgent Remote Dialogflow Agent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- Tools List<string>
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - Toolsets
List<Agent
Toolset> - List of toolsets for the agent. Structure is documented below.
- App string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - Display
Name string - Display name of the agent.
- Location string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - After
Agent []AgentCallbacks After Agent Callback Args - 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. Structure is documented below.
- After
Model []AgentCallbacks After Model Callback Args - 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. Structure is documented below.
- After
Tool []AgentCallbacks After Tool Callback Args - 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. Structure is documented below.
- Agent
Id string - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- Before
Agent []AgentCallbacks Before Agent Callback Args - 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. Structure is documented below.
- Before
Model []AgentCallbacks Before Model Callback Args - 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. Structure is documented below.
- Before
Tool []AgentCallbacks Before Tool Callback Args - 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. Structure is documented below.
- Child
Agents []string - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Description string
- Human-readable description of the agent.
- Guardrails []string
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - Instruction string
- Instructions for the LLM model to guide the agent's behavior.
- Llm
Agent AgentLlm Agent Args - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- Model
Settings AgentModel Settings Args - Model settings contains various configurations for the LLM model. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remote
Dialogflow AgentAgent Remote Dialogflow Agent Args - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- Tools []string
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - Toolsets
[]Agent
Toolset Args - List of toolsets for the agent. Structure is documented below.
- app String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - display
Name String - Display name of the agent.
- location String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - after
Agent List<AgentCallbacks After Agent Callback> - 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. Structure is documented below.
- after
Model List<AgentCallbacks After Model Callback> - 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. Structure is documented below.
- after
Tool List<AgentCallbacks After Tool Callback> - 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. Structure is documented below.
- agent
Id String - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- before
Agent List<AgentCallbacks Before Agent Callback> - 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. Structure is documented below.
- before
Model List<AgentCallbacks Before Model Callback> - 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. Structure is documented below.
- before
Tool List<AgentCallbacks Before Tool Callback> - 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. Structure is documented below.
- child
Agents List<String> - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - description String
- Human-readable description of the agent.
- guardrails List<String>
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction String
- Instructions for the LLM model to guide the agent's behavior.
- llm
Agent AgentLlm Agent - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- model
Settings AgentModel Settings - Model settings contains various configurations for the LLM model. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote
Dialogflow AgentAgent Remote Dialogflow Agent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools List<String>
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets
List<Agent
Toolset> - List of toolsets for the agent. Structure is documented below.
- app string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - display
Name string - Display name of the agent.
- location string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - after
Agent AgentCallbacks After Agent Callback[] - 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. Structure is documented below.
- after
Model AgentCallbacks After Model Callback[] - 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. Structure is documented below.
- after
Tool AgentCallbacks After Tool Callback[] - 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. Structure is documented below.
- agent
Id string - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- before
Agent AgentCallbacks Before Agent Callback[] - 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. Structure is documented below.
- before
Model AgentCallbacks Before Model Callback[] - 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. Structure is documented below.
- before
Tool AgentCallbacks Before Tool Callback[] - 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. Structure is documented below.
- child
Agents string[] - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - description string
- Human-readable description of the agent.
- guardrails string[]
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction string
- Instructions for the LLM model to guide the agent's behavior.
- llm
Agent AgentLlm Agent - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- model
Settings AgentModel Settings - Model settings contains various configurations for the LLM model. Structure is documented below.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote
Dialogflow AgentAgent Remote Dialogflow Agent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools string[]
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets
Agent
Toolset[] - List of toolsets for the agent. Structure is documented below.
- app str
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - display_
name str - Display name of the agent.
- location str
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - after_
agent_ Sequence[Agentcallbacks After Agent Callback Args] - 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. Structure is documented below.
- after_
model_ Sequence[Agentcallbacks After Model Callback Args] - 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. Structure is documented below.
- after_
tool_ Sequence[Agentcallbacks After Tool Callback Args] - 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. Structure is documented below.
- agent_
id str - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- before_
agent_ Sequence[Agentcallbacks Before Agent Callback Args] - 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. Structure is documented below.
- before_
model_ Sequence[Agentcallbacks Before Model Callback Args] - 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. Structure is documented below.
- before_
tool_ Sequence[Agentcallbacks Before Tool Callback Args] - 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. Structure is documented below.
- child_
agents Sequence[str] - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - description str
- Human-readable description of the agent.
- guardrails Sequence[str]
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction str
- Instructions for the LLM model to guide the agent's behavior.
- llm_
agent AgentLlm Agent Args - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- model_
settings AgentModel Settings Args - Model settings contains various configurations for the LLM model. Structure is documented below.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote_
dialogflow_ Agentagent Remote Dialogflow Agent Args - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools Sequence[str]
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets
Sequence[Agent
Toolset Args] - List of toolsets for the agent. Structure is documented below.
- app String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - display
Name String - Display name of the agent.
- location String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - after
Agent List<Property Map>Callbacks - 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. Structure is documented below.
- after
Model List<Property Map>Callbacks - 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. Structure is documented below.
- after
Tool List<Property Map>Callbacks - 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. Structure is documented below.
- agent
Id String - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- before
Agent List<Property Map>Callbacks - 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. Structure is documented below.
- before
Model List<Property Map>Callbacks - 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. Structure is documented below.
- before
Tool List<Property Map>Callbacks - 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. Structure is documented below.
- child
Agents List<String> - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - description String
- Human-readable description of the agent.
- guardrails List<String>
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction String
- Instructions for the LLM model to guide the agent's behavior.
- llm
Agent Property Map - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- model
Settings Property Map - Model settings contains various configurations for the LLM model. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote
Dialogflow Property MapAgent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools List<String>
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets List<Property Map>
- List of toolsets for the agent. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Agent resource produces the following output properties:
- Create
Time string - Timestamp when the agent was created.
- Etag string
- 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.
- Generated
Summary string - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Update
Time string - Timestamp when the agent was last updated.
- Create
Time string - Timestamp when the agent was created.
- Etag string
- 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.
- Generated
Summary string - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Update
Time string - Timestamp when the agent was last updated.
- create
Time String - Timestamp when the agent was created.
- etag String
- 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.
- generated
Summary String - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - update
Time String - Timestamp when the agent was last updated.
- create
Time string - Timestamp when the agent was created.
- etag string
- 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.
- generated
Summary string - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - update
Time string - Timestamp when the agent was last updated.
- create_
time str - Timestamp when the agent was created.
- etag str
- 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.
- generated_
summary str - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - update_
time str - Timestamp when the agent was last updated.
- create
Time String - Timestamp when the agent was created.
- etag String
- 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.
- generated
Summary String - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - update
Time String - Timestamp when the agent was last updated.
Look up Existing Agent Resource
Get an existing Agent resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AgentState, opts?: CustomResourceOptions): Agent@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
after_agent_callbacks: Optional[Sequence[AgentAfterAgentCallbackArgs]] = None,
after_model_callbacks: Optional[Sequence[AgentAfterModelCallbackArgs]] = None,
after_tool_callbacks: Optional[Sequence[AgentAfterToolCallbackArgs]] = None,
agent_id: Optional[str] = None,
app: Optional[str] = None,
before_agent_callbacks: Optional[Sequence[AgentBeforeAgentCallbackArgs]] = None,
before_model_callbacks: Optional[Sequence[AgentBeforeModelCallbackArgs]] = None,
before_tool_callbacks: Optional[Sequence[AgentBeforeToolCallbackArgs]] = None,
child_agents: Optional[Sequence[str]] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
etag: Optional[str] = None,
generated_summary: Optional[str] = None,
guardrails: Optional[Sequence[str]] = None,
instruction: Optional[str] = None,
llm_agent: Optional[AgentLlmAgentArgs] = None,
location: Optional[str] = None,
model_settings: Optional[AgentModelSettingsArgs] = None,
name: Optional[str] = None,
project: Optional[str] = None,
remote_dialogflow_agent: Optional[AgentRemoteDialogflowAgentArgs] = None,
tools: Optional[Sequence[str]] = None,
toolsets: Optional[Sequence[AgentToolsetArgs]] = None,
update_time: Optional[str] = None) -> Agentfunc GetAgent(ctx *Context, name string, id IDInput, state *AgentState, opts ...ResourceOption) (*Agent, error)public static Agent Get(string name, Input<string> id, AgentState? state, CustomResourceOptions? opts = null)public static Agent get(String name, Output<String> id, AgentState state, CustomResourceOptions options)resources: _: type: gcp:ces:Agent get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- After
Agent List<AgentCallbacks After Agent Callback> - 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. Structure is documented below.
- After
Model List<AgentCallbacks After Model Callback> - 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. Structure is documented below.
- After
Tool List<AgentCallbacks After Tool Callback> - 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. Structure is documented below.
- Agent
Id string - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- App string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - Before
Agent List<AgentCallbacks Before Agent Callback> - 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. Structure is documented below.
- Before
Model List<AgentCallbacks Before Model Callback> - 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. Structure is documented below.
- Before
Tool List<AgentCallbacks Before Tool Callback> - 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. Structure is documented below.
- Child
Agents List<string> - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Create
Time string - Timestamp when the agent was created.
- Description string
- Human-readable description of the agent.
- Display
Name string - Display name of the agent.
- Etag string
- 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.
- Generated
Summary string - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- Guardrails List<string>
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - Instruction string
- Instructions for the LLM model to guide the agent's behavior.
- Llm
Agent AgentLlm Agent - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- Location string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - Model
Settings AgentModel Settings - Model settings contains various configurations for the LLM model. Structure is documented below.
- Name string
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remote
Dialogflow AgentAgent Remote Dialogflow Agent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- Tools List<string>
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - Toolsets
List<Agent
Toolset> - List of toolsets for the agent. Structure is documented below.
- Update
Time string - Timestamp when the agent was last updated.
- After
Agent []AgentCallbacks After Agent Callback Args - 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. Structure is documented below.
- After
Model []AgentCallbacks After Model Callback Args - 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. Structure is documented below.
- After
Tool []AgentCallbacks After Tool Callback Args - 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. Structure is documented below.
- Agent
Id string - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- App string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - Before
Agent []AgentCallbacks Before Agent Callback Args - 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. Structure is documented below.
- Before
Model []AgentCallbacks Before Model Callback Args - 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. Structure is documented below.
- Before
Tool []AgentCallbacks Before Tool Callback Args - 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. Structure is documented below.
- Child
Agents []string - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Create
Time string - Timestamp when the agent was created.
- Description string
- Human-readable description of the agent.
- Display
Name string - Display name of the agent.
- Etag string
- 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.
- Generated
Summary string - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- Guardrails []string
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - Instruction string
- Instructions for the LLM model to guide the agent's behavior.
- Llm
Agent AgentLlm Agent Args - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- Location string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - Model
Settings AgentModel Settings Args - Model settings contains various configurations for the LLM model. Structure is documented below.
- Name string
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Remote
Dialogflow AgentAgent Remote Dialogflow Agent Args - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- Tools []string
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - Toolsets
[]Agent
Toolset Args - List of toolsets for the agent. Structure is documented below.
- Update
Time string - Timestamp when the agent was last updated.
- after
Agent List<AgentCallbacks After Agent Callback> - 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. Structure is documented below.
- after
Model List<AgentCallbacks After Model Callback> - 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. Structure is documented below.
- after
Tool List<AgentCallbacks After Tool Callback> - 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. Structure is documented below.
- agent
Id String - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- app String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - before
Agent List<AgentCallbacks Before Agent Callback> - 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. Structure is documented below.
- before
Model List<AgentCallbacks Before Model Callback> - 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. Structure is documented below.
- before
Tool List<AgentCallbacks Before Tool Callback> - 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. Structure is documented below.
- child
Agents List<String> - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - create
Time String - Timestamp when the agent was created.
- description String
- Human-readable description of the agent.
- display
Name String - Display name of the agent.
- etag String
- 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.
- generated
Summary String - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- guardrails List<String>
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction String
- Instructions for the LLM model to guide the agent's behavior.
- llm
Agent AgentLlm Agent - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- location String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - model
Settings AgentModel Settings - Model settings contains various configurations for the LLM model. Structure is documented below.
- name String
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote
Dialogflow AgentAgent Remote Dialogflow Agent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools List<String>
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets
List<Agent
Toolset> - List of toolsets for the agent. Structure is documented below.
- update
Time String - Timestamp when the agent was last updated.
- after
Agent AgentCallbacks After Agent Callback[] - 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. Structure is documented below.
- after
Model AgentCallbacks After Model Callback[] - 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. Structure is documented below.
- after
Tool AgentCallbacks After Tool Callback[] - 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. Structure is documented below.
- agent
Id string - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- app string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - before
Agent AgentCallbacks Before Agent Callback[] - 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. Structure is documented below.
- before
Model AgentCallbacks Before Model Callback[] - 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. Structure is documented below.
- before
Tool AgentCallbacks Before Tool Callback[] - 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. Structure is documented below.
- child
Agents string[] - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - create
Time string - Timestamp when the agent was created.
- description string
- Human-readable description of the agent.
- display
Name string - Display name of the agent.
- etag string
- 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.
- generated
Summary string - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- guardrails string[]
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction string
- Instructions for the LLM model to guide the agent's behavior.
- llm
Agent AgentLlm Agent - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- location string
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - model
Settings AgentModel Settings - Model settings contains various configurations for the LLM model. Structure is documented below.
- name string
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote
Dialogflow AgentAgent Remote Dialogflow Agent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools string[]
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets
Agent
Toolset[] - List of toolsets for the agent. Structure is documented below.
- update
Time string - Timestamp when the agent was last updated.
- after_
agent_ Sequence[Agentcallbacks After Agent Callback Args] - 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. Structure is documented below.
- after_
model_ Sequence[Agentcallbacks After Model Callback Args] - 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. Structure is documented below.
- after_
tool_ Sequence[Agentcallbacks After Tool Callback Args] - 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. Structure is documented below.
- agent_
id str - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- app str
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - before_
agent_ Sequence[Agentcallbacks Before Agent Callback Args] - 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. Structure is documented below.
- before_
model_ Sequence[Agentcallbacks Before Model Callback Args] - 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. Structure is documented below.
- before_
tool_ Sequence[Agentcallbacks Before Tool Callback Args] - 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. Structure is documented below.
- child_
agents Sequence[str] - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - create_
time str - Timestamp when the agent was created.
- description str
- Human-readable description of the agent.
- display_
name str - Display name of the agent.
- etag str
- 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.
- generated_
summary str - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- guardrails Sequence[str]
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction str
- Instructions for the LLM model to guide the agent's behavior.
- llm_
agent AgentLlm Agent Args - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- location str
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - model_
settings AgentModel Settings Args - Model settings contains various configurations for the LLM model. Structure is documented below.
- name str
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote_
dialogflow_ Agentagent Remote Dialogflow Agent Args - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools Sequence[str]
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets
Sequence[Agent
Toolset Args] - List of toolsets for the agent. Structure is documented below.
- update_
time str - Timestamp when the agent was last updated.
- after
Agent List<Property Map>Callbacks - 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. Structure is documented below.
- after
Model List<Property Map>Callbacks - 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. Structure is documented below.
- after
Tool List<Property Map>Callbacks - 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. Structure is documented below.
- agent
Id String - The ID to use for the agent, which will become the final component of the agent's resource name. If not provided, a unique ID will be automatically assigned for the agent.
- app String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - before
Agent List<Property Map>Callbacks - 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. Structure is documented below.
- before
Model List<Property Map>Callbacks - 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. Structure is documented below.
- before
Tool List<Property Map>Callbacks - 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. Structure is documented below.
- child
Agents List<String> - List of child agents in the agent tree.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - create
Time String - Timestamp when the agent was created.
- description String
- Human-readable description of the agent.
- display
Name String - Display name of the agent.
- etag String
- 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.
- generated
Summary String - If the agent is generated by the LLM assistant, this field contains a descriptive summary of the generation.
- guardrails List<String>
- List of guardrails for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail} - instruction String
- Instructions for the LLM model to guide the agent's behavior.
- llm
Agent Property Map - Default agent type. The agent uses instructions and callbacks specified in the agent to perform the task using a large language model.
- location String
- Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - model
Settings Property Map - Model settings contains various configurations for the LLM model. Structure is documented below.
- name String
- Identifier. The unique identifier of the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/agents/{agent} - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- remote
Dialogflow Property MapAgent - The agent which will transfer execution to an existing remote Dialogflow agent flow. The corresponding 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. Structure is documented below.
- tools List<String>
- List of available tools for the agent.
Format:
projects/{project}/locations/{location}/apps/{app}/tools/{tool} - toolsets List<Property Map>
- List of toolsets for the agent. Structure is documented below.
- update
Time String - Timestamp when the agent was last updated.
Supporting Types
AgentAfterAgentCallback, AgentAfterAgentCallbackArgs
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code string - The python code to execute for the callback.
- description string
- Human-readable description of the callback.
- disabled boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python_
code str - The python code to execute for the callback.
- description str
- Human-readable description of the callback.
- disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
AgentAfterModelCallback, AgentAfterModelCallbackArgs
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code string - The python code to execute for the callback.
- description string
- Human-readable description of the callback.
- disabled boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python_
code str - The python code to execute for the callback.
- description str
- Human-readable description of the callback.
- disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
AgentAfterToolCallback, AgentAfterToolCallbackArgs
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code string - The python code to execute for the callback.
- description string
- Human-readable description of the callback.
- disabled boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python_
code str - The python code to execute for the callback.
- description str
- Human-readable description of the callback.
- disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
AgentBeforeAgentCallback, AgentBeforeAgentCallbackArgs
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code string - The python code to execute for the callback.
- description string
- Human-readable description of the callback.
- disabled boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python_
code str - The python code to execute for the callback.
- description str
- Human-readable description of the callback.
- disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
AgentBeforeModelCallback, AgentBeforeModelCallbackArgs
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code string - The python code to execute for the callback.
- description string
- Human-readable description of the callback.
- disabled boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python_
code str - The python code to execute for the callback.
- description str
- Human-readable description of the callback.
- disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
AgentBeforeToolCallback, AgentBeforeToolCallbackArgs
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- Python
Code string - The python code to execute for the callback.
- Description string
- Human-readable description of the callback.
- Disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code string - The python code to execute for the callback.
- description string
- Human-readable description of the callback.
- disabled boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python_
code str - The python code to execute for the callback.
- description str
- Human-readable description of the callback.
- disabled bool
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
- python
Code String - The python code to execute for the callback.
- description String
- Human-readable description of the callback.
- disabled Boolean
- Whether the callback is disabled. Disabled callbacks are ignored by the agent.
AgentModelSettings, AgentModelSettingsArgs
- Model string
- The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
- Temperature double
- If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
- Model string
- The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
- Temperature float64
- If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
- model String
- The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
- temperature Double
- If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
- model string
- The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
- temperature number
- If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
- model str
- The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
- temperature float
- If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
- model String
- The LLM model that the agent should use. If not set, the agent will inherit the model from its parent agent.
- temperature Number
- If set, this temperature will be used for the LLM model. Temperature controls the randomness of the model's responses. Lower temperatures produce responses that are more predictable. Higher temperatures produce responses that are more creative.
AgentRemoteDialogflowAgent, AgentRemoteDialogflowAgentArgs
- Agent string
- The
[Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents
agent resource name.
Format:
projects/{project}/locations/{location}/agents/{agent} - Flow
Id string - The flow ID of the flow in the Dialogflow agent.
- Environment
Id string - The environment ID of the Dialogflow agent be used for the agent execution. If not specified, the draft environment will be used.
- Input
Variable Dictionary<string, string>Mapping - The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
- Output
Variable Dictionary<string, string>Mapping - The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
- Agent string
- The
[Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents
agent resource name.
Format:
projects/{project}/locations/{location}/agents/{agent} - Flow
Id string - The flow ID of the flow in the Dialogflow agent.
- Environment
Id string - The environment ID of the Dialogflow agent be used for the agent execution. If not specified, the draft environment will be used.
- Input
Variable map[string]stringMapping - The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
- Output
Variable map[string]stringMapping - The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
- agent String
- The
[Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents
agent resource name.
Format:
projects/{project}/locations/{location}/agents/{agent} - flow
Id String - The flow ID of the flow in the Dialogflow agent.
- environment
Id String - The environment ID of the Dialogflow agent be used for the agent execution. If not specified, the draft environment will be used.
- input
Variable Map<String,String>Mapping - The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
- output
Variable Map<String,String>Mapping - The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
- agent string
- The
[Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents
agent resource name.
Format:
projects/{project}/locations/{location}/agents/{agent} - flow
Id string - The flow ID of the flow in the Dialogflow agent.
- environment
Id string - The environment ID of the Dialogflow agent be used for the agent execution. If not specified, the draft environment will be used.
- input
Variable {[key: string]: string}Mapping - The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
- output
Variable {[key: string]: string}Mapping - The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
- agent str
- The
[Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents
agent resource name.
Format:
projects/{project}/locations/{location}/agents/{agent} - flow_
id str - The flow ID of the flow in the Dialogflow agent.
- environment_
id str - The environment ID of the Dialogflow agent be used for the agent execution. If not specified, the draft environment will be used.
- input_
variable_ Mapping[str, str]mapping - The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
- output_
variable_ Mapping[str, str]mapping - The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
- agent String
- The
[Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents
agent resource name.
Format:
projects/{project}/locations/{location}/agents/{agent} - flow
Id String - The flow ID of the flow in the Dialogflow agent.
- environment
Id String - The environment ID of the Dialogflow agent be used for the agent execution. If not specified, the draft environment will be used.
- input
Variable Map<String>Mapping - The mapping of the app variables names to the Dialogflow session parameters names to be sent to the Dialogflow agent as input.
- output
Variable Map<String>Mapping - The mapping of the Dialogflow session parameters names to the app variables names to be sent back to the CES agent after the Dialogflow agent execution ends.
AgentToolset, AgentToolsetArgs
Import
Agent can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/apps/{{app}}/agents/{{name}}{{project}}/{{location}}/{{app}}/{{name}}{{location}}/{{app}}/{{name}}
When using the pulumi import command, Agent can be imported using one of the formats above. For example:
$ pulumi import gcp:ces/agent:Agent default projects/{{project}}/locations/{{location}}/apps/{{app}}/agents/{{name}}
$ pulumi import gcp:ces/agent:Agent default {{project}}/{{location}}/{{app}}/{{name}}
$ pulumi import gcp:ces/agent:Agent default {{location}}/{{app}}/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
