- [Resource: EvaluationMatcher](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.SCHEMA_REPRESENTATION)
  - [OrderResultMatcher](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.OrderResultMatcher)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.OrderResultMatcher.SCHEMA_REPRESENTATION)
  - [AgentUtteranceStringMatcher](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.AgentUtteranceStringMatcher)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.AgentUtteranceStringMatcher.SCHEMA_REPRESENTATION)
  - [LLMJudgementMatcher](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.LLMJudgementMatcher)
    - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.LLMJudgementMatcher.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#METHODS_SUMMARY)

## 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 (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.OrderResultMatcher`) }, "agentUtteranceStringMatcher": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.AgentUtteranceStringMatcher`) }, "llmJudgementMatcher": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.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 (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.OrderResultMatcher`)`` Optional. An evaluation matcher for an order result. |
| `agentUtteranceStringMatcher` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.AgentUtteranceStringMatcher`)`` Optional. An evaluation matcher for an agent utterance string. |
| `llmJudgementMatcher` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers#EvaluationMatcher.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 (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/Order`) }, "expectedLegacyOrder": { object } } ``` |

| Fields ||
|---|---|
| `expectedOrder` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/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 (`https://protobuf.dev/reference/protobuf/google.protobuf#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 ||
|---|---|
| ### `https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers/create` | Creates an EvaluationMatcher. |
| ### `https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers/delete` | Deletes the specified EvaluationMatcher. |
| ### `https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers/get` | Gets an EvaluationMatcher. |
| ### `https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers/list` | Lists EvaluationMatchers. |
| ### `https://docs.cloud.google.com/gemini-enterprise-cx/commerce-agents/food/reference/rest/v1beta/projects.locations.brands.evaluationMatchers/patch` | Updates the specified EvaluationMatcher. |