GoogleCloudContactcenterinsightsV1QaQuestion.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Contactcenterinsights;
  18. class GoogleCloudContactcenterinsightsV1QaQuestion extends \Google\Collection
  19. {
  20. /**
  21. * The type of the question is unspecified.
  22. */
  23. public const QUESTION_TYPE_QA_QUESTION_TYPE_UNSPECIFIED = 'QA_QUESTION_TYPE_UNSPECIFIED';
  24. /**
  25. * The default question type. The question is fully customizable by the user.
  26. */
  27. public const QUESTION_TYPE_CUSTOMIZABLE = 'CUSTOMIZABLE';
  28. /**
  29. * The question type is using a predefined model provided by CCAI teams. Users
  30. * are not allowed to edit the question_body, answer_choices, upload feedback
  31. * labels for the question nor fine-tune the question. However, users may edit
  32. * other fields like question tags, question order, etc.
  33. */
  34. public const QUESTION_TYPE_PREDEFINED = 'PREDEFINED';
  35. protected $collection_key = 'tags';
  36. /**
  37. * Short, descriptive string, used in the UI where it's not practical to
  38. * display the full question body. E.g., "Greeting".
  39. *
  40. * @var string
  41. */
  42. public $abbreviation;
  43. protected $answerChoicesType = GoogleCloudContactcenterinsightsV1QaQuestionAnswerChoice::class;
  44. protected $answerChoicesDataType = 'array';
  45. /**
  46. * Instructions describing how to determine the answer.
  47. *
  48. * @var string
  49. */
  50. public $answerInstructions;
  51. /**
  52. * Output only. The time at which this question was created.
  53. *
  54. * @var string
  55. */
  56. public $createTime;
  57. protected $metricsType = GoogleCloudContactcenterinsightsV1QaQuestionMetrics::class;
  58. protected $metricsDataType = '';
  59. /**
  60. * Identifier. The resource name of the question. Format: projects/{project}/l
  61. * ocations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQues
  62. * tions/{qa_question}
  63. *
  64. * @var string
  65. */
  66. public $name;
  67. /**
  68. * Defines the order of the question within its parent scorecard revision.
  69. *
  70. * @var int
  71. */
  72. public $order;
  73. protected $predefinedQuestionConfigType = GoogleCloudContactcenterinsightsV1QaQuestionPredefinedQuestionConfig::class;
  74. protected $predefinedQuestionConfigDataType = '';
  75. protected $qaQuestionDataOptionsType = GoogleCloudContactcenterinsightsV1QaQuestionQaQuestionDataOptions::class;
  76. protected $qaQuestionDataOptionsDataType = '';
  77. /**
  78. * Question text. E.g., "Did the agent greet the customer?"
  79. *
  80. * @var string
  81. */
  82. public $questionBody;
  83. /**
  84. * The type of question.
  85. *
  86. * @var string
  87. */
  88. public $questionType;
  89. /**
  90. * Questions are tagged for categorization and scoring. Tags can either be: -
  91. * Default Tags: These are predefined categories. They are identified by their
  92. * string value (e.g., "BUSINESS", "COMPLIANCE", and "CUSTOMER"). - Custom
  93. * Tags: These are user-defined categories. They are identified by their full
  94. * resource name (e.g.,
  95. * projects/{project}/locations/{location}/qaQuestionTags/{qa_question_tag}).
  96. * Both default and custom tags are used to group questions and to influence
  97. * the scoring of each question.
  98. *
  99. * @var string[]
  100. */
  101. public $tags;
  102. protected $tuningMetadataType = GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata::class;
  103. protected $tuningMetadataDataType = '';
  104. /**
  105. * Output only. The most recent time at which the question was updated.
  106. *
  107. * @var string
  108. */
  109. public $updateTime;
  110. /**
  111. * Short, descriptive string, used in the UI where it's not practical to
  112. * display the full question body. E.g., "Greeting".
  113. *
  114. * @param string $abbreviation
  115. */
  116. public function setAbbreviation($abbreviation)
  117. {
  118. $this->abbreviation = $abbreviation;
  119. }
  120. /**
  121. * @return string
  122. */
  123. public function getAbbreviation()
  124. {
  125. return $this->abbreviation;
  126. }
  127. /**
  128. * A list of valid answers to the question, which the LLM must choose from.
  129. *
  130. * @param GoogleCloudContactcenterinsightsV1QaQuestionAnswerChoice[] $answerChoices
  131. */
  132. public function setAnswerChoices($answerChoices)
  133. {
  134. $this->answerChoices = $answerChoices;
  135. }
  136. /**
  137. * @return GoogleCloudContactcenterinsightsV1QaQuestionAnswerChoice[]
  138. */
  139. public function getAnswerChoices()
  140. {
  141. return $this->answerChoices;
  142. }
  143. /**
  144. * Instructions describing how to determine the answer.
  145. *
  146. * @param string $answerInstructions
  147. */
  148. public function setAnswerInstructions($answerInstructions)
  149. {
  150. $this->answerInstructions = $answerInstructions;
  151. }
  152. /**
  153. * @return string
  154. */
  155. public function getAnswerInstructions()
  156. {
  157. return $this->answerInstructions;
  158. }
  159. /**
  160. * Output only. The time at which this question was created.
  161. *
  162. * @param string $createTime
  163. */
  164. public function setCreateTime($createTime)
  165. {
  166. $this->createTime = $createTime;
  167. }
  168. /**
  169. * @return string
  170. */
  171. public function getCreateTime()
  172. {
  173. return $this->createTime;
  174. }
  175. /**
  176. * Metrics of the underlying tuned LLM over a holdout/test set while fine
  177. * tuning the underlying LLM for the given question. This field will only be
  178. * populated if and only if the question is part of a scorecard revision that
  179. * has been tuned.
  180. *
  181. * @param GoogleCloudContactcenterinsightsV1QaQuestionMetrics $metrics
  182. */
  183. public function setMetrics(GoogleCloudContactcenterinsightsV1QaQuestionMetrics $metrics)
  184. {
  185. $this->metrics = $metrics;
  186. }
  187. /**
  188. * @return GoogleCloudContactcenterinsightsV1QaQuestionMetrics
  189. */
  190. public function getMetrics()
  191. {
  192. return $this->metrics;
  193. }
  194. /**
  195. * Identifier. The resource name of the question. Format: projects/{project}/l
  196. * ocations/{location}/qaScorecards/{qa_scorecard}/revisions/{revision}/qaQues
  197. * tions/{qa_question}
  198. *
  199. * @param string $name
  200. */
  201. public function setName($name)
  202. {
  203. $this->name = $name;
  204. }
  205. /**
  206. * @return string
  207. */
  208. public function getName()
  209. {
  210. return $this->name;
  211. }
  212. /**
  213. * Defines the order of the question within its parent scorecard revision.
  214. *
  215. * @param int $order
  216. */
  217. public function setOrder($order)
  218. {
  219. $this->order = $order;
  220. }
  221. /**
  222. * @return int
  223. */
  224. public function getOrder()
  225. {
  226. return $this->order;
  227. }
  228. /**
  229. * The configuration of the predefined question. This field will only be set
  230. * if the Question Type is predefined.
  231. *
  232. * @param GoogleCloudContactcenterinsightsV1QaQuestionPredefinedQuestionConfig $predefinedQuestionConfig
  233. */
  234. public function setPredefinedQuestionConfig(GoogleCloudContactcenterinsightsV1QaQuestionPredefinedQuestionConfig $predefinedQuestionConfig)
  235. {
  236. $this->predefinedQuestionConfig = $predefinedQuestionConfig;
  237. }
  238. /**
  239. * @return GoogleCloudContactcenterinsightsV1QaQuestionPredefinedQuestionConfig
  240. */
  241. public function getPredefinedQuestionConfig()
  242. {
  243. return $this->predefinedQuestionConfig;
  244. }
  245. /**
  246. * Options for configuring the data used to generate the QA question.
  247. *
  248. * @param GoogleCloudContactcenterinsightsV1QaQuestionQaQuestionDataOptions $qaQuestionDataOptions
  249. */
  250. public function setQaQuestionDataOptions(GoogleCloudContactcenterinsightsV1QaQuestionQaQuestionDataOptions $qaQuestionDataOptions)
  251. {
  252. $this->qaQuestionDataOptions = $qaQuestionDataOptions;
  253. }
  254. /**
  255. * @return GoogleCloudContactcenterinsightsV1QaQuestionQaQuestionDataOptions
  256. */
  257. public function getQaQuestionDataOptions()
  258. {
  259. return $this->qaQuestionDataOptions;
  260. }
  261. /**
  262. * Question text. E.g., "Did the agent greet the customer?"
  263. *
  264. * @param string $questionBody
  265. */
  266. public function setQuestionBody($questionBody)
  267. {
  268. $this->questionBody = $questionBody;
  269. }
  270. /**
  271. * @return string
  272. */
  273. public function getQuestionBody()
  274. {
  275. return $this->questionBody;
  276. }
  277. /**
  278. * The type of question.
  279. *
  280. * Accepted values: QA_QUESTION_TYPE_UNSPECIFIED, CUSTOMIZABLE, PREDEFINED
  281. *
  282. * @param self::QUESTION_TYPE_* $questionType
  283. */
  284. public function setQuestionType($questionType)
  285. {
  286. $this->questionType = $questionType;
  287. }
  288. /**
  289. * @return self::QUESTION_TYPE_*
  290. */
  291. public function getQuestionType()
  292. {
  293. return $this->questionType;
  294. }
  295. /**
  296. * Questions are tagged for categorization and scoring. Tags can either be: -
  297. * Default Tags: These are predefined categories. They are identified by their
  298. * string value (e.g., "BUSINESS", "COMPLIANCE", and "CUSTOMER"). - Custom
  299. * Tags: These are user-defined categories. They are identified by their full
  300. * resource name (e.g.,
  301. * projects/{project}/locations/{location}/qaQuestionTags/{qa_question_tag}).
  302. * Both default and custom tags are used to group questions and to influence
  303. * the scoring of each question.
  304. *
  305. * @param string[] $tags
  306. */
  307. public function setTags($tags)
  308. {
  309. $this->tags = $tags;
  310. }
  311. /**
  312. * @return string[]
  313. */
  314. public function getTags()
  315. {
  316. return $this->tags;
  317. }
  318. /**
  319. * Metadata about the tuning operation for the question.This field will only
  320. * be populated if and only if the question is part of a scorecard revision
  321. * that has been tuned.
  322. *
  323. * @param GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata $tuningMetadata
  324. */
  325. public function setTuningMetadata(GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata $tuningMetadata)
  326. {
  327. $this->tuningMetadata = $tuningMetadata;
  328. }
  329. /**
  330. * @return GoogleCloudContactcenterinsightsV1QaQuestionTuningMetadata
  331. */
  332. public function getTuningMetadata()
  333. {
  334. return $this->tuningMetadata;
  335. }
  336. /**
  337. * Output only. The most recent time at which the question was updated.
  338. *
  339. * @param string $updateTime
  340. */
  341. public function setUpdateTime($updateTime)
  342. {
  343. $this->updateTime = $updateTime;
  344. }
  345. /**
  346. * @return string
  347. */
  348. public function getUpdateTime()
  349. {
  350. return $this->updateTime;
  351. }
  352. }
  353. // Adding a class alias for backwards compatibility with the previous class name.
  354. class_alias(GoogleCloudContactcenterinsightsV1QaQuestion::class, 'Google_Service_Contactcenterinsights_GoogleCloudContactcenterinsightsV1QaQuestion');