Method: projects.locations.apps.generateAppResource

Generates specific resources (e.g. agent) in the app using LLM assistant.

HTTP request

POST https://ces.googleapis.com/v1beta/{parent=projects/*/locations/*/apps/*}:generateAppResource

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The resource name of the app to generate the resource for.

Request body

The request body contains data with the following structure:

JSON representation
{
  "refineInstructions": [
    {
      object (GenerateAppResourceRequest.RefineInstructions)
    }
  ],
  "toolGenerationConfig": {
    object (GenerateAppResourceRequest.ToolGenerationConfig)
  },
  "appGenerationConfig": {
    object (GenerateAppResourceRequest.AppGenerationConfig)
  },
  "evaluationGenerationConfig": {
    object (GenerateAppResourceRequest.EvaluationGenerationConfig)
  },
  "evaluationPersonasGenerationConfig": {
    object (GenerateAppResourceRequest.EvaluationPersonasGenerationConfig)
  },
  "qualityReportGenerationConfig": {
    object (GenerateAppResourceRequest.QualityReportGenerationConfig)
  },
  "hillClimbingFixConfig": {
    object (GenerateAppResourceRequest.HillClimbingFixConfig)
  },

  // Union field resource can be only one of the following:
  "agent": {
    object (Agent)
  },
  "tool": {
    object (Tool)
  },
  "toolset": {
    object (Toolset)
  }
  // End of list of possible types for union field resource.
}
Fields
refineInstructions[]

object (GenerateAppResourceRequest.RefineInstructions)

Optional. List of refine instructions to be used to refine the resource.

toolGenerationConfig

object (GenerateAppResourceRequest.ToolGenerationConfig)

Optional. The configuration to be used to generate the tool.

appGenerationConfig

object (GenerateAppResourceRequest.AppGenerationConfig)

Optional. The configuration to be used to generate the agents and tools.

evaluationGenerationConfig

object (GenerateAppResourceRequest.EvaluationGenerationConfig)

Optional. The configuration to be used to generate the evaluations.

evaluationPersonasGenerationConfig

object (GenerateAppResourceRequest.EvaluationPersonasGenerationConfig)

Optional. The configuration to be used to generate the evaluation personas.

qualityReportGenerationConfig

object (GenerateAppResourceRequest.QualityReportGenerationConfig)

Optional. The configuration to be used for quality report generation.

hillClimbingFixConfig

object (GenerateAppResourceRequest.HillClimbingFixConfig)

Optional. The configuration to be used for hill climbing fixes.

Union field resource. The resource to generate. resource can be only one of the following:
agent

object (Agent)

The agent resource to be used by the LLM assistant, can be empty for generating a new agent.

tool

object (Tool)

The tool resource to be used by the LLM assistant, can be empty for generating a new tool.

toolset

object (Toolset)

The toolset resource to be used by the LLM assistant, can be empty for generating a new toolset.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/ces

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • ces.apps.update

For more information, see the IAM documentation.

GenerateAppResourceRequest.RefineInstructions

The instructions to be used to refine a part of the resource. The part of the resource can be specified with a start index, end index and a field mask. For example, if you want to refine a part of the agent instructions you can specify the index of the first character of the instructions, the index of the last character of the instructions and the field mask as "instructions".

JSON representation
{
  "startIndex": string,
  "endIndex": string,
  "fieldMask": string,
  "instructions": string
}
Fields
startIndex

string (int64 format)

Required. The first character (inclusive) of the text to refine.

endIndex

string (int64 format)

Required. The last character (inclusive) of the text to refine.

fieldMask

string (FieldMask format)

Required. The field of the resource being refined. Only one field is allowed per RefineInstructions. If refining agent instructions, the field mask should be "instructions".

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

instructions

string

Required. The instructions to refine the resource.

GenerateAppResourceRequest.ToolGenerationConfig

The configuration to be used to generate a tool.

JSON representation
{
  "context": string,
  "fileContexts": [
    {
      object (FileContext)
    }
  ],
  "openApiToolsetGenerationConfig": {
    object (GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig)
  }
}
Fields
context

string

Optional. The context which describes the tool to be generated. This can be empty if the tool request & response are provided.

fileContexts[]

object (FileContext)

Optional. The files to be used as context.

openApiToolsetGenerationConfig

object (GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig)

Optional. The configuration to be used to generate an Open API schema.

FileContext

Files to be used as context. Files can be provided as raw bytes.

JSON representation
{

  // Union field file can be only one of the following:
  "fileBytes": {
    object (FileContext.FileBytes)
  }
  // End of list of possible types for union field file.
}
Fields
Union field file. File provided as context. file can be only one of the following:
fileBytes

object (FileContext.FileBytes)

Optional. File provided as raw bytes.

FileContext.FileBytes

File provided as raw bytes.

JSON representation
{
  "fileName": string,
  "mimeType": string,
  "data": string
}
Fields
fileName

string

Required. The name of the file provided as raw bytes.

mimeType

string

Required. The IANA standard MIME type of the source data.

data

string (bytes format)

Required. Raw bytes of the file.

A base64-encoded string.

GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig

The configuration to be used to generate an Open API schema.

JSON representation
{
  "uri": string,
  "operationGenerationConfigs": [
    {
      object (GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig)
    }
  ]
}
Fields
uri

string

Required. The base uri of the tool.

operationGenerationConfigs[]

object (GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig)

Required. The list of operations to be added to the Open API schema.

GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig

The configuration to be used to generate an operation in the Open API schema.

JSON representation
{
  "method": string,
  "path": string,
  "requestJson": string,
  "responseJson": string
}
Fields
method

string

Required. The uri of the tool. This should include query and path parameters if any.

path

string

Required. The path of the tool to be appended to the base uri. This should include query and path parameters if any.

requestJson

string

Required. A sample request to the tool in JSON format. Skip if the tool does not support request body.

responseJson

string

Required. A sample response from the tool in JSON format.

GenerateAppResourceRequest.AppGenerationConfig

The configuration to be used to generate the app.

JSON representation
{
  "context": string,
  "fileContexts": [
    {
      object (FileContext)
    }
  ],
  "datasetId": string,
  "generateEvaluations": boolean,
  "gcsLocation": string
}
Fields
context

string

Optional. The context which describes the requirements of the agents & tools to be generated.

fileContexts[]

object (FileContext)

Optional. The files to be used as context.

datasetId

string

Optional. The insights dataset to be used to fetch conversation data for generating the agents & tools. Format: projects/{project}/locations/{location}/datasets/{dataset}.

generateEvaluations

boolean

Optional. Whether to generate the evaluations for the app. If true, the provided context will be used to generate the evaluations data.

gcsLocation

string

Optional. The Cloud Storage location to store the generated question answer data to be used by the Datastore tool. This data is generated only when using conversation data as an input source. The location must be in the same project as the app. Format: gs://....

GenerateAppResourceRequest.EvaluationGenerationConfig

The configuration to be used to generate the evaluations.

JSON representation
{
  "datasetId": string
}
Fields
datasetId

string

Optional. The insights dataset to be used to fetch conversation data for generating the evaluations. Format: projects/{project}/locations/{location}/datasets/{dataset}.

GenerateAppResourceRequest.EvaluationPersonasGenerationConfig

This type has no fields.

The configuration to be used to generate the evaluation personas.

GenerateAppResourceRequest.QualityReportGenerationConfig

The configuration to be used for quality report generation.

JSON representation
{
  "evaluationRun": string
}
Fields
evaluationRun

string

Required. The evaluation run used to inform quality report analysis.

GenerateAppResourceRequest.HillClimbingFixConfig

The configuration to be used for hill climbing fixes.

JSON representation
{
  "qualityReport": {
    object (QualityReport)
  }
}
Fields
qualityReport

object (QualityReport)

Required. The quality report used to inform the instruction following fix.

QualityReport

The report describing any identified quality issues in the app.

JSON representation
{
  "issues": [
    {
      object (QualityReport.AgentIssues)
    }
  ],
  "evaluationRuns": [
    string
  ],
  "generalIssues": [
    {
      object (QualityReport.Issue)
    }
  ]
}
Fields
issues[]

object (QualityReport.AgentIssues)

Optional. The issues grouped by agent.

evaluationRuns[]

string

Optional. A list of evaluation runs used to generate the quality report. Format: projects/{project}/locations/{location}/evaluationRuns/{evaluationRun}.

generalIssues[]

object (QualityReport.Issue)

Optional. General issues not specific to any agent.

QualityReport.AgentIssues

Issues identified for a single agent.

JSON representation
{
  "agent": string,
  "issues": [
    {
      object (QualityReport.Issue)
    }
  ]
}
Fields
agent

string

Optional. The name of the agent to which the issues are related. Format: projects/{project}/locations/{location}/apps/{app}/agents/{agent}

issues[]

object (QualityReport.Issue)

Optional. List of issues found for this agent.

QualityReport.Issue

The issue identified.

JSON representation
{
  "description": string,
  "occurrenceCount": integer,
  "proposedSolution": string
}
Fields
description

string

Optional. Description of the issue found.

occurrenceCount

integer

Optional. How many times this issue occurred.

proposedSolution

string

Optional. Proposed solution to fix the issue by modifying instructions or tools.