Method: projects.locations.templates.sanitizeModelResponse

Sanitizes Model Response.

HTTP request


The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Represents resource name of template e.g. name=projects/sample-project/locations/us-central1/templates/templ01

Request body

The request body contains data with the following structure:

JSON representation
{
  "modelResponseData": {
    object (DataItem)
  },
  "userPrompt": string,
  "filterConfig": {
    object (FilterConfig)
  }
}
Fields
modelResponseData

object (DataItem)

Required. Model response data to sanitize.

userPrompt

string

Optional. User Prompt associated with Model response.

filterConfig

object (FilterConfig)

Optional. Optional Filter configuration to Sanitize User Prompt.

If below configuration is specified then Sanitization will be performed using settings in this configuration along with settings defined at template level (union of both).

If a filter overlaps, then the highest level of strictness will be applied. For example, the filter_configuration specifies LOW_AND_ABOVE confidence level for TOXICITY filter and template uses HIGH confidence level, then Sanitization is performed using LOW_AND_ABOVE confidence level.

Response body

Sanitized Model Response Response.

If successful, the response body contains data with the following structure:

JSON representation
{
  "sanitizationResult": {
    object (SanitizationResult)
  }
}
Fields
sanitizationResult

object (SanitizationResult)

Output only. Sanitization Result.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.