Skip to content

Commit

Permalink
feat: allowed custom to specify webhook headers through query parameters
Browse files Browse the repository at this point in the history
docs: suggested to always use version for production traffic when calling DetectIntent

PiperOrigin-RevId: 346434847
  • Loading branch information
Google APIs authored and Copybara-Service committed Dec 9, 2020
1 parent abc4306 commit e4d0155
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 19 deletions.
38 changes: 19 additions & 19 deletions google/cloud/dialogflow/cx/v3beta1/response_message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,25 @@ message ResponseMessage {
bool allow_playback_interruption = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Specifies an audio clip to be played by the client as part of the response.
message PlayAudio {
// Required. URI of the audio clip. Dialogflow does not impose any validation on this
// value. It is specific to the client that reads it.
string audio_uri = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. Whether the playback of this message can be interrupted by the end
// user's speech and the client can then starts the next Dialogflow
// request.
bool allow_playback_interruption = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Indicates that interaction with the Dialogflow agent has ended.
// This message is generated by Dialogflow only and not supposed to be
// defined by the user.
message EndInteraction {

}

// Represents an audio message that is composed of both segments
// synthesized from the Dialogflow agent prompts and ones hosted externally
// at the specified URIs.
Expand Down Expand Up @@ -144,25 +163,6 @@ message ResponseMessage {
repeated Segment segments = 1;
}

// Indicates that interaction with the Dialogflow agent has ended.
// This message is generated by Dialogflow only and not supposed to be
// defined by the user.
message EndInteraction {

}

// Specifies an audio clip to be played by the client as part of the response.
message PlayAudio {
// Required. URI of the audio clip. Dialogflow does not impose any validation on this
// value. It is specific to the client that reads it.
string audio_uri = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. Whether the playback of this message can be interrupted by the end
// user's speech and the client can then starts the next Dialogflow
// request.
bool allow_playback_interruption = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Required. The rich response message.
oneof message {
// Returns a text response.
Expand Down
26 changes: 26 additions & 0 deletions google/cloud/dialogflow/cx/v3beta1/session.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ service Sessions {
// as a result. This method is not idempotent, because it may cause session
// entity types to be updated, which in turn might affect results of future
// queries.
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) {
option (google.api.http) = {
post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent"
Expand All @@ -71,6 +75,10 @@ service Sessions {
// Processes a natural language query in audio format in a streaming fashion
// and returns structured, actionable data as a result. This method is only
// available via the gRPC API (not REST).
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) {
}

Expand Down Expand Up @@ -116,6 +124,10 @@ message DetectIntentRequest {
//
// For more information, see the [sessions
// guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
string session = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -201,6 +213,10 @@ message StreamingDetectIntentRequest {
//
// For more information, see the [sessions
// guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
string session = 1 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Session"
}];
Expand Down Expand Up @@ -374,6 +390,16 @@ message QueryParameters {
// Configures whether sentiment analysis should be performed. If not
// provided, sentiment analysis is not performed.
bool analyze_query_text_sentiment = 8;

// This field can be used to pass HTTP headers for a webhook
// call. These headers will be sent to webhook along with the headers that
// have been configured through Dialogflow web console. The headers defined
// within this field will overwrite the headers configured through Dialogflow
// console if there is a conflict. Header names are case-insensitive.
// Google's specified headers are not allowed. Including: "Host",
// "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
// "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
map<string, string> webhook_headers = 10;
}

// Represents the query input. It can contain one of:
Expand Down

0 comments on commit e4d0155

Please sign in to comment.