Skip to content

Commit ddc4001

Browse files
Google APIscopybara-github
authored andcommitted
feat: update public libraries for CES v1beta
feat: add support for generating app resources with LLM feat: deprecate `root_agent` in message `.google.cloud.ces.v1beta.AgentTool` in favor of new `agent` field. docs: A comment for field `root_agent` in message `.google.cloud.ces.v1beta.AgentTool` is changed PiperOrigin-RevId: 892390364
1 parent 627e843 commit ddc4001

File tree

5 files changed

+325
-3
lines changed

5 files changed

+325
-3
lines changed

google/cloud/ces/v1beta/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ proto_library(
4545
"evaluation_service.proto",
4646
"example.proto",
4747
"fakes.proto",
48+
"file_context.proto",
4849
"file_search_tool.proto",
4950
"golden_run.proto",
5051
"google_search_tool.proto",
@@ -390,7 +391,6 @@ load(
390391

391392
csharp_proto_library(
392393
name = "ces_csharp_proto",
393-
extra_opts = [],
394394
deps = [":ces_proto"],
395395
)
396396

google/cloud/ces/v1beta/agent_service.proto

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import "google/cloud/ces/v1beta/conversation.proto";
2828
import "google/cloud/ces/v1beta/deployment.proto";
2929
import "google/cloud/ces/v1beta/evaluation.proto";
3030
import "google/cloud/ces/v1beta/example.proto";
31+
import "google/cloud/ces/v1beta/file_context.proto";
3132
import "google/cloud/ces/v1beta/guardrail.proto";
3233
import "google/cloud/ces/v1beta/security_settings.proto";
3334
import "google/cloud/ces/v1beta/tool.proto";
@@ -36,6 +37,7 @@ import "google/longrunning/operations.proto";
3637
import "google/protobuf/empty.proto";
3738
import "google/protobuf/field_mask.proto";
3839
import "google/protobuf/timestamp.proto";
40+
import "google/rpc/status.proto";
3941

4042
option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb";
4143
option java_multiple_files = true;
@@ -502,6 +504,20 @@ service AgentService {
502504
};
503505
}
504506

507+
// Generates specific resources (e.g. agent) in the app using LLM assistant.
508+
rpc GenerateAppResource(GenerateAppResourceRequest)
509+
returns (google.longrunning.Operation) {
510+
option (google.api.http) = {
511+
post: "/v1beta/{parent=projects/*/locations/*/apps/*}:generateAppResource"
512+
body: "*"
513+
};
514+
option (google.api.method_signature) = "parent";
515+
option (google.longrunning.operation_info) = {
516+
response_type: "GenerateAppResourceResponse"
517+
metadata_type: "GenerateAppResourceOperationMetadata"
518+
};
519+
}
520+
505521
// Lists the changelogs of the specified app.
506522
rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) {
507523
option (google.api.http) = {
@@ -1657,6 +1673,194 @@ message RestoreAppVersionRequest {
16571673
// [AgentService.RestoreAppVersion][google.cloud.ces.v1beta.AgentService.RestoreAppVersion]
16581674
message RestoreAppVersionResponse {}
16591675

1676+
// Request message for
1677+
// [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource].
1678+
message GenerateAppResourceRequest {
1679+
// The instructions to be used to refine a part of the resource. The part of
1680+
// the resource can be specified with a start index, end index and a field
1681+
// mask. For example, if you want to refine a part of the agent instructions
1682+
// you can specify the index of the first character of the instructions, the
1683+
// index of the last character of the instructions and the field mask as
1684+
// "instructions".
1685+
message RefineInstructions {
1686+
// Required. The first character (inclusive) of the text to refine.
1687+
int64 start_index = 1 [(google.api.field_behavior) = REQUIRED];
1688+
1689+
// Required. The last character (inclusive) of the text to refine.
1690+
int64 end_index = 2 [(google.api.field_behavior) = REQUIRED];
1691+
1692+
// Required. The field of the resource being refined. Only one field is
1693+
// allowed per RefineInstructions. If refining agent instructions, the field
1694+
// mask should be "instructions".
1695+
google.protobuf.FieldMask field_mask = 3
1696+
[(google.api.field_behavior) = REQUIRED];
1697+
1698+
// Required. The instructions to refine the resource.
1699+
string instructions = 4 [(google.api.field_behavior) = REQUIRED];
1700+
}
1701+
1702+
// The configuration to be used to generate a tool.
1703+
message ToolGenerationConfig {
1704+
// The configuration to be used to generate an Open API schema.
1705+
message OpenApiToolsetGenerationConfig {
1706+
// The configuration to be used to generate an operation in the Open API
1707+
// schema.
1708+
message OperationGenerationConfig {
1709+
// Required. The uri of the tool. This should include query and path
1710+
// parameters if any.
1711+
string method = 1 [(google.api.field_behavior) = REQUIRED];
1712+
1713+
// Required. The path of the tool to be appended to the base uri. This
1714+
// should include query and path parameters if any.
1715+
string path = 2 [(google.api.field_behavior) = REQUIRED];
1716+
1717+
// Required. A sample request to the tool in JSON format. Skip if the
1718+
// tool does not support request body.
1719+
string request_json = 3 [(google.api.field_behavior) = REQUIRED];
1720+
1721+
// Required. A sample response from the tool in JSON format.
1722+
string response_json = 4 [(google.api.field_behavior) = REQUIRED];
1723+
}
1724+
1725+
// Required. The base uri of the tool.
1726+
string uri = 1 [(google.api.field_behavior) = REQUIRED];
1727+
1728+
// Required. The list of operations to be added to the Open API schema.
1729+
repeated OperationGenerationConfig operation_generation_configs = 2
1730+
[(google.api.field_behavior) = REQUIRED];
1731+
}
1732+
1733+
// Optional. The context which describes the tool to be generated. This can
1734+
// be empty if the tool request & response are provided.
1735+
string context = 1 [(google.api.field_behavior) = OPTIONAL];
1736+
1737+
// Optional. The files to be used as context.
1738+
repeated FileContext file_contexts = 3
1739+
[(google.api.field_behavior) = OPTIONAL];
1740+
1741+
// Optional. The configuration to be used to generate an Open API schema.
1742+
OpenApiToolsetGenerationConfig open_api_toolset_generation_config = 2
1743+
[(google.api.field_behavior) = OPTIONAL];
1744+
}
1745+
1746+
// The configuration to be used to generate the app.
1747+
message AppGenerationConfig {
1748+
// Optional. The context which describes the requirements of the agents &
1749+
// tools to be generated.
1750+
string context = 1 [(google.api.field_behavior) = OPTIONAL];
1751+
1752+
// Optional. The files to be used as context.
1753+
repeated FileContext file_contexts = 2
1754+
[(google.api.field_behavior) = OPTIONAL];
1755+
1756+
// Optional. The insights dataset to be used to fetch conversation data for
1757+
// generating the agents & tools.
1758+
// Format:
1759+
// `projects/{project}/locations/{location}/datasets/{dataset}`.
1760+
string dataset_id = 3 [
1761+
(google.api.field_behavior) = OPTIONAL,
1762+
(google.api.resource_reference) = {
1763+
type: "contactcenterinsights.googleapis.com/Dataset"
1764+
}
1765+
];
1766+
1767+
// Optional. Whether to generate the evaluations for the app. If true, the
1768+
// provided context will be used to generate the evaluations data.
1769+
bool generate_evaluations = 4 [(google.api.field_behavior) = OPTIONAL];
1770+
1771+
// Optional. The Cloud Storage location to store the generated question
1772+
// answer data to be used by the Datastore tool. This data is generated only
1773+
// when using conversation data as an input source. The location must be
1774+
// in the same project as the app.
1775+
// Format: `gs://...`.
1776+
string gcs_location = 5 [(google.api.field_behavior) = OPTIONAL];
1777+
}
1778+
1779+
// The configuration to be used to generate the evaluations.
1780+
message EvaluationGenerationConfig {
1781+
// Optional. The insights dataset to be used to fetch conversation data for
1782+
// generating the evaluations.
1783+
// Format:
1784+
// `projects/{project}/locations/{location}/datasets/{dataset}`.
1785+
string dataset_id = 1 [
1786+
(google.api.field_behavior) = OPTIONAL,
1787+
(google.api.resource_reference) = {
1788+
type: "contactcenterinsights.googleapis.com/Dataset"
1789+
}
1790+
];
1791+
}
1792+
1793+
// The configuration to be used to generate the evaluation personas.
1794+
message EvaluationPersonasGenerationConfig {}
1795+
1796+
// The configuration to be used for quality report generation.
1797+
message QualityReportGenerationConfig {
1798+
// Required. The evaluation run used to inform quality report analysis.
1799+
string evaluation_run = 1 [
1800+
(google.api.field_behavior) = REQUIRED,
1801+
(google.api.resource_reference) = {
1802+
type: "ces.googleapis.com/EvaluationRun"
1803+
}
1804+
];
1805+
}
1806+
1807+
// The configuration to be used for hill climbing fixes.
1808+
message HillClimbingFixConfig {
1809+
// Required. The quality report used to inform the instruction following
1810+
// fix.
1811+
QualityReport quality_report = 1 [(google.api.field_behavior) = REQUIRED];
1812+
}
1813+
1814+
// The resource to generate.
1815+
oneof resource {
1816+
// The agent resource to be used by the LLM assistant, can be empty for
1817+
// generating a new agent.
1818+
Agent agent = 2;
1819+
1820+
// The tool resource to be used by the LLM assistant, can be empty for
1821+
// generating a new tool.
1822+
Tool tool = 4;
1823+
1824+
// The toolset resource to be used by the LLM assistant, can be empty for
1825+
// generating a new toolset.
1826+
Toolset toolset = 6;
1827+
}
1828+
1829+
// Required. The resource name of the app to generate the resource for.
1830+
string parent = 1 [
1831+
(google.api.field_behavior) = REQUIRED,
1832+
(google.api.resource_reference) = { type: "ces.googleapis.com/App" }
1833+
];
1834+
1835+
// Optional. List of refine instructions to be used to refine the resource.
1836+
repeated RefineInstructions refine_instructions = 3
1837+
[(google.api.field_behavior) = OPTIONAL];
1838+
1839+
// Optional. The configuration to be used to generate the tool.
1840+
ToolGenerationConfig tool_generation_config = 5
1841+
[(google.api.field_behavior) = OPTIONAL];
1842+
1843+
// Optional. The configuration to be used to generate the agents and tools.
1844+
AppGenerationConfig app_generation_config = 7
1845+
[(google.api.field_behavior) = OPTIONAL];
1846+
1847+
// Optional. The configuration to be used to generate the evaluations.
1848+
EvaluationGenerationConfig evaluation_generation_config = 8
1849+
[(google.api.field_behavior) = OPTIONAL];
1850+
1851+
// Optional. The configuration to be used to generate the evaluation personas.
1852+
EvaluationPersonasGenerationConfig evaluation_personas_generation_config = 9
1853+
[(google.api.field_behavior) = OPTIONAL];
1854+
1855+
// Optional. The configuration to be used for quality report generation.
1856+
QualityReportGenerationConfig quality_report_generation_config = 10
1857+
[(google.api.field_behavior) = OPTIONAL];
1858+
1859+
// Optional. The configuration to be used for hill climbing fixes.
1860+
HillClimbingFixConfig hill_climbing_fix_config = 11
1861+
[(google.api.field_behavior) = OPTIONAL];
1862+
}
1863+
16601864
// Response message for
16611865
// [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource].
16621866
message GenerateAppResourceResponse {
@@ -1756,6 +1960,66 @@ message QualityReport {
17561960
repeated Issue general_issues = 3 [(google.api.field_behavior) = OPTIONAL];
17571961
}
17581962

1963+
// Operation metadata for
1964+
// [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource].
1965+
message GenerateAppResourceOperationMetadata {
1966+
// The type of the generation operation.
1967+
enum GenerationType {
1968+
// Unspecified operation type.
1969+
GENERATION_TYPE_UNSPECIFIED = 0;
1970+
1971+
// Agent instruction restructure type.
1972+
AGENT_RESTRUCTURE = 1;
1973+
1974+
// Agent instruction refinement type.
1975+
AGENT_REFINE = 2;
1976+
1977+
// Agent creation from type.
1978+
AGENT_CREATE = 3;
1979+
1980+
// Tool creation type.
1981+
TOOL_CREATE = 4;
1982+
1983+
// Scenario creation type.
1984+
SCENARIO_CREATE = 5;
1985+
1986+
// Scenario creation from transcripts type.
1987+
SCENARIO_CREATE_FROM_TRANSCRIPTS = 7;
1988+
1989+
// Evaluation persona generation type.
1990+
EVALUATION_PERSONA_CREATE = 6;
1991+
1992+
// Quality report generation type.
1993+
QUALITY_REPORT_CREATE = 8;
1994+
1995+
// Instruction following fix type (used for hill climbing fixes).
1996+
INSTRUCTION_FOLLOWING_FIX = 9;
1997+
}
1998+
1999+
// Output only. The type of the operation.
2000+
GenerationType generation_type = 1
2001+
[(google.api.field_behavior) = OUTPUT_ONLY];
2002+
2003+
// Output only. Human-readable status of the operation, if any.
2004+
string message = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
2005+
2006+
// Output only. The time the operation was created.
2007+
google.protobuf.Timestamp create_time = 3
2008+
[(google.api.field_behavior) = OUTPUT_ONLY];
2009+
2010+
// Output only. The time the operation finished running.
2011+
google.protobuf.Timestamp end_time = 4
2012+
[(google.api.field_behavior) = OUTPUT_ONLY];
2013+
2014+
// Output only. The resource name of the app that the operation is associated
2015+
// with. Format: `projects/{project}/locations/{location}/apps/{app}`.
2016+
string target = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
2017+
2018+
// Output only. Error messages from the resource generation process.
2019+
repeated google.rpc.Status partial_errors = 6
2020+
[(google.api.field_behavior) = OUTPUT_ONLY];
2021+
}
2022+
17592023
// Request message for
17602024
// [AgentService.ListChangelogs][google.cloud.ces.v1beta.AgentService.ListChangelogs].
17612025
message ListChangelogsRequest {

google/cloud/ces/v1beta/agent_tool.proto

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,18 @@ message AgentTool {
3232
// Optional. Description of the tool's purpose.
3333
string description = 2 [(google.api.field_behavior) = OPTIONAL];
3434

35-
// Optional. The resource name of the root agent that is the entry point of
36-
// the tool. Format: `projects/{project}/locations/{location}/agents/{agent}`
35+
// Optional. Deprecated: Use `agent` instead.
36+
// The resource name of the root agent that is the entry point of the tool.
37+
// Format: `projects/{project}/locations/{location}/agents/{agent}`
3738
string root_agent = 3 [
39+
deprecated = true,
40+
(google.api.field_behavior) = OPTIONAL,
41+
(google.api.resource_reference) = { type: "ces.googleapis.com/Agent" }
42+
];
43+
44+
// Optional. The resource name of the agent that is the entry point of the
45+
// tool. Format: `projects/{project}/locations/{location}/agents/{agent}`
46+
string agent = 4 [
3847
(google.api.field_behavior) = OPTIONAL,
3948
(google.api.resource_reference) = { type: "ces.googleapis.com/Agent" }
4049
];

google/cloud/ces/v1beta/conversation.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ message Conversation {
7777

7878
// The conversation is from the evaluation.
7979
EVAL = 3;
80+
81+
// The conversation is from an agent tool. Agent tool runs the agent in a
82+
// separate session, which is persisted for testing and debugging purposes.
83+
AGENT_TOOL = 4;
8084
}
8185

8286
// Type of the input message.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2026 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.ces.v1beta;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb";
22+
option java_multiple_files = true;
23+
option java_outer_classname = "FileContextProto";
24+
option java_package = "com.google.cloud.ces.v1beta";
25+
26+
// Files to be used as context. Files can be provided as raw bytes.
27+
message FileContext {
28+
// File provided as raw bytes.
29+
message FileBytes {
30+
// Required. The name of the file provided as raw bytes.
31+
string file_name = 1 [(google.api.field_behavior) = REQUIRED];
32+
33+
// Required. The IANA standard MIME type of the source data.
34+
string mime_type = 2 [(google.api.field_behavior) = REQUIRED];
35+
36+
// Required. Raw bytes of the file.
37+
bytes data = 3 [(google.api.field_behavior) = REQUIRED];
38+
}
39+
40+
// File provided as context.
41+
oneof file {
42+
// Optional. File provided as raw bytes.
43+
FileBytes file_bytes = 1 [(google.api.field_behavior) = OPTIONAL];
44+
}
45+
}

0 commit comments

Comments
 (0)