REST Resource: projects.locations.brands.evaluationMatchers

Resource: EvaluationMatcher

An evaluation matcher.

JSON representation
{
  "name": string,
  "displayName": string,
  "description": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "orderResultMatcher": {
    object (OrderResultMatcher)
  },
  "agentUtteranceStringMatcher": {
    object (AgentUtteranceStringMatcher)
  },
  "llmJudgementMatcher": {
    object (LLMJudgementMatcher)
  }
  // End of mutually exclusive fields.
}
Fields
name

string

Identifier. The resource name of the evaluation matcher.

displayName

string

Required. The human-readable name of the evaluation matcher.

description

string

Optional. The description of the evaluation matcher.

The matcher to use for the evaluation matcher. The matcher must produce a boolean result indicating whether the evaluation matcher passed or not. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
orderResultMatcher

object (OrderResultMatcher)

Optional. An evaluation matcher for an order result.

agentUtteranceStringMatcher

object (AgentUtteranceStringMatcher)

Optional. An evaluation matcher for an agent utterance string.

llmJudgementMatcher

object (LLMJudgementMatcher)

Optional. An evaluation matcher using LLM judgement.

End of mutually exclusive fields.

OrderResultMatcher

An evaluation matcher for an order result.

JSON representation
{
  "expectedOrder": {
    object (Order)
  },
  "expectedLegacyOrder": {
    object
  }
}
Fields
expectedOrder

object (Order)

Required. The expected order to match against. The actual order must match this expected order after normalization. The evaluation passes if all fields and quantities match. Default quantities of 1 are ignored during comparison to handle field omission consistently.

expectedLegacyOrder

object (Struct format)

Optional. The expected legacy order state to match against. Used when the evaluation context has useLegacyOrderState set to true.

AgentUtteranceStringMatcher

An evaluation matcher for an agent utterance string.

JSON representation
{
  "invert": boolean,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "contains": string,
  "regex": string
  // End of mutually exclusive fields.
}
Fields
invert

boolean

Optional. If true, the match condition is inverted (e.g., "does not contain" or "does not match").

The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
contains

string

Optional. The agent utterance should contain this substring.

regex

string

Optional. The agent utterance should match this regex.

End of mutually exclusive fields.

LLMJudgementMatcher

An evaluation matcher using LLM judgement with the following prompt: "You are a helpful assistant that helps users place food orders at a restaurant. You will be given user inputs and agent responses. Your task is to determine if the agent response satisfies the following criteria: {criteria}"

JSON representation
{
  "criteria": string,
  "invert": boolean
}
Fields
criteria

string

Required. The criteria for the LLM to consider if an agent response passes the check.

invert

boolean

Optional. If true, the match condition is inverted (e.g., "does not contain").

Methods

create

Creates an EvaluationMatcher.

delete

Deletes the specified EvaluationMatcher.

get

Gets an EvaluationMatcher.

list

Lists EvaluationMatchers.

patch

Updates the specified EvaluationMatcher.