# RecommendResponse

- [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/RecommendResponse#SCHEMA_REPRESENTATION)
- [RecommendationResult](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/RecommendResponse#RecommendationResult)
  - [JSON representation](https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/RecommendResponse#RecommendationResult.SCHEMA_REPRESENTATION)

Response message for Recommend method.

| JSON representation |
|---|
| ``` { "results": [ { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/RecommendResponse#RecommendationResult`) } ], "attributionToken": string, "missingIds": [ string ], "validateOnly": boolean } ``` |

| Fields ||
|---|---|
| `results[]` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/RecommendResponse#RecommendationResult`)`` A list of recommended Documents. The order represents the ranking (from the most relevant Document to the least). |
| `attributionToken` | `string` A unique attribution token. This should be included in the `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.userEvents#UserEvent` logs resulting from this recommendation, which enables accurate attribution of recommendation model performance. |
| `missingIds[]` | `string` IDs of documents in the request that were missing from the default Branch associated with the requested ServingConfig. |
| `validateOnly` | `boolean` True if `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.servingConfigs/recommend#body.request_body.FIELDS.validate_only` was set. |

## RecommendationResult

RecommendationResult represents a generic recommendation result with associated metadata.

| JSON representation |
|---|
| ``` { "id": string, "document": { object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document`) }, "metadata": { string: value, ... } } ``` |

| Fields ||
|---|---|
| `id` | `string` Resource ID of the recommended Document. |
| `document` | ``object (`https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document`)`` Set if `returnDocument` is set to true in `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.servingConfigs/recommend#body.request_body.FIELDS.params`. |
| `metadata` | ``map (key: string, value: value (`https://protobuf.dev/reference/protobuf/google.protobuf#value` format))`` Additional Document metadata or annotations. Possible values: - `score`: Recommendation score in double value. Is set if `returnScore` is set to true in `https://docs.cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.dataStores.servingConfigs/recommend#body.request_body.FIELDS.params`. |