- [HTTP request](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.LookupContextResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#body.aspect)
- [Try it!](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations/lookupContext#try-it)

Looks up LLM Context for the specified resources.

### HTTP request

`POST https://dataplex.googleapis.com/v1/{name=projects/*/locations/*}:lookupContext`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The project to which the request should be attributed in the following form: `projects/{project}/locations/{location}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "resources": [ string ], "options": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `resources[]` | `string` Required. The entry names to look up the context for. The maximum number of resources for a request is limited to 10. `projects/{project}/locations/{location}/entryGroups/{entryGroup}/entries/{entry}` |
| `options` | `map (key: string, value: string)` Optional. Allows to configure the context. Supported options: - `format` - The format of the context (one of `yaml`, `xml`, `json`, default is `yaml`). - `context_budget` - If provided, the output will be intelligently truncated on a best-effort basis to contain approximately the desired amount of characters. There is no guarantee to achieve the specific amount. - `all_schema_fields` - If set to true, all schema fields will be returned in the context (regardless of `context_budget` value). Otherwise, the list of schema fields is truncated. Default is false. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

### Response body

Lookup Context response.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "context": string } ``` |

| Fields ||
|---|---|
| `context` | `string` Pre-formatted block of text containing the context for the requested resources. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/cloud-platform.read-only`
- `
  https://www.googleapis.com/auth/dataplex.read-write`
- `
  https://www.googleapis.com/auth/dataplex.readonly`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).