# SessionSpec

- [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1/SessionSpec#SCHEMA_REPRESENTATION)

Session specification.

| JSON representation |
|---|
| ``` { "queryId": string, "searchResultPersistenceCount": integer } ``` |

| Fields ||
|---|---|
| `queryId` | `string` If set, the search result gets stored to the "turn" specified by this query ID. Example: Let's say the session looks like this: session { name: ".../sessions/xxx" turns { query { text: "What is foo?" queryId: ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How about bar then?" queryId: ".../questions/zzz" } } } The user can call /search API with a request like this: session: ".../sessions/xxx" sessionSpec { queryId: ".../questions/zzz" } Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID \& query ID. |
| `searchResultPersistenceCount` | `integer` The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call. This field is similar to the `summaryResultCount` field in `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1/ContentSearchSpec#SummarySpec.FIELDS.summary_result_count`. At most 10 results for documents mode, or 50 for chunks mode. |