@@ -28,6 +28,7 @@ import "google/cloud/ces/v1beta/conversation.proto";
2828import "google/cloud/ces/v1beta/deployment.proto" ;
2929import "google/cloud/ces/v1beta/evaluation.proto" ;
3030import "google/cloud/ces/v1beta/example.proto" ;
31+ import "google/cloud/ces/v1beta/file_context.proto" ;
3132import "google/cloud/ces/v1beta/guardrail.proto" ;
3233import "google/cloud/ces/v1beta/security_settings.proto" ;
3334import "google/cloud/ces/v1beta/tool.proto" ;
@@ -36,6 +37,7 @@ import "google/longrunning/operations.proto";
3637import "google/protobuf/empty.proto" ;
3738import "google/protobuf/field_mask.proto" ;
3839import "google/protobuf/timestamp.proto" ;
40+ import "google/rpc/status.proto" ;
3941
4042option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb" ;
4143option 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]
16581674message 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].
16621866message 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].
17612025message ListChangelogsRequest {
0 commit comments