- [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult#SCHEMA_REPRESENTATION)
- [Sentiment](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult#Sentiment)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult#Sentiment.SCHEMA_REPRESENTATION)

The result of sentiment analysis. Sentiment analysis inspects user input and identifies the prevailing subjective opinion, especially to determine a user's attitude as positive, negative, or neutral. For \[DetectIntent\]\[\], it needs to be configured in `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.agent.sessions/detectIntent#body.request_body.FIELDS.query_params`. For \[StreamingDetectIntent\]\[\], it needs to be configured in `StreamingDetectIntentRequest.query_params`. And for `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.participants/analyzeContent#google.cloud.dialogflow.v2.Participants.AnalyzeContent` and `Participants.StreamingAnalyzeContent`, it needs to be configured in `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversationProfiles#ConversationProfile.FIELDS.human_agent_assistant_config`

| JSON representation |
|---|
| ``` { "queryTextSentiment": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult#Sentiment`) }, "status": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Status`) } } ``` |

| Fields ||
|---|---|
| `queryTextSentiment` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult#Sentiment`)`` The sentiment analysis result for `queryText`. |
| `status` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Status`)`` Output only. The status of the sentiment analysis operation. If the operation failed, this field will contain the error details. For example, it might indicate a quota issue (RESOURCE_EXHAUSTED). |

## Sentiment

The sentiment, such as positive/negative feeling or association, for a unit of analysis, such as the query text. See: <https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values> for how to interpret the result.

| JSON representation |
|---|
| ``` { "score": number, "magnitude": number } ``` |

| Fields ||
|---|---|
| `score` | `number` Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). |
| `magnitude` | `number` A non-negative number in the \[0, +inf) range, which represents the absolute magnitude of sentiment, regardless of score (positive or negative). |