# ConversationTurn

- [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#SCHEMA_REPRESENTATION)
- [UserInput](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#UserInput)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#UserInput.SCHEMA_REPRESENTATION)
- [VirtualAgentOutput](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#VirtualAgentOutput)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#VirtualAgentOutput.SCHEMA_REPRESENTATION)
- [TestRunDifference](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#TestRunDifference)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#TestRunDifference.SCHEMA_REPRESENTATION)
- [DiffType](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#DiffType)

One interaction between a human and virtual agent. The human provides some input and the virtual agent provides a response.

| JSON representation |
|---|
| ``` { "userInput": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#UserInput`) }, "virtualAgentOutput": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#VirtualAgentOutput`) } } ``` |

| Fields ||
|---|---|
| `userInput` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#UserInput`)`` The user input. |
| `virtualAgentOutput` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#VirtualAgentOutput`)`` The virtual agent output. |

## UserInput

The input from the human user.

| JSON representation |
|---|
| ``` { "input": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/QueryInput`) }, "injectedParameters": { object }, "isWebhookEnabled": boolean, "enableSentimentAnalysis": boolean } ``` |

| Fields ||
|---|---|
| `input` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/QueryInput`)`` Supports `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/QueryInput#FIELDS.text`, `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/QueryInput#FIELDS.event`, `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/QueryInput#FIELDS.dtmf` in the test case. |
| `injectedParameters` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Parameters that need to be injected into the conversation during intent detection. |
| `isWebhookEnabled` | `boolean` If webhooks should be allowed to trigger in response to the user utterance. Often if parameters are injected, webhooks should not be enabled. |
| `enableSentimentAnalysis` | `boolean` Whether sentiment analysis is enabled. |

## VirtualAgentOutput

The output from the virtual agent.

| JSON representation |
|---|
| ``` { "sessionParameters": { object }, "differences": [ { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#TestRunDifference`) } ], "diagnosticInfo": { object }, "triggeredIntent": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents#Intent`) }, "currentPage": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows.pages#Page`) }, "textResponses": [ { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/Text`) } ], "status": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/Status`) } } ``` |

| Fields ||
|---|---|
| `sessionParameters` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` The session parameters available to the bot at this point. |
| `differences[]` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#TestRunDifference`)`` Output only. If this is part of a \[result conversation turn\]\[TestCaseResult.conversation_turns\], the list of differences between the original run and the replay for this output, if any. |
| `diagnosticInfo` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Required. Input only. The diagnostic \[info\]\[Session.DetectIntentResponse.QueryResult.diagnostic_info\] output for the turn. Required to calculate the testing coverage. |
| `triggeredIntent` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents#Intent`)`` The `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.intents#Intent` that triggered the response. Only name and displayName will be set. |
| `currentPage` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows.pages#Page`)`` The `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.flows.pages#Page` on which the utterance was spoken. Only name and displayName will be set. |
| `textResponses[]` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/Text`)`` The `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/Text` responses from the agent for the turn. |
| `status` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/Status`)`` Response error from the agent in the test result. If set, other output is empty. |

## TestRunDifference

The description of differences between original and replayed agent output.

| JSON representation |
|---|
| ``` { "type": enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#DiffType`), "description": string } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/ConversationTurn#DiffType`)`` The type of diff. |
| `description` | `string` A human readable description of the diff, showing the actual output vs expected output. |

## DiffType

What part of the message replay differs from the test case.

| Enums ||
|---|---|
| `DIFF_TYPE_UNSPECIFIED` | Should never be used. |
| `INTENT` | The intent. |
| `PAGE` | The page. |
| `PARAMETERS` | The parameters. |
| `UTTERANCE` | The message utterance. |
| `FLOW` | The flow. |