- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- SessionConfig
- SessionOutput
- ToolCalls
- Citations
- Citations.CitedChunk
- GoogleSearchSuggestions
- WebSearchQuery
- EndSession
- SessionOutput.DiagnosticInfo
Initiates a single turn interaction with the CES agent within a session.
HTTP request
POST https://ces.googleapis.com/v1beta/{config.session=projects/*/locations/*/apps/*/sessions/*}:runSession
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
config.session |
Required. The unique identifier of the session. Format: |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "config": { "session": string, "inputAudioConfig": { "audioEncoding": enum ( |
| Fields | |
|---|---|
config.inputAudioConfig |
Optional. Configuration for processing the input audio. |
config.outputAudioConfig |
Optional. Configuration for generating the output audio. |
config.historicalContexts[] |
Optional. The historical context of the session, including user inputs, agent responses, and other messages. Typically, CES agent would manage session automatically so client doesn't need to explicitly populate this field. However, client can optionally override the historical contexts to force the session start from certain state. |
config.entryAgent |
Optional. The entry agent to handle the session. If not specified, the session will be handled by the |
config.deployment |
Optional. The deployment of the app to use for the session. Format: |
config.timeZone |
Optional. The time zone of the user. If provided, the agent will use the time zone for date and time related variables. Otherwise, the agent will use the time zone specified in the App.time_zone_settings. The format is the IANA Time Zone Database time zone, e.g. "America/Los_Angeles". |
inputs[] |
Required. Inputs for the session. |
Response body
Response message for SessionService.RunSession.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"outputs": [
{
object ( |
| Fields | |
|---|---|
outputs[] |
Outputs for the session. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the session resource:
ces.sessions.runSession
For more information, see the IAM documentation.
SessionConfig
The configuration for the session.
| JSON representation |
|---|
{ "session": string, "inputAudioConfig": { object ( |
| Fields | |
|---|---|
session |
Required. The unique identifier of the session. Format: |
inputAudioConfig |
Optional. Configuration for processing the input audio. |
outputAudioConfig |
Optional. Configuration for generating the output audio. |
historicalContexts[] |
Optional. The historical context of the session, including user inputs, agent responses, and other messages. Typically, CES agent would manage session automatically so client doesn't need to explicitly populate this field. However, client can optionally override the historical contexts to force the session start from certain state. |
entryAgent |
Optional. The entry agent to handle the session. If not specified, the session will be handled by the |
deployment |
Optional. The deployment of the app to use for the session. Format: |
timeZone |
Optional. The time zone of the user. If provided, the agent will use the time zone for date and time related variables. Otherwise, the agent will use the time zone specified in the App.time_zone_settings. The format is the IANA Time Zone Database time zone, e.g. "America/Los_Angeles". |
SessionOutput
Output for the session.
| JSON representation |
|---|
{ "turnIndex": integer, "turnCompleted": boolean, "diagnosticInfo": { object ( |
| Fields | |
|---|---|
turnIndex |
Indicates the sequential order of conversation turn to which this output belongs to, starting from 1. |
turnCompleted |
If true, the CES agent has detected the end of the current conversation turn and will provide no further output for this turn. |
diagnosticInfo |
Optional. Diagnostic information contains execution details during the processing of the input. Only populated in the last SessionOutput (with |
Union field output_type. The type of the output. output_type can be only one of the following: |
|
text |
Output text from the CES agent. |
audio |
Output audio from the CES agent. A base64-encoded string. |
toolCalls |
Request for the client to execute the tools. |
citations |
Citations that provide the source information for the agent's generated text. |
googleSearchSuggestions |
The suggestions returned from Google Search as a result of invoking the |
endSession |
Indicates the session has ended. |
payload |
Custom payload with structured output from the CES agent. |
ToolCalls
Request for the client to execute the tools and return the execution results before continuing the session.
| JSON representation |
|---|
{
"toolCalls": [
{
object ( |
| Fields | |
|---|---|
toolCalls[] |
Optional. The list of tool calls to execute. |
Citations
Citations associated with the agent response.
| JSON representation |
|---|
{
"citedChunks": [
{
object ( |
| Fields | |
|---|---|
citedChunks[] |
List of cited pieces of information. |
Citations.CitedChunk
Piece of cited information.
| JSON representation |
|---|
{ "uri": string, "title": string, "text": string } |
| Fields | |
|---|---|
uri |
URI used for citation. |
title |
Title of the cited document. |
text |
Text used for citaiton. |
GoogleSearchSuggestions
Search suggestions from Google Search Tool.
| JSON representation |
|---|
{
"htmls": [
string
],
"webSearchQueries": [
{
object ( |
| Fields | |
|---|---|
htmls[] |
Compliant HTML and CSS styling for search suggestions. The provided HTML and CSS automatically adapts to your device settings, displaying in either light or dark mode indicated by |
webSearchQueries[] |
List of queries used to perform the google search along with the search result URIs forming the search suggestions. |
WebSearchQuery
Represents a single web search query and its associated search uri.
| JSON representation |
|---|
{ "query": string, "uri": string } |
| Fields | |
|---|---|
query |
The search query text. |
uri |
The URI to the Google Search results page for the query. |
EndSession
Indicates the session has terminated, due to either successful completion (e.g. user says "Good bye!" ) or an agent escalation.
The agent will not process any further inputs after session is terminated and the client should half-close and disconnect after receiving all remaining responses from the agent.
| JSON representation |
|---|
{ "metadata": { object } } |
| Fields | |
|---|---|
metadata |
Optional. Provides additional information about the end session signal, such as the reason for ending the session. |
SessionOutput.DiagnosticInfo
Contains execution details during the processing.
| JSON representation |
|---|
{ "messages": [ { object ( |
| Fields | |
|---|---|
messages[] |
List of the messages that happened during the processing. |
rootSpan |
A trace of the entire request processing, represented as a root span. This span can contain nested child spans for specific operations. |