Method: projects.locations.sessions.streamProcessOrder

Performs a single turn interaction, but uses server-side streaming to deliver incremental results and partial responses as they are generated.

HTTP request

POST https://foodorderingaiagent.googleapis.com/v1beta/{config.session=projects/*/locations/*/sessions/*}:streamProcessOrder

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
config.session

string

Required. The session for the order. Format: projects/{project}/locations/{location}/sessions/{session}

Request body

The request body contains data with the following structure:

JSON representation
{
  "config": {
    "session": string,
    "store": string,
    "laneId": string,
    "enableEchoCancellation": boolean,
    "daypartId": string,
    "userInfo": {
      "preferredName": string,
      "paymentInfo": {
        object (PaymentInfo)
      },
      "deliveryAddress": string,
      "pastOrders": [
        {
          object (PastOrder)
        }
      ],
      "loyaltyInfo": {
        object (LoyaltyInfo)
      },
      "phoneNumber": string,
      "userId": string,
      "savedDeliveryAddress": {
        object (DeliveryAddress)
      },
      "additionalSavedAddresses": [
        {
          object (DeliveryAddress)
        }
      ],
      "additionalSavedCustomerNames": [
        string
      ]
    },
    "orderType": enum (OrderType),
    "initialOrder": {
      "items": [
        {
          object (OrderItem)
        }
      ],
      "metadata": {
        object (OrderMetadata)
      },
      "fulfillment": {
        object (OrderFulfillment)
      },
      "priceInfo": {
        object (OrderPriceInfo)
      },
      "externalOrderId": string,
      "orderPayment": {
        object (OrderPayment)
      },
      "customIntegrationAttributes": {
        object
      }
    },
    "featureGate": {
      "triggerOfferEngineOnDemand": boolean,
      "triggerLoyaltyOnDemand": boolean,
      "triggerOrderMediaAssistantOnDemand": boolean,
      "menuResponseEnabled": boolean,
      "revampedPaymentFlowEnabled": boolean,
      "updatedOrderStateEnabled": boolean,
      "enableOrderStatusRetrieval": boolean,
      "enableClientEscalationAudio": boolean
    },
    "initialUtterance": string,
    "clientAppInfo": {
      "deviceModel": string,
      "osVersion": string,
      "sdkVersion": string
    },
    "mode": enum (SessionMode),
    "channelType": enum (ChannelType),
    "enableListenOnlyDualChannel": boolean,
    "testSessionStartTime": string,
    "fulfillmentMethod": enum (FulfillmentMethod),
    "clientEnv": string
  },
  "turnType": enum (TurnType),

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "textInput": {
    object (TextInput)
  },
  "audioInput": {
    object (AudioInput)
  },
  "eventInput": {
    object (EventInput)
  },
  "clientExecutionResult": {
    object (ClientExecutionResult)
  },
  "blobInput": {
    object (Blob)
  },
  "dtmfInput": {
    object (DtmfInput)
  }
  // End of mutually exclusive fields.
}
Fields
config.store

string

Required. The store the order is being placed for. Format: projects/{project}/locations/{location}/brands/{brand}/stores/{store}

config.laneId

string

Optional. The id of a specifc drive through lane.

config.enableEchoCancellation

boolean

Optional. Whether to enable echo cancellation for the session. If enabled, the client should provide the customerAudio and crewAudio in the AudioInput.

config.daypartId

string

Optional. Daypart of the food menu, including breakfast, lunch, dinner, etc. This is used to determine the menu to use for the order.

config.userInfo

object (UserInfo)

Optional. The personal information of the end user shared with the agent.

config.orderType
(deprecated)

enum (OrderType)

Optional. Deprecated: Use initialOrder.fulfillment.fulfillment_type instead. The type of order to be placed.

config.initialOrder

object (Order)

Optional. The initial order before starting the agent session. If provided, the agent will use it as the initial order state.

config.featureGate

object (FeatureGate)

Optional. The feature gates for the session. This is used to enable or disable features for the session.

config.initialUtterance

string

Optional. The initial utterance from the client to kick off the conversation. If provided, the agent will use this as the first user utterance, and will not start with a greeting message.

config.clientAppInfo

object (ClientAppInfo)

Optional. The information about the client application and device environment.

config.mode

enum (SessionMode)

Optional. The mode of the session.

config.channelType

enum (ChannelType)

Optional. The type of channel used for agent communication.

config.enableListenOnlyDualChannel

boolean

Optional. Whether to enable listen-only dual channel for the session. If enabled, the client should provide the customerAudio and crewAudio in the AudioInput.

config.testSessionStartTime

string (Timestamp format)

Optional. The start time of the session, used for testing or evaluation purposes.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

config.fulfillmentMethod

enum (FulfillmentMethod)

Optional. The fulfillment method for the session.

config.clientEnv

string

Optional. The environment on the client side (e.g., "qa", "uat", "preprod").

turnType

enum (TurnType)

Optional. Explicit indicator of the request's position in the session lifecycle. Allows clients to deterministically control when initial session setup variables are injected.

The input from the client. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
textInput

object (TextInput)

The text input from the client.

audioInput

object (AudioInput)

The audio input from the client.

eventInput

object (EventInput)

The event input from the client.

clientExecutionResult

object (ClientExecutionResult)

The result of a client execution request.

blobInput

object (Blob)

Generic binary data input.

dtmfInput

object (DtmfInput)

The DTMF input from the client.

End of mutually exclusive fields.

Response body

If successful, the response body contains a stream of BidiProcessOrderResponse instances.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.