participant.proto 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.dialogflow.v2beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/dialogflow/v2beta1/audio_config.proto";
  21. import "google/cloud/dialogflow/v2beta1/gcs.proto";
  22. import "google/cloud/dialogflow/v2beta1/session.proto";
  23. import "google/protobuf/any.proto";
  24. import "google/protobuf/duration.proto";
  25. import "google/protobuf/field_mask.proto";
  26. import "google/protobuf/struct.proto";
  27. import "google/protobuf/timestamp.proto";
  28. import "google/rpc/status.proto";
  29. option cc_enable_arenas = true;
  30. option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
  31. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
  32. option java_multiple_files = true;
  33. option java_outer_classname = "ParticipantProto";
  34. option java_package = "com.google.cloud.dialogflow.v2beta1";
  35. option objc_class_prefix = "DF";
  36. // Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant].
  37. service Participants {
  38. option (google.api.default_host) = "dialogflow.googleapis.com";
  39. option (google.api.oauth_scopes) =
  40. "https://www.googleapis.com/auth/cloud-platform,"
  41. "https://www.googleapis.com/auth/dialogflow";
  42. // Creates a new participant in a conversation.
  43. rpc CreateParticipant(CreateParticipantRequest) returns (Participant) {
  44. option (google.api.http) = {
  45. post: "/v2beta1/{parent=projects/*/conversations/*}/participants"
  46. body: "participant"
  47. additional_bindings {
  48. post: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants"
  49. body: "participant"
  50. }
  51. };
  52. option (google.api.method_signature) = "parent,participant";
  53. }
  54. // Retrieves a conversation participant.
  55. rpc GetParticipant(GetParticipantRequest) returns (Participant) {
  56. option (google.api.http) = {
  57. get: "/v2beta1/{name=projects/*/conversations/*/participants/*}"
  58. additional_bindings {
  59. get: "/v2beta1/{name=projects/*/locations/*/conversations/*/participants/*}"
  60. }
  61. };
  62. option (google.api.method_signature) = "name";
  63. }
  64. // Returns the list of all participants in the specified conversation.
  65. rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse) {
  66. option (google.api.http) = {
  67. get: "/v2beta1/{parent=projects/*/conversations/*}/participants"
  68. additional_bindings {
  69. get: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants"
  70. }
  71. };
  72. option (google.api.method_signature) = "parent";
  73. }
  74. // Updates the specified participant.
  75. rpc UpdateParticipant(UpdateParticipantRequest) returns (Participant) {
  76. option (google.api.http) = {
  77. patch: "/v2beta1/{participant.name=projects/*/conversations/*/participants/*}"
  78. body: "participant"
  79. additional_bindings {
  80. patch: "/v2beta1/{participant.name=projects/*/locations/*/conversations/*/participants/*}"
  81. body: "participant"
  82. }
  83. };
  84. option (google.api.method_signature) = "participant,update_mask";
  85. }
  86. // Adds a text (chat, for example), or audio (phone recording, for example)
  87. // message from a participant into the conversation.
  88. //
  89. // Note: Always use agent versions for production traffic
  90. // sent to virtual agents. See [Versions and
  91. // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
  92. rpc AnalyzeContent(AnalyzeContentRequest) returns (AnalyzeContentResponse) {
  93. option (google.api.http) = {
  94. post: "/v2beta1/{participant=projects/*/conversations/*/participants/*}:analyzeContent"
  95. body: "*"
  96. additional_bindings {
  97. post: "/v2beta1/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent"
  98. body: "*"
  99. }
  100. };
  101. option (google.api.method_signature) = "participant,text_input";
  102. option (google.api.method_signature) = "participant,event_input";
  103. }
  104. // Gets suggested articles for a participant based on specific historical
  105. // messages.
  106. //
  107. // Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
  108. // suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
  109. // based on the provided conversation context in the real time.
  110. rpc SuggestArticles(SuggestArticlesRequest) returns (SuggestArticlesResponse) {
  111. option (google.api.http) = {
  112. post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles"
  113. body: "*"
  114. additional_bindings {
  115. post: "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles"
  116. body: "*"
  117. }
  118. };
  119. option (google.api.method_signature) = "parent";
  120. }
  121. // Gets suggested faq answers for a participant based on specific historical
  122. // messages.
  123. rpc SuggestFaqAnswers(SuggestFaqAnswersRequest) returns (SuggestFaqAnswersResponse) {
  124. option (google.api.http) = {
  125. post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers"
  126. body: "*"
  127. additional_bindings {
  128. post: "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers"
  129. body: "*"
  130. }
  131. };
  132. option (google.api.method_signature) = "parent";
  133. }
  134. // Gets smart replies for a participant based on specific historical
  135. // messages.
  136. rpc SuggestSmartReplies(SuggestSmartRepliesRequest) returns (SuggestSmartRepliesResponse) {
  137. option (google.api.http) = {
  138. post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies"
  139. body: "*"
  140. additional_bindings {
  141. post: "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies"
  142. body: "*"
  143. }
  144. };
  145. option (google.api.method_signature) = "parent";
  146. }
  147. // Deprecated: Use inline suggestion, event based suggestion or
  148. // Suggestion* API instead.
  149. // See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
  150. // details.
  151. // Removal Date: 2020-09-01.
  152. //
  153. // Retrieves suggestions for live agents.
  154. //
  155. // This method should be used by human agent client software to fetch auto
  156. // generated suggestions in real-time, while the conversation with an end user
  157. // is in progress. The functionality is implemented in terms of the
  158. // [list
  159. // pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination)
  160. // design pattern. The client app should use the `next_page_token` field
  161. // to fetch the next batch of suggestions. `suggestions` are sorted by
  162. // `create_time` in descending order.
  163. // To fetch latest suggestion, just set `page_size` to 1.
  164. // To fetch new suggestions without duplication, send request with filter
  165. // `create_time_epoch_microseconds > [first item's create_time of previous
  166. // request]` and empty page_token.
  167. rpc ListSuggestions(ListSuggestionsRequest) returns (ListSuggestionsResponse) {
  168. option deprecated = true;
  169. option (google.api.http) = {
  170. get: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions"
  171. };
  172. }
  173. // Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
  174. //
  175. // Gets suggestions for a participant based on specific historical
  176. // messages.
  177. //
  178. // Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
  179. // suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
  180. // based on the provided conversation context in the real time.
  181. rpc CompileSuggestion(CompileSuggestionRequest) returns (CompileSuggestionResponse) {
  182. option deprecated = true;
  183. option (google.api.http) = {
  184. post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:compile"
  185. body: "*"
  186. };
  187. }
  188. }
  189. // Represents a conversation participant (human agent, virtual agent, end-user).
  190. message Participant {
  191. option (google.api.resource) = {
  192. type: "dialogflow.googleapis.com/Participant"
  193. pattern: "projects/{project}/conversations/{conversation}/participants/{participant}"
  194. pattern: "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}"
  195. };
  196. // Enumeration of the roles a participant can play in a conversation.
  197. enum Role {
  198. // Participant role not set.
  199. ROLE_UNSPECIFIED = 0;
  200. // Participant is a human agent.
  201. HUMAN_AGENT = 1;
  202. // Participant is an automated agent, such as a Dialogflow agent.
  203. AUTOMATED_AGENT = 2;
  204. // Participant is an end user that has called or chatted with
  205. // Dialogflow services.
  206. END_USER = 3;
  207. }
  208. // Optional. The unique identifier of this participant.
  209. // Format: `projects/<Project ID>/locations/<Location
  210. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  211. string name = 1 [(google.api.field_behavior) = OPTIONAL];
  212. // Immutable. The role this participant plays in the conversation. This field must be set
  213. // during participant creation and is then immutable.
  214. Role role = 2 [(google.api.field_behavior) = IMMUTABLE];
  215. // Optional. Obfuscated user id that should be associated with the created participant.
  216. //
  217. // You can specify a user id as follows:
  218. //
  219. // 1. If you set this field in
  220. // [CreateParticipantRequest][google.cloud.dialogflow.v2beta1.CreateParticipantRequest.participant] or
  221. // [UpdateParticipantRequest][google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.participant],
  222. // Dialogflow adds the obfuscated user id with the participant.
  223. //
  224. // 2. If you set this field in
  225. // [AnalyzeContent][google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.obfuscated_external_user_id] or
  226. // [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
  227. // Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2beta1.Participant.obfuscated_external_user_id].
  228. //
  229. // Dialogflow uses this user id for following purposes:
  230. // 1) Billing and measurement. If user with the same
  231. // obfuscated_external_user_id is created in a later conversation, dialogflow
  232. // will know it's the same user. 2) Agent assist suggestion personalization.
  233. // For example, Dialogflow can use it to provide personalized smart reply
  234. // suggestions for this user.
  235. //
  236. // Note:
  237. //
  238. // * Please never pass raw user ids to Dialogflow. Always obfuscate your user
  239. // id first.
  240. // * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
  241. // hash function like SHA-512.
  242. // * The length of the user id must be <= 256 characters.
  243. string obfuscated_external_user_id = 7 [(google.api.field_behavior) = OPTIONAL];
  244. }
  245. // Represents a message posted into a conversation.
  246. message Message {
  247. option (google.api.resource) = {
  248. type: "dialogflow.googleapis.com/Message"
  249. pattern: "projects/{project}/conversations/{conversation}/messages/{message}"
  250. pattern: "projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}"
  251. };
  252. // Optional. The unique identifier of the message.
  253. // Format: `projects/<Project ID>/locations/<Location
  254. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  255. string name = 1 [(google.api.field_behavior) = OPTIONAL];
  256. // Required. The message content.
  257. string content = 2 [(google.api.field_behavior) = REQUIRED];
  258. // Optional. The message language.
  259. // This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
  260. // language tag. Example: "en-US".
  261. string language_code = 3 [(google.api.field_behavior) = OPTIONAL];
  262. // Output only. The participant that sends this message.
  263. string participant = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  264. // Output only. The role of the participant.
  265. Participant.Role participant_role = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  266. // Output only. The time when the message was created in Contact Center AI.
  267. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  268. // Optional. The time when the message was sent.
  269. google.protobuf.Timestamp send_time = 9 [(google.api.field_behavior) = OPTIONAL];
  270. // Output only. The annotation for the message.
  271. MessageAnnotation message_annotation = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  272. // Output only. The sentiment analysis result for the message.
  273. SentimentAnalysisResult sentiment_analysis = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  274. }
  275. // The request message for [Participants.CreateParticipant][google.cloud.dialogflow.v2beta1.Participants.CreateParticipant].
  276. message CreateParticipantRequest {
  277. // Required. Resource identifier of the conversation adding the participant.
  278. // Format: `projects/<Project ID>/locations/<Location
  279. // ID>/conversations/<Conversation ID>`.
  280. string parent = 1 [
  281. (google.api.field_behavior) = REQUIRED,
  282. (google.api.resource_reference) = {
  283. child_type: "dialogflow.googleapis.com/Participant"
  284. }
  285. ];
  286. // Required. The participant to create.
  287. Participant participant = 2 [(google.api.field_behavior) = REQUIRED];
  288. }
  289. // The request message for [Participants.GetParticipant][google.cloud.dialogflow.v2beta1.Participants.GetParticipant].
  290. message GetParticipantRequest {
  291. // Required. The name of the participant. Format:
  292. // `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
  293. // ID>/participants/<Participant ID>`.
  294. string name = 1 [
  295. (google.api.field_behavior) = REQUIRED,
  296. (google.api.resource_reference) = {
  297. type: "dialogflow.googleapis.com/Participant"
  298. }
  299. ];
  300. }
  301. // The request message for [Participants.ListParticipants][google.cloud.dialogflow.v2beta1.Participants.ListParticipants].
  302. message ListParticipantsRequest {
  303. // Required. The conversation to list all participants from.
  304. // Format: `projects/<Project ID>/locations/<Location
  305. // ID>/conversations/<Conversation ID>`.
  306. string parent = 1 [
  307. (google.api.field_behavior) = REQUIRED,
  308. (google.api.resource_reference) = {
  309. child_type: "dialogflow.googleapis.com/Participant"
  310. }
  311. ];
  312. // Optional. The maximum number of items to return in a single page. By
  313. // default 100 and at most 1000.
  314. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  315. // Optional. The next_page_token value returned from a previous list request.
  316. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  317. }
  318. // The response message for [Participants.ListParticipants][google.cloud.dialogflow.v2beta1.Participants.ListParticipants].
  319. message ListParticipantsResponse {
  320. // The list of participants. There is a maximum number of items
  321. // returned based on the page_size field in the request.
  322. repeated Participant participants = 1;
  323. // Token to retrieve the next page of results or empty if there are no
  324. // more results in the list.
  325. string next_page_token = 2;
  326. }
  327. // The request message for [Participants.UpdateParticipant][google.cloud.dialogflow.v2beta1.Participants.UpdateParticipant].
  328. message UpdateParticipantRequest {
  329. // Required. The participant to update.
  330. Participant participant = 1 [(google.api.field_behavior) = REQUIRED];
  331. // Required. The mask to specify which fields to update.
  332. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  333. }
  334. // Represents the natural language speech audio to be played to the end user.
  335. message OutputAudio {
  336. // Required. Instructs the speech synthesizer how to generate the speech
  337. // audio.
  338. OutputAudioConfig config = 1;
  339. // Required. The natural language speech audio.
  340. bytes audio = 2;
  341. }
  342. // Represents a response from an automated agent.
  343. message AutomatedAgentReply {
  344. // Represents different automated agent reply types.
  345. enum AutomatedAgentReplyType {
  346. // Not specified. This should never happen.
  347. AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0;
  348. // Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables
  349. // `return_partial_response` can be returned as partial reply.
  350. // WARNING: partial reply is not eligible for barge-in.
  351. PARTIAL = 1;
  352. // Final reply.
  353. FINAL = 2;
  354. }
  355. // Required.
  356. oneof response {
  357. // Response of the Dialogflow [Sessions.DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] call.
  358. DetectIntentResponse detect_intent_response = 1;
  359. }
  360. // Response messages from the automated agent.
  361. repeated ResponseMessage response_messages = 3;
  362. // Info on the query match for the automated agent response.
  363. oneof match {
  364. // Name of the intent if an intent is matched for the query.
  365. // For a V2 query, the value format is `projects/<Project ID>/locations/
  366. // <Location ID>/agent/intents/<Intent ID>`.
  367. // For a V3 query, the value format is `projects/<Project ID>/locations/
  368. // <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
  369. string intent = 4 [(google.api.resource_reference) = {
  370. type: "dialogflow.googleapis.com/Intent"
  371. }];
  372. // Event name if an event is triggered for the query.
  373. string event = 5;
  374. }
  375. // The confidence of the match. Values range from 0.0 (completely uncertain)
  376. // to 1.0 (completely certain).
  377. // This value is for informational purpose only and is only used to help match
  378. // the best intent within the classification threshold. This value may change
  379. // for the same end-user expression at any time due to a model retraining or
  380. // change in implementation.
  381. float match_confidence = 9;
  382. // The collection of current parameters at the time of this response.
  383. google.protobuf.Struct parameters = 10;
  384. // The collection of current Dialogflow CX agent session parameters at the
  385. // time of this response.
  386. // Deprecated: Use `parameters` instead.
  387. google.protobuf.Struct cx_session_parameters = 6 [deprecated = true];
  388. // AutomatedAgentReply type.
  389. AutomatedAgentReplyType automated_agent_reply_type = 7;
  390. // Indicates whether the partial automated agent reply is interruptible when a
  391. // later reply message arrives. e.g. if the agent specified some music as
  392. // partial response, it can be cancelled.
  393. bool allow_cancellation = 8;
  394. }
  395. // The type of Human Agent Assistant API suggestion to perform, and the maximum
  396. // number of results to return for that type. Multiple `Feature` objects can
  397. // be specified in the `features` list.
  398. message SuggestionFeature {
  399. // Defines the type of Human Agent Assistant feature.
  400. enum Type {
  401. // Unspecified feature type.
  402. TYPE_UNSPECIFIED = 0;
  403. // Run article suggestion model.
  404. ARTICLE_SUGGESTION = 1;
  405. // Run FAQ model.
  406. FAQ = 2;
  407. // Run smart reply model.
  408. SMART_REPLY = 3;
  409. }
  410. // Type of Human Agent Assistant API feature to request.
  411. Type type = 1;
  412. }
  413. // The request message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent].
  414. message AnalyzeContentRequest {
  415. // Required. The name of the participant this text comes from.
  416. // Format: `projects/<Project ID>/locations/<Location
  417. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  418. string participant = 1 [
  419. (google.api.field_behavior) = REQUIRED,
  420. (google.api.resource_reference) = {
  421. type: "dialogflow.googleapis.com/Participant"
  422. }
  423. ];
  424. // Required. The input content.
  425. oneof input {
  426. // The natural language text to be processed.
  427. TextInput text_input = 6;
  428. // An input event to send to Dialogflow.
  429. EventInput event_input = 8;
  430. }
  431. // Speech synthesis configuration.
  432. // The speech synthesis settings for a virtual agent that may be configured
  433. // for the associated conversation profile are not used when calling
  434. // AnalyzeContent. If this configuration is not supplied, speech synthesis
  435. // is disabled.
  436. OutputAudioConfig reply_audio_config = 5;
  437. // Parameters for a Dialogflow virtual-agent query.
  438. QueryParameters query_params = 9;
  439. // Optional. The send time of the message from end user or human agent's
  440. // perspective. It is used for identifying the same message under one
  441. // participant.
  442. //
  443. // Given two messages under the same participant:
  444. // - If send time are different regardless of whether the content of the
  445. // messages are exactly the same, the conversation will regard them as
  446. // two distinct messages sent by the participant.
  447. // - If send time is the same regardless of whether the content of the
  448. // messages are exactly the same, the conversation will regard them as
  449. // same message, and ignore the message received later.
  450. //
  451. // If the value is not provided, a new request will always be regarded as a
  452. // new message without any de-duplication.
  453. google.protobuf.Timestamp message_send_time = 10;
  454. // A unique identifier for this request. Restricted to 36 ASCII characters.
  455. // A random UUID is recommended.
  456. // This request is only idempotent if a `request_id` is provided.
  457. string request_id = 11;
  458. }
  459. // The message in the response that indicates the parameters of DTMF.
  460. message DtmfParameters {
  461. // Indicates whether DTMF input can be handled in the next request.
  462. bool accepts_dtmf_input = 1;
  463. }
  464. // The response message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent].
  465. message AnalyzeContentResponse {
  466. // Output only. The output text content.
  467. // This field is set if the automated agent responded with text to show to
  468. // the user.
  469. string reply_text = 1;
  470. // Optional. The audio data bytes encoded as specified in the request.
  471. // This field is set if:
  472. //
  473. // - `reply_audio_config` was specified in the request, or
  474. // - The automated agent responded with audio to play to the user. In such
  475. // case, `reply_audio.config` contains settings used to synthesize the
  476. // speech.
  477. //
  478. // In some scenarios, multiple output audio fields may be present in the
  479. // response structure. In these cases, only the top-most-level audio output
  480. // has content.
  481. OutputAudio reply_audio = 2;
  482. // Optional. Only set if a Dialogflow automated agent has responded.
  483. // Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
  484. // and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
  485. // are always empty, use [reply_audio][google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.reply_audio] instead.
  486. AutomatedAgentReply automated_agent_reply = 3;
  487. // Output only. Message analyzed by CCAI.
  488. Message message = 5;
  489. // The suggestions for most recent human agent. The order is the same as
  490. // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
  491. // [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.human_agent_suggestion_config].
  492. repeated SuggestionResult human_agent_suggestion_results = 6;
  493. // The suggestions for end user. The order is the same as
  494. // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
  495. // [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.end_user_suggestion_config].
  496. repeated SuggestionResult end_user_suggestion_results = 7;
  497. // Indicates the parameters of DTMF.
  498. DtmfParameters dtmf_parameters = 9;
  499. }
  500. // Represents a part of a message possibly annotated with an entity. The part
  501. // can be an entity or purely a part of the message between two entities or
  502. // message start/end.
  503. message AnnotatedMessagePart {
  504. // Required. A part of a message possibly annotated with an entity.
  505. string text = 1;
  506. // Optional. The [Dialogflow system entity
  507. // type](https://cloud.google.com/dialogflow/docs/reference/system-entities)
  508. // of this message part. If this is empty, Dialogflow could not annotate the
  509. // phrase part with a system entity.
  510. string entity_type = 2;
  511. // Optional. The [Dialogflow system entity formatted value
  512. // ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of
  513. // this message part. For example for a system entity of type
  514. // `@sys.unit-currency`, this may contain:
  515. // <pre>
  516. // {
  517. // "amount": 5,
  518. // "currency": "USD"
  519. // }
  520. // </pre>
  521. google.protobuf.Value formatted_value = 3;
  522. }
  523. // Represents the result of annotation for the message.
  524. message MessageAnnotation {
  525. // Optional. The collection of annotated message parts ordered by their
  526. // position in the message. You can recover the annotated message by
  527. // concatenating [AnnotatedMessagePart.text].
  528. repeated AnnotatedMessagePart parts = 1;
  529. // Required. Indicates whether the text message contains entities.
  530. bool contain_entities = 2;
  531. }
  532. // Represents article answer.
  533. message ArticleAnswer {
  534. // The article title.
  535. string title = 1;
  536. // The article URI.
  537. string uri = 2;
  538. // Output only. Article snippets.
  539. repeated string snippets = 3;
  540. // A map that contains metadata about the answer and the
  541. // document from which it originates.
  542. map<string, string> metadata = 5;
  543. // The name of answer record, in the format of
  544. // "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
  545. // ID>"
  546. string answer_record = 6;
  547. }
  548. // Represents answer from "frequently asked questions".
  549. message FaqAnswer {
  550. // The piece of text from the `source` knowledge base document.
  551. string answer = 1;
  552. // The system's confidence score that this Knowledge answer is a good match
  553. // for this conversational query, range from 0.0 (completely uncertain)
  554. // to 1.0 (completely certain).
  555. float confidence = 2;
  556. // The corresponding FAQ question.
  557. string question = 3;
  558. // Indicates which Knowledge Document this answer was extracted
  559. // from.
  560. // Format: `projects/<Project ID>/locations/<Location
  561. // ID>/agent/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
  562. string source = 4;
  563. // A map that contains metadata about the answer and the
  564. // document from which it originates.
  565. map<string, string> metadata = 5;
  566. // The name of answer record, in the format of
  567. // "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
  568. // ID>"
  569. string answer_record = 6;
  570. }
  571. // Represents a smart reply answer.
  572. message SmartReplyAnswer {
  573. // The content of the reply.
  574. string reply = 1;
  575. // Smart reply confidence.
  576. // The system's confidence score that this reply is a good match for
  577. // this conversation, as a value from 0.0 (completely uncertain) to 1.0
  578. // (completely certain).
  579. float confidence = 2;
  580. // The name of answer record, in the format of
  581. // "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
  582. // ID>"
  583. string answer_record = 3;
  584. }
  585. // One response of different type of suggestion response which is used in
  586. // the response of [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] and
  587. // [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent], as well as [HumanAgentAssistantEvent][google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent].
  588. message SuggestionResult {
  589. // Different type of suggestion response.
  590. oneof suggestion_response {
  591. // Error status if the request failed.
  592. google.rpc.Status error = 1;
  593. // SuggestArticlesResponse if request is for ARTICLE_SUGGESTION.
  594. SuggestArticlesResponse suggest_articles_response = 2;
  595. // SuggestFaqAnswersResponse if request is for FAQ_ANSWER.
  596. SuggestFaqAnswersResponse suggest_faq_answers_response = 3;
  597. // SuggestSmartRepliesResponse if request is for SMART_REPLY.
  598. SuggestSmartRepliesResponse suggest_smart_replies_response = 4;
  599. }
  600. }
  601. // The request message for [Participants.SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles].
  602. message SuggestArticlesRequest {
  603. // Required. The name of the participant to fetch suggestion for.
  604. // Format: `projects/<Project ID>/locations/<Location
  605. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  606. string parent = 1 [
  607. (google.api.field_behavior) = REQUIRED,
  608. (google.api.resource_reference) = {
  609. type: "dialogflow.googleapis.com/Participant"
  610. }
  611. ];
  612. // Optional. The name of the latest conversation message to compile suggestion
  613. // for. If empty, it will be the latest message of the conversation.
  614. //
  615. // Format: `projects/<Project ID>/locations/<Location
  616. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  617. string latest_message = 2 [
  618. (google.api.field_behavior) = OPTIONAL,
  619. (google.api.resource_reference) = {
  620. type: "dialogflow.googleapis.com/Message"
  621. }
  622. ];
  623. // Optional. Max number of messages prior to and including
  624. // [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message] to use as context
  625. // when compiling the suggestion. By default 20 and at most 50.
  626. int32 context_size = 3 [(google.api.field_behavior) = OPTIONAL];
  627. }
  628. // The response message for [Participants.SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles].
  629. message SuggestArticlesResponse {
  630. // Output only. Articles ordered by score in descending order.
  631. repeated ArticleAnswer article_answers = 1;
  632. // The name of the latest conversation message used to compile
  633. // suggestion for.
  634. //
  635. // Format: `projects/<Project ID>/locations/<Location
  636. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  637. string latest_message = 2;
  638. // Number of messages prior to and including
  639. // [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.latest_message] to compile the
  640. // suggestion. It may be smaller than the
  641. // [SuggestArticlesResponse.context_size][google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.context_size] field in the request if there
  642. // aren't that many messages in the conversation.
  643. int32 context_size = 3;
  644. }
  645. // The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers].
  646. message SuggestFaqAnswersRequest {
  647. // Required. The name of the participant to fetch suggestion for.
  648. // Format: `projects/<Project ID>/locations/<Location
  649. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  650. string parent = 1 [
  651. (google.api.field_behavior) = REQUIRED,
  652. (google.api.resource_reference) = {
  653. type: "dialogflow.googleapis.com/Participant"
  654. }
  655. ];
  656. // Optional. The name of the latest conversation message to compile suggestion
  657. // for. If empty, it will be the latest message of the conversation.
  658. //
  659. // Format: `projects/<Project ID>/locations/<Location
  660. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  661. string latest_message = 2 [
  662. (google.api.field_behavior) = OPTIONAL,
  663. (google.api.resource_reference) = {
  664. type: "dialogflow.googleapis.com/Message"
  665. }
  666. ];
  667. // Optional. Max number of messages prior to and including
  668. // [latest_message] to use as context when compiling the
  669. // suggestion. By default 20 and at most 50.
  670. int32 context_size = 3 [(google.api.field_behavior) = OPTIONAL];
  671. }
  672. // The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers].
  673. message SuggestFaqAnswersResponse {
  674. // Output only. Answers extracted from FAQ documents.
  675. repeated FaqAnswer faq_answers = 1;
  676. // The name of the latest conversation message used to compile
  677. // suggestion for.
  678. //
  679. // Format: `projects/<Project ID>/locations/<Location
  680. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  681. string latest_message = 2;
  682. // Number of messages prior to and including
  683. // [latest_message][google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.latest_message] to compile the
  684. // suggestion. It may be smaller than the
  685. // [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.context_size] field in the request if there
  686. // aren't that many messages in the conversation.
  687. int32 context_size = 3;
  688. }
  689. // The request message for [Participants.SuggestSmartReplies][google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies].
  690. message SuggestSmartRepliesRequest {
  691. // Required. The name of the participant to fetch suggestion for.
  692. // Format: `projects/<Project ID>/locations/<Location
  693. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  694. string parent = 1 [
  695. (google.api.field_behavior) = REQUIRED,
  696. (google.api.resource_reference) = {
  697. type: "dialogflow.googleapis.com/Participant"
  698. }
  699. ];
  700. // The current natural language text segment to compile suggestion
  701. // for. This provides a way for user to get follow up smart reply suggestion
  702. // after a smart reply selection, without sending a text message.
  703. TextInput current_text_input = 4;
  704. // The name of the latest conversation message to compile suggestion
  705. // for. If empty, it will be the latest message of the conversation.
  706. //
  707. // Format: `projects/<Project ID>/locations/<Location
  708. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  709. string latest_message = 2 [(google.api.resource_reference) = {
  710. type: "dialogflow.googleapis.com/Message"
  711. }];
  712. // Optional. Max number of messages prior to and including
  713. // [latest_message] to use as context when compiling the
  714. // suggestion. By default 20 and at most 50.
  715. int32 context_size = 3;
  716. }
  717. // The response message for [Participants.SuggestSmartReplies][google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies].
  718. message SuggestSmartRepliesResponse {
  719. // Output only. Multiple reply options provided by smart reply service. The
  720. // order is based on the rank of the model prediction.
  721. // The maximum number of the returned replies is set in SmartReplyConfig.
  722. repeated SmartReplyAnswer smart_reply_answers = 1;
  723. // The name of the latest conversation message used to compile
  724. // suggestion for.
  725. //
  726. // Format: `projects/<Project ID>/locations/<Location
  727. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  728. string latest_message = 2;
  729. // Number of messages prior to and including
  730. // [latest_message][google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.latest_message] to compile the
  731. // suggestion. It may be smaller than the
  732. // [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.context_size] field in the request if there
  733. // aren't that many messages in the conversation.
  734. int32 context_size = 3;
  735. }
  736. // Represents a suggestion for a human agent.
  737. message Suggestion {
  738. option deprecated = true;
  739. // Represents suggested article.
  740. message Article {
  741. // Output only. The article title.
  742. string title = 1;
  743. // Output only. The article URI.
  744. string uri = 2;
  745. // Output only. Article snippets.
  746. repeated string snippets = 3;
  747. // Output only. A map that contains metadata about the answer and the
  748. // document from which it originates.
  749. map<string, string> metadata = 5;
  750. // Output only. The name of answer record, in the format of
  751. // "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer
  752. // Record ID>"
  753. string answer_record = 6;
  754. }
  755. // Represents suggested answer from "frequently asked questions".
  756. message FaqAnswer {
  757. // Output only. The piece of text from the `source` knowledge base document.
  758. string answer = 1;
  759. // The system's confidence score that this Knowledge answer is a good match
  760. // for this conversational query, range from 0.0 (completely uncertain)
  761. // to 1.0 (completely certain).
  762. float confidence = 2;
  763. // Output only. The corresponding FAQ question.
  764. string question = 3;
  765. // Output only. Indicates which Knowledge Document this answer was extracted
  766. // from.
  767. // Format: `projects/<Project ID>/locations/<Location
  768. // ID>/agent/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
  769. string source = 4;
  770. // Output only. A map that contains metadata about the answer and the
  771. // document from which it originates.
  772. map<string, string> metadata = 5;
  773. // Output only. The name of answer record, in the format of
  774. // "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer
  775. // Record ID>"
  776. string answer_record = 6;
  777. }
  778. // Output only. The name of this suggestion.
  779. // Format:
  780. // `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
  781. // ID>/participants/*/suggestions/<Suggestion ID>`.
  782. string name = 1;
  783. // Output only. Articles ordered by score in descending order.
  784. repeated Article articles = 2;
  785. // Output only. Answers extracted from FAQ documents.
  786. repeated FaqAnswer faq_answers = 4;
  787. // Output only. The time the suggestion was created.
  788. google.protobuf.Timestamp create_time = 5;
  789. // Output only. Latest message used as context to compile this suggestion.
  790. //
  791. // Format: `projects/<Project ID>/locations/<Location
  792. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  793. string latest_message = 7;
  794. }
  795. // The request message for [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions].
  796. message ListSuggestionsRequest {
  797. option deprecated = true;
  798. // Required. The name of the participant to fetch suggestions for.
  799. // Format: `projects/<Project ID>/locations/<Location
  800. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  801. string parent = 1;
  802. // Optional. The maximum number of items to return in a single page. The
  803. // default value is 100; the maximum value is 1000.
  804. int32 page_size = 2;
  805. // Optional. The next_page_token value returned from a previous list request.
  806. string page_token = 3;
  807. // Optional. Filter on suggestions fields. Currently predicates on
  808. // `create_time` and `create_time_epoch_microseconds` are supported.
  809. // `create_time` only support milliseconds accuracy. E.g.,
  810. // `create_time_epoch_microseconds > 1551790877964485` or
  811. // `create_time > "2017-01-15T01:30:15.01Z"`
  812. //
  813. // For more information about filtering, see
  814. // [API Filtering](https://aip.dev/160).
  815. string filter = 4;
  816. }
  817. // The response message for [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions].
  818. message ListSuggestionsResponse {
  819. option deprecated = true;
  820. // Required. The list of suggestions. There will be a maximum number of items
  821. // returned based on the page_size field in the request. `suggestions` is
  822. // sorted by `create_time` in descending order.
  823. repeated Suggestion suggestions = 1;
  824. // Optional. Token to retrieve the next page of results or empty if there are
  825. // no more results in the list.
  826. string next_page_token = 2;
  827. }
  828. // The request message for [Participants.CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion].
  829. message CompileSuggestionRequest {
  830. option deprecated = true;
  831. // Required. The name of the participant to fetch suggestion for.
  832. // Format: `projects/<Project ID>/locations/<Location
  833. // ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
  834. string parent = 1;
  835. // Optional. The name of the latest conversation message to compile suggestion
  836. // for. If empty, it will be the latest message of the conversation.
  837. //
  838. // Format: `projects/<Project ID>/locations/<Location
  839. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  840. string latest_message = 2;
  841. // Optional. Max number of messages prior to and including
  842. // [latest_message] to use as context when compiling the
  843. // suggestion. If zero or less than zero, 20 is used.
  844. int32 context_size = 3;
  845. }
  846. // The response message for [Participants.CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion].
  847. message CompileSuggestionResponse {
  848. option deprecated = true;
  849. // The compiled suggestion.
  850. Suggestion suggestion = 1;
  851. // The name of the latest conversation message used to compile
  852. // suggestion for.
  853. //
  854. // Format: `projects/<Project ID>/locations/<Location
  855. // ID>/conversations/<Conversation ID>/messages/<Message ID>`.
  856. string latest_message = 2;
  857. // Number of messages prior to and including
  858. // [latest_message][google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.latest_message]
  859. // to compile the suggestion. It may be smaller than the
  860. // [CompileSuggestionRequest.context_size][google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.context_size] field in the request if
  861. // there aren't that many messages in the conversation.
  862. int32 context_size = 3;
  863. }
  864. // Response messages from an automated agent.
  865. message ResponseMessage {
  866. // The text response message.
  867. message Text {
  868. // A collection of text responses.
  869. repeated string text = 1;
  870. }
  871. // Indicates that the conversation should be handed off to a human agent.
  872. //
  873. // Dialogflow only uses this to determine which conversations were handed off
  874. // to a human agent for measurement purposes. What else to do with this signal
  875. // is up to you and your handoff procedures.
  876. //
  877. // You may set this, for example:
  878. // * In the entry fulfillment of a CX Page if entering the page indicates
  879. // something went extremely wrong in the conversation.
  880. // * In a webhook response when you determine that the customer issue can only
  881. // be handled by a human.
  882. message LiveAgentHandoff {
  883. // Custom metadata for your handoff procedure. Dialogflow doesn't impose
  884. // any structure on this.
  885. google.protobuf.Struct metadata = 1;
  886. }
  887. // Indicates that interaction with the Dialogflow agent has ended.
  888. message EndInteraction {
  889. }
  890. // Required. The rich response message.
  891. oneof message {
  892. // Returns a text response.
  893. Text text = 1;
  894. // Returns a response containing a custom, platform-specific payload.
  895. google.protobuf.Struct payload = 2;
  896. // Hands off conversation to a live agent.
  897. LiveAgentHandoff live_agent_handoff = 3;
  898. // A signal that indicates the interaction with the Dialogflow agent has
  899. // ended.
  900. EndInteraction end_interaction = 4;
  901. }
  902. }