1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073
/// Information for a word recognized by the speech recognizer.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeechWordInfo {
/// The word this info is for.
#[prost(string, tag="3")]
pub word: ::prost::alloc::string::String,
/// Time offset relative to the beginning of the audio that corresponds to the
/// start of the spoken word. This is an experimental feature and the accuracy
/// of the time offset can vary.
#[prost(message, optional, tag="1")]
pub start_offset: ::core::option::Option<::prost_types::Duration>,
/// Time offset relative to the beginning of the audio that corresponds to the
/// end of the spoken word. This is an experimental feature and the accuracy of
/// the time offset can vary.
#[prost(message, optional, tag="2")]
pub end_offset: ::core::option::Option<::prost_types::Duration>,
/// The Speech confidence between 0.0 and 1.0 for this word. A higher number
/// indicates an estimated greater likelihood that the recognized word is
/// correct. The default of 0.0 is a sentinel value indicating that confidence
/// was not set.
///
/// This field is not guaranteed to be fully stable over time for the same
/// audio input. Users should also not rely on it to always be provided.
#[prost(float, tag="4")]
pub confidence: f32,
}
/// Instructs the speech recognizer on how to process the audio content.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InputAudioConfig {
/// Required. Audio encoding of the audio content to process.
#[prost(enumeration="AudioEncoding", tag="1")]
pub audio_encoding: i32,
/// Sample rate (in Hertz) of the audio content sent in the query.
/// Refer to
/// [Cloud Speech API
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics>) for
/// more details.
#[prost(int32, tag="2")]
pub sample_rate_hertz: i32,
/// Optional. If `true`, Dialogflow returns \[SpeechWordInfo][google.cloud.dialogflow.cx.v3.SpeechWordInfo\] in
/// \[StreamingRecognitionResult][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult\] with information about the recognized speech
/// words, e.g. start and end time offsets. If false or unspecified, Speech
/// doesn't return any word-level information.
#[prost(bool, tag="13")]
pub enable_word_info: bool,
/// Optional. A list of strings containing words and phrases that the speech
/// recognizer should recognize with higher likelihood.
///
/// See [the Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics#phrase-hints>)
/// for more details.
#[prost(string, repeated, tag="4")]
pub phrase_hints: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. Which Speech model to select for the given request. Select the
/// model best suited to your domain to get best results. If a model is not
/// explicitly specified, then we auto-select a model based on the parameters
/// in the InputAudioConfig.
/// If enhanced speech model is enabled for the agent and an enhanced
/// version of the specified model for the language does not exist, then the
/// speech is recognized using the standard version of the specified model.
/// Refer to
/// [Cloud Speech API
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics#select-model>)
/// for more details.
#[prost(string, tag="7")]
pub model: ::prost::alloc::string::String,
/// Optional. Which variant of the [Speech model]\[google.cloud.dialogflow.cx.v3.InputAudioConfig.model\] to use.
#[prost(enumeration="SpeechModelVariant", tag="10")]
pub model_variant: i32,
/// Optional. If `false` (default), recognition does not cease until the
/// client closes the stream.
/// If `true`, the recognizer will detect a single spoken utterance in input
/// audio. Recognition ceases when it detects the audio's voice has
/// stopped or paused. In this case, once a detected intent is received, the
/// client should close the stream and start a new request with a new stream as
/// needed.
/// Note: This setting is relevant only for streaming methods.
#[prost(bool, tag="8")]
pub single_utterance: bool,
}
/// Description of which voice to use for speech synthesis.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VoiceSelectionParams {
/// Optional. The name of the voice. If not set, the service will choose a
/// voice based on the other parameters such as language_code and
/// \[ssml_gender][google.cloud.dialogflow.cx.v3.VoiceSelectionParams.ssml_gender\].
///
/// For the list of available voices, please refer to [Supported voices and
/// languages](<https://cloud.google.com/text-to-speech/docs/voices>).
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Optional. The preferred gender of the voice. If not set, the service will
/// choose a voice based on the other parameters such as language_code and
/// \[name][google.cloud.dialogflow.cx.v3.VoiceSelectionParams.name\]. Note that this is only a preference, not requirement. If a
/// voice of the appropriate gender is not available, the synthesizer
/// substitutes a voice with a different gender rather than failing the
/// request.
#[prost(enumeration="SsmlVoiceGender", tag="2")]
pub ssml_gender: i32,
}
/// Configuration of how speech should be synthesized.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SynthesizeSpeechConfig {
/// Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
/// native speed supported by the specific voice. 2.0 is twice as fast, and
/// 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
/// other values < 0.25 or > 4.0 will return an error.
#[prost(double, tag="1")]
pub speaking_rate: f64,
/// Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
/// semitones from the original pitch. -20 means decrease 20 semitones from the
/// original pitch.
#[prost(double, tag="2")]
pub pitch: f64,
/// Optional. Volume gain (in dB) of the normal native volume supported by the
/// specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
/// 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
/// will play at approximately half the amplitude of the normal native signal
/// amplitude. A value of +6.0 (dB) will play at approximately twice the
/// amplitude of the normal native signal amplitude. We strongly recommend not
/// to exceed +10 (dB) as there's usually no effective increase in loudness for
/// any value greater than that.
#[prost(double, tag="3")]
pub volume_gain_db: f64,
/// Optional. An identifier which selects 'audio effects' profiles that are
/// applied on (post synthesized) text to speech. Effects are applied on top of
/// each other in the order they are given.
#[prost(string, repeated, tag="5")]
pub effects_profile_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. The desired voice of the synthesized audio.
#[prost(message, optional, tag="4")]
pub voice: ::core::option::Option<VoiceSelectionParams>,
}
/// Instructs the speech synthesizer how to generate the output audio content.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputAudioConfig {
/// Required. Audio encoding of the synthesized audio content.
#[prost(enumeration="OutputAudioEncoding", tag="1")]
pub audio_encoding: i32,
/// Optional. The synthesis sample rate (in hertz) for this audio. If not
/// provided, then the synthesizer will use the default sample rate based on
/// the audio encoding. If this is different from the voice's natural sample
/// rate, then the synthesizer will honor this request by converting to the
/// desired sample rate (which might result in worse audio quality).
#[prost(int32, tag="2")]
pub sample_rate_hertz: i32,
/// Optional. Configuration of how speech should be synthesized.
#[prost(message, optional, tag="3")]
pub synthesize_speech_config: ::core::option::Option<SynthesizeSpeechConfig>,
}
/// Audio encoding of the audio content sent in the conversational query request.
/// Refer to the
/// [Cloud Speech API
/// documentation](<https://cloud.google.com/speech-to-text/docs/basics>) for more
/// details.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AudioEncoding {
/// Not specified.
Unspecified = 0,
/// Uncompressed 16-bit signed little-endian samples (Linear PCM).
Linear16 = 1,
/// \[`FLAC`\](<https://xiph.org/flac/documentation.html>) (Free Lossless Audio
/// Codec) is the recommended encoding because it is lossless (therefore
/// recognition is not compromised) and requires only about half the
/// bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
/// 24-bit samples, however, not all fields in `STREAMINFO` are supported.
Flac = 2,
/// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
Mulaw = 3,
/// Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
Amr = 4,
/// Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
AmrWb = 5,
/// Opus encoded audio frames in Ogg container
/// (\[OggOpus\](<https://wiki.xiph.org/OggOpus>)).
/// `sample_rate_hertz` must be 16000.
OggOpus = 6,
/// Although the use of lossy encodings is not recommended, if a very low
/// bitrate encoding is required, `OGG_OPUS` is highly preferred over
/// Speex encoding. The \[Speex\](<https://speex.org/>) encoding supported by
/// Dialogflow API has a header byte in each block, as in MIME type
/// `audio/x-speex-with-header-byte`.
/// It is a variant of the RTP Speex encoding defined in
/// [RFC 5574](<https://tools.ietf.org/html/rfc5574>).
/// The stream is a sequence of blocks, one block per RTP packet. Each block
/// starts with a byte containing the length of the block, in bytes, followed
/// by one or more frames of Speex data, padded to an integral number of
/// bytes (octets) as specified in RFC 5574. In other words, each RTP header
/// is replaced with a single byte containing the block length. Only Speex
/// wideband is supported. `sample_rate_hertz` must be 16000.
SpeexWithHeaderByte = 7,
}
impl AudioEncoding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AudioEncoding::Unspecified => "AUDIO_ENCODING_UNSPECIFIED",
AudioEncoding::Linear16 => "AUDIO_ENCODING_LINEAR_16",
AudioEncoding::Flac => "AUDIO_ENCODING_FLAC",
AudioEncoding::Mulaw => "AUDIO_ENCODING_MULAW",
AudioEncoding::Amr => "AUDIO_ENCODING_AMR",
AudioEncoding::AmrWb => "AUDIO_ENCODING_AMR_WB",
AudioEncoding::OggOpus => "AUDIO_ENCODING_OGG_OPUS",
AudioEncoding::SpeexWithHeaderByte => "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE",
}
}
}
/// Variant of the specified [Speech model]\[google.cloud.dialogflow.cx.v3.InputAudioConfig.model\] to use.
///
/// See the [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/enhanced-models>)
/// for which models have different variants. For example, the "phone_call" model
/// has both a standard and an enhanced variant. When you use an enhanced model,
/// you will generally receive higher quality results than for a standard model.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpeechModelVariant {
/// No model variant specified. In this case Dialogflow defaults to
/// USE_BEST_AVAILABLE.
Unspecified = 0,
/// Use the best available variant of the [Speech
/// model]\[InputAudioConfig.model\] that the caller is eligible for.
///
/// Please see the [Dialogflow
/// docs](<https://cloud.google.com/dialogflow/docs/data-logging>) for
/// how to make your project eligible for enhanced models.
UseBestAvailable = 1,
/// Use standard model variant even if an enhanced model is available. See the
/// [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/enhanced-models>)
/// for details about enhanced models.
UseStandard = 2,
/// Use an enhanced model variant:
///
/// * If an enhanced variant does not exist for the given
/// \[model][google.cloud.dialogflow.cx.v3.InputAudioConfig.model\] and request language, Dialogflow falls
/// back to the standard variant.
///
/// The [Cloud Speech
/// documentation](<https://cloud.google.com/speech-to-text/docs/enhanced-models>)
/// describes which models have enhanced variants.
///
/// * If the API caller isn't eligible for enhanced models, Dialogflow returns
/// an error. Please see the [Dialogflow
/// docs](<https://cloud.google.com/dialogflow/docs/data-logging>)
/// for how to make your project eligible.
UseEnhanced = 3,
}
impl SpeechModelVariant {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SpeechModelVariant::Unspecified => "SPEECH_MODEL_VARIANT_UNSPECIFIED",
SpeechModelVariant::UseBestAvailable => "USE_BEST_AVAILABLE",
SpeechModelVariant::UseStandard => "USE_STANDARD",
SpeechModelVariant::UseEnhanced => "USE_ENHANCED",
}
}
}
/// Gender of the voice as described in
/// [SSML voice element](<https://www.w3.org/TR/speech-synthesis11/#edef_voice>).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SsmlVoiceGender {
/// An unspecified gender, which means that the client doesn't care which
/// gender the selected voice will have.
Unspecified = 0,
/// A male voice.
Male = 1,
/// A female voice.
Female = 2,
/// A gender-neutral voice.
Neutral = 3,
}
impl SsmlVoiceGender {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SsmlVoiceGender::Unspecified => "SSML_VOICE_GENDER_UNSPECIFIED",
SsmlVoiceGender::Male => "SSML_VOICE_GENDER_MALE",
SsmlVoiceGender::Female => "SSML_VOICE_GENDER_FEMALE",
SsmlVoiceGender::Neutral => "SSML_VOICE_GENDER_NEUTRAL",
}
}
}
/// Audio encoding of the output audio format in Text-To-Speech.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OutputAudioEncoding {
/// Not specified.
Unspecified = 0,
/// Uncompressed 16-bit signed little-endian samples (Linear PCM).
/// Audio content returned as LINEAR16 also contains a WAV header.
Linear16 = 1,
/// MP3 audio at 32kbps.
Mp3 = 2,
/// MP3 audio at 64kbps.
Mp364Kbps = 4,
/// Opus encoded audio wrapped in an ogg container. The result will be a
/// file which can be played natively on Android, and in browsers (at least
/// Chrome and Firefox). The quality of the encoding is considerably higher
/// than MP3 while using approximately the same bitrate.
OggOpus = 3,
/// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
Mulaw = 5,
}
impl OutputAudioEncoding {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
OutputAudioEncoding::Unspecified => "OUTPUT_AUDIO_ENCODING_UNSPECIFIED",
OutputAudioEncoding::Linear16 => "OUTPUT_AUDIO_ENCODING_LINEAR_16",
OutputAudioEncoding::Mp3 => "OUTPUT_AUDIO_ENCODING_MP3",
OutputAudioEncoding::Mp364Kbps => "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS",
OutputAudioEncoding::OggOpus => "OUTPUT_AUDIO_ENCODING_OGG_OPUS",
OutputAudioEncoding::Mulaw => "OUTPUT_AUDIO_ENCODING_MULAW",
}
}
}
/// Represents a response message that can be returned by a conversational agent.
///
/// Response messages are also used for output audio synthesis. The approach is
/// as follows:
///
/// * If at least one OutputAudioText response is present, then all
/// OutputAudioText responses are linearly concatenated, and the result is used
/// for output audio synthesis.
/// * If the OutputAudioText responses are a mixture of text and SSML, then the
/// concatenated result is treated as SSML; otherwise, the result is treated as
/// either text or SSML as appropriate. The agent designer should ideally use
/// either text or SSML consistently throughout the bot design.
/// * Otherwise, all Text responses are linearly concatenated, and the result is
/// used for output audio synthesis.
///
/// This approach allows for more sophisticated user experience scenarios, where
/// the text displayed to the user may differ from what is heard.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseMessage {
/// Required. The rich response message.
#[prost(oneof="response_message::Message", tags="1, 2, 9, 8, 10, 11, 12, 13")]
pub message: ::core::option::Option<response_message::Message>,
}
/// Nested message and enum types in `ResponseMessage`.
pub mod response_message {
/// The text response message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Text {
/// Required. A collection of text responses.
#[prost(string, repeated, tag="1")]
pub text: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// 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.
#[prost(bool, tag="2")]
pub allow_playback_interruption: bool,
}
/// Indicates that the conversation should be handed off to a live agent.
///
/// Dialogflow only uses this to determine which conversations were handed off
/// to a human agent for measurement purposes. What else to do with this signal
/// is up to you and your handoff procedures.
///
/// You may set this, for example:
/// * In the \[entry_fulfillment][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment\] of a \[Page][google.cloud.dialogflow.cx.v3.Page\] if
/// entering the page indicates something went extremely wrong in the
/// conversation.
/// * In a webhook response when you determine that the customer issue can only
/// be handled by a human.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveAgentHandoff {
/// Custom metadata for your handoff procedure. Dialogflow doesn't impose
/// any structure on this.
#[prost(message, optional, tag="1")]
pub metadata: ::core::option::Option<::prost_types::Struct>,
}
/// Indicates that the conversation succeeded, i.e., the bot handled the issue
/// that the customer talked to it about.
///
/// Dialogflow only uses this to determine which conversations should be
/// counted as successful and doesn't process the metadata in this message in
/// any way. Note that Dialogflow also considers conversations that get to the
/// conversation end page as successful even if they don't return
/// \[ConversationSuccess][google.cloud.dialogflow.cx.v3.ResponseMessage.ConversationSuccess\].
///
/// You may set this, for example:
/// * In the \[entry_fulfillment][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment\] of a \[Page][google.cloud.dialogflow.cx.v3.Page\] if
/// entering the page indicates that the conversation succeeded.
/// * In a webhook response when you determine that you handled the customer
/// issue.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConversationSuccess {
/// Custom metadata. Dialogflow doesn't impose any structure on this.
#[prost(message, optional, tag="1")]
pub metadata: ::core::option::Option<::prost_types::Struct>,
}
/// A text or ssml response that is preferentially used for TTS output audio
/// synthesis, as described in the comment on the ResponseMessage message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputAudioText {
/// 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.
#[prost(bool, tag="3")]
pub allow_playback_interruption: bool,
/// The source, which is either plain text or SSML.
#[prost(oneof="output_audio_text::Source", tags="1, 2")]
pub source: ::core::option::Option<output_audio_text::Source>,
}
/// Nested message and enum types in `OutputAudioText`.
pub mod output_audio_text {
/// The source, which is either plain text or SSML.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
/// The raw text to be synthesized.
#[prost(string, tag="1")]
Text(::prost::alloc::string::String),
/// The SSML text to be synthesized. For more information, see
/// \[SSML\](/speech/text-to-speech/docs/ssml).
#[prost(string, tag="2")]
Ssml(::prost::alloc::string::String),
}
}
/// 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.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndInteraction {
}
/// Specifies an audio clip to be played by the client as part of the response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(string, tag="1")]
pub audio_uri: ::prost::alloc::string::String,
/// 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.
#[prost(bool, tag="2")]
pub allow_playback_interruption: bool,
}
/// Represents an audio message that is composed of both segments
/// synthesized from the Dialogflow agent prompts and ones hosted externally
/// at the specified URIs.
/// The external URIs are specified via
/// \[play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio\].
/// This message is generated by Dialogflow only and not supposed to be
/// defined by the user.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MixedAudio {
/// Segments this audio response is composed of.
#[prost(message, repeated, tag="1")]
pub segments: ::prost::alloc::vec::Vec<mixed_audio::Segment>,
}
/// Nested message and enum types in `MixedAudio`.
pub mod mixed_audio {
/// Represents one segment of audio.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Segment {
/// Output only. Whether the playback of this segment can be interrupted by the end
/// user's speech and the client should then start the next Dialogflow
/// request.
#[prost(bool, tag="3")]
pub allow_playback_interruption: bool,
/// Content of the segment.
#[prost(oneof="segment::Content", tags="1, 2")]
pub content: ::core::option::Option<segment::Content>,
}
/// Nested message and enum types in `Segment`.
pub mod segment {
/// Content of the segment.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Content {
/// Raw audio synthesized from the Dialogflow agent's response using
/// the output config specified in the request.
#[prost(bytes, tag="1")]
Audio(::prost::alloc::vec::Vec<u8>),
/// Client-specific URI that points to an audio clip accessible to the
/// client. Dialogflow does not impose any validation on it.
#[prost(string, tag="2")]
Uri(::prost::alloc::string::String),
}
}
}
/// Required. The rich response message.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
/// Returns a text response.
#[prost(message, tag="1")]
Text(Text),
/// Returns a response containing a custom, platform-specific payload.
#[prost(message, tag="2")]
Payload(::prost_types::Struct),
/// Indicates that the conversation succeeded.
#[prost(message, tag="9")]
ConversationSuccess(ConversationSuccess),
/// A text or ssml response that is preferentially used for TTS output audio
/// synthesis, as described in the comment on the ResponseMessage message.
#[prost(message, tag="8")]
OutputAudioText(OutputAudioText),
/// Hands off conversation to a human agent.
#[prost(message, tag="10")]
LiveAgentHandoff(LiveAgentHandoff),
/// Output only. A signal that indicates the interaction with the Dialogflow agent has
/// ended.
/// This message is generated by Dialogflow only when the conversation
/// reaches `END_SESSION` page. It is not supposed to be defined by the user.
///
/// It's guaranteed that there is at most one such message in each response.
#[prost(message, tag="11")]
EndInteraction(EndInteraction),
/// Signal that the client should play an audio clip hosted at a
/// client-specific URI. Dialogflow uses this to construct
/// \[mixed_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.mixed_audio\]. However, Dialogflow itself
/// does not try to read or process the URI in any way.
#[prost(message, tag="12")]
PlayAudio(PlayAudio),
/// Output only. An audio response message composed of both the synthesized Dialogflow
/// agent responses and responses defined via
/// \[play_audio][google.cloud.dialogflow.cx.v3.ResponseMessage.play_audio\].
/// This message is generated by Dialogflow only and not supposed to be
/// defined by the user.
#[prost(message, tag="13")]
MixedAudio(MixedAudio),
}
}
/// A fulfillment can do one or more of the following actions at the same time:
///
/// * Generate rich message responses.
/// * Set parameter values.
/// * Call the webhook.
///
/// Fulfillments can be called at various stages in the \[Page][google.cloud.dialogflow.cx.v3.Page\] or
/// \[Form][google.cloud.dialogflow.cx.v3.Form\] lifecycle. For example, when a \[DetectIntentRequest][google.cloud.dialogflow.cx.v3.DetectIntentRequest\] drives a
/// session to enter a new page, the page's entry fulfillment can add a static
/// response to the \[QueryResult][google.cloud.dialogflow.cx.v3.QueryResult\] in the returning \[DetectIntentResponse][google.cloud.dialogflow.cx.v3.DetectIntentResponse\],
/// call the webhook (for example, to load user data from a database), or both.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Fulfillment {
/// The list of rich message responses to present to the user.
#[prost(message, repeated, tag="1")]
pub messages: ::prost::alloc::vec::Vec<ResponseMessage>,
/// The webhook to call.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/webhooks/<Webhook ID>`.
#[prost(string, tag="2")]
pub webhook: ::prost::alloc::string::String,
/// The tag used by the webhook to identify which fulfillment is being called.
/// This field is required if `webhook` is specified.
#[prost(string, tag="3")]
pub tag: ::prost::alloc::string::String,
/// Set parameter values before executing the webhook.
#[prost(message, repeated, tag="4")]
pub set_parameter_actions: ::prost::alloc::vec::Vec<fulfillment::SetParameterAction>,
/// Conditional cases for this fulfillment.
#[prost(message, repeated, tag="5")]
pub conditional_cases: ::prost::alloc::vec::Vec<fulfillment::ConditionalCases>,
}
/// Nested message and enum types in `Fulfillment`.
pub mod fulfillment {
/// Setting a parameter value.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetParameterAction {
/// Display name of the parameter.
#[prost(string, tag="1")]
pub parameter: ::prost::alloc::string::String,
/// The new value of the parameter. A null value clears the parameter.
#[prost(message, optional, tag="2")]
pub value: ::core::option::Option<::prost_types::Value>,
}
/// A list of cascading if-else conditions. Cases are mutually exclusive.
/// The first one with a matching condition is selected, all the rest ignored.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConditionalCases {
/// A list of cascading if-else conditions.
#[prost(message, repeated, tag="1")]
pub cases: ::prost::alloc::vec::Vec<conditional_cases::Case>,
}
/// Nested message and enum types in `ConditionalCases`.
pub mod conditional_cases {
/// Each case has a Boolean condition. When it is evaluated to be True, the
/// corresponding messages will be selected and evaluated recursively.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Case {
/// The condition to activate and select this case. Empty means the
/// condition is always true. The condition is evaluated against [form
/// parameters]\[Form.parameters\] or [session
/// parameters]\[SessionInfo.parameters\].
///
/// See the [conditions
/// reference](<https://cloud.google.com/dialogflow/cx/docs/reference/condition>).
#[prost(string, tag="1")]
pub condition: ::prost::alloc::string::String,
/// A list of case content.
#[prost(message, repeated, tag="2")]
pub case_content: ::prost::alloc::vec::Vec<case::CaseContent>,
}
/// Nested message and enum types in `Case`.
pub mod case {
/// The list of messages or conditional cases to activate for this case.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CaseContent {
/// Either a message is returned or additional cases to be evaluated.
#[prost(oneof="case_content::CasesOrMessage", tags="1, 2")]
pub cases_or_message: ::core::option::Option<case_content::CasesOrMessage>,
}
/// Nested message and enum types in `CaseContent`.
pub mod case_content {
/// Either a message is returned or additional cases to be evaluated.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CasesOrMessage {
/// Returned message.
#[prost(message, tag="1")]
Message(super::super::super::super::ResponseMessage),
/// Additional cases to be evaluated.
#[prost(message, tag="2")]
AdditionalCases(super::super::super::ConditionalCases),
}
}
}
}
}
/// A Dialogflow CX conversation (session) can be described and visualized as a
/// state machine. The states of a CX session are represented by pages.
///
/// For each flow, you define many pages, where your combined pages can handle a
/// complete conversation on the topics the flow is designed for. At any given
/// moment, exactly one page is the current page, the current page is considered
/// active, and the flow associated with that page is considered active. Every
/// flow has a special start page. When a flow initially becomes active, the
/// start page page becomes the current page. For each conversational turn, the
/// current page will either stay the same or transition to another page.
///
/// You configure each page to collect information from the end-user that is
/// relevant for the conversational state represented by the page.
///
/// For more information, see the
/// [Page guide](<https://cloud.google.com/dialogflow/cx/docs/concept/page>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Page {
/// The unique identifier of the page.
/// Required for the \[Pages.UpdatePage][google.cloud.dialogflow.cx.v3.Pages.UpdatePage\] method. \[Pages.CreatePage][google.cloud.dialogflow.cx.v3.Pages.CreatePage\]
/// populates the name automatically.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/pages/<Page ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The human-readable name of the page, unique within the agent.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// The fulfillment to call when the session is entering the page.
#[prost(message, optional, tag="7")]
pub entry_fulfillment: ::core::option::Option<Fulfillment>,
/// The form associated with the page, used for collecting parameters
/// relevant to the page.
#[prost(message, optional, tag="4")]
pub form: ::core::option::Option<Form>,
/// Ordered list of \[`TransitionRouteGroups`][google.cloud.dialogflow.cx.v3.TransitionRouteGroup\] associated
/// with the page. Transition route groups must be unique within a page.
///
/// * If multiple transition routes within a page scope refer to the same
/// intent, then the precedence order is: page's transition route -> page's
/// transition route group -> flow's transition routes.
///
/// * If multiple transition route groups within a page contain the same
/// intent, then the first group in the ordered list takes precedence.
///
/// Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
#[prost(string, repeated, tag="11")]
pub transition_route_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// A list of transitions for the transition rules of this page.
/// They route the conversation to another page in the same flow, or another
/// flow.
///
/// When we are in a certain page, the TransitionRoutes are evalauted in the
/// following order:
///
/// * TransitionRoutes defined in the page with intent specified.
/// * TransitionRoutes defined in the
/// [transition route groups]\[google.cloud.dialogflow.cx.v3.Page.transition_route_groups\] with intent
/// specified.
/// * TransitionRoutes defined in flow with intent specified.
/// * TransitionRoutes defined in the
/// [transition route groups]\[google.cloud.dialogflow.cx.v3.Flow.transition_route_groups\] with intent
/// specified.
/// * TransitionRoutes defined in the page with only condition specified.
/// * TransitionRoutes defined in the
/// [transition route groups]\[google.cloud.dialogflow.cx.v3.Page.transition_route_groups\] with only
/// condition specified.
#[prost(message, repeated, tag="9")]
pub transition_routes: ::prost::alloc::vec::Vec<TransitionRoute>,
/// Handlers associated with the page to handle events such as webhook errors,
/// no match or no input.
#[prost(message, repeated, tag="10")]
pub event_handlers: ::prost::alloc::vec::Vec<EventHandler>,
}
/// A form is a data model that groups related parameters that can be collected
/// from the user. The process in which the agent prompts the user and collects
/// parameter values from the user is called form filling. A form can be added to
/// a \[page][google.cloud.dialogflow.cx.v3.Page\]. When form filling is done, the filled parameters will be
/// written to the \[session][google.cloud.dialogflow.cx.v3.SessionInfo.parameters\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Form {
/// Parameters to collect from the user.
#[prost(message, repeated, tag="1")]
pub parameters: ::prost::alloc::vec::Vec<form::Parameter>,
}
/// Nested message and enum types in `Form`.
pub mod form {
/// Represents a form parameter.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
/// Required. The human-readable name of the parameter, unique within the
/// form.
#[prost(string, tag="1")]
pub display_name: ::prost::alloc::string::String,
/// Indicates whether the parameter is required. Optional parameters will not
/// trigger prompts; however, they are filled if the user specifies them.
/// Required parameters must be filled before form filling concludes.
#[prost(bool, tag="2")]
pub required: bool,
/// Required. The entity type of the parameter.
/// Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
/// ID>` for system entity types (for example,
/// `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
/// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/entityTypes/<Entity Type ID>` for developer entity types.
#[prost(string, tag="3")]
pub entity_type: ::prost::alloc::string::String,
/// Indicates whether the parameter represents a list of values.
#[prost(bool, tag="4")]
pub is_list: bool,
/// Required. Defines fill behavior for the parameter.
#[prost(message, optional, tag="7")]
pub fill_behavior: ::core::option::Option<parameter::FillBehavior>,
/// The default value of an optional parameter. If the parameter is required,
/// the default value will be ignored.
#[prost(message, optional, tag="9")]
pub default_value: ::core::option::Option<::prost_types::Value>,
/// Indicates whether the parameter content should be redacted in log. If
/// redaction is enabled, the parameter content will be replaced by parameter
/// name during logging.
/// Note: the parameter content is subject to redaction if either parameter
/// level redaction or [entity type level redaction]\[google.cloud.dialogflow.cx.v3.EntityType.redact\] is
/// enabled.
#[prost(bool, tag="11")]
pub redact: bool,
}
/// Nested message and enum types in `Parameter`.
pub mod parameter {
/// Configuration for how the filling of a parameter should be handled.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FillBehavior {
/// Required. The fulfillment to provide the initial prompt that the agent
/// can present to the user in order to fill the parameter.
#[prost(message, optional, tag="3")]
pub initial_prompt_fulfillment: ::core::option::Option<super::super::Fulfillment>,
/// The handlers for parameter-level events, used to provide reprompt for
/// the parameter or transition to a different page/flow. The supported
/// events are:
/// * `sys.no-match-<N>`, where N can be from 1 to 6
/// * `sys.no-match-default`
/// * `sys.no-input-<N>`, where N can be from 1 to 6
/// * `sys.no-input-default`
/// * `sys.invalid-parameter`
///
/// `initial_prompt_fulfillment` provides the first prompt for the
/// parameter.
///
/// If the user's response does not fill the parameter, a
/// no-match/no-input event will be triggered, and the fulfillment
/// associated with the `sys.no-match-1`/`sys.no-input-1` handler (if
/// defined) will be called to provide a prompt. The
/// `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to
/// the next no-match/no-input event, and so on.
///
/// A `sys.no-match-default` or `sys.no-input-default` handler will be used
/// to handle all following no-match/no-input events after all numbered
/// no-match/no-input handlers for the parameter are consumed.
///
/// A `sys.invalid-parameter` handler can be defined to handle the case
/// where the parameter values have been `invalidated` by webhook. For
/// example, if the user's response fill the parameter, however the
/// parameter was invalidated by webhook, the fulfillment associated with
/// the `sys.invalid-parameter` handler (if defined) will be called to
/// provide a prompt.
///
/// If the event handler for the corresponding event can't be found on the
/// parameter, `initial_prompt_fulfillment` will be re-prompted.
#[prost(message, repeated, tag="5")]
pub reprompt_event_handlers: ::prost::alloc::vec::Vec<super::super::EventHandler>,
}
}
}
/// An event handler specifies an \[event][google.cloud.dialogflow.cx.v3.EventHandler.event\] that can be handled
/// during a session. When the specified event happens, the following actions are
/// taken in order:
///
/// * If there is a
/// \[`trigger_fulfillment`][google.cloud.dialogflow.cx.v3.EventHandler.trigger_fulfillment\] associated with
/// the event, it will be called.
/// * If there is a \[`target_page`][google.cloud.dialogflow.cx.v3.EventHandler.target_page\] associated
/// with the event, the session will transition into the specified page.
/// * If there is a \[`target_flow`][google.cloud.dialogflow.cx.v3.EventHandler.target_flow\] associated
/// with the event, the session will transition into the specified flow.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventHandler {
/// Output only. The unique identifier of this event handler.
#[prost(string, tag="6")]
pub name: ::prost::alloc::string::String,
/// Required. The name of the event to handle.
#[prost(string, tag="4")]
pub event: ::prost::alloc::string::String,
/// The fulfillment to call when the event occurs.
/// Handling webhook errors with a fulfillment enabled with webhook could
/// cause infinite loop. It is invalid to specify such fulfillment for a
/// handler handling webhooks.
#[prost(message, optional, tag="5")]
pub trigger_fulfillment: ::core::option::Option<Fulfillment>,
/// The target to transition to, either a page in the same host flow (the flow
/// that owns this \[TransitionRoute][google.cloud.dialogflow.cx.v3.TransitionRoute\]), or another flow in the same agent.
#[prost(oneof="event_handler::Target", tags="2, 3")]
pub target: ::core::option::Option<event_handler::Target>,
}
/// Nested message and enum types in `EventHandler`.
pub mod event_handler {
/// The target to transition to, either a page in the same host flow (the flow
/// that owns this \[TransitionRoute][google.cloud.dialogflow.cx.v3.TransitionRoute\]), or another flow in the same agent.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
/// The target page to transition to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/pages/<Page ID>`.
#[prost(string, tag="2")]
TargetPage(::prost::alloc::string::String),
/// The target flow to transition to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="3")]
TargetFlow(::prost::alloc::string::String),
}
}
/// A transition route specifies a \[intent][google.cloud.dialogflow.cx.v3.Intent\] that can be matched and/or a
/// data condition that can be evaluated during a session. When a specified
/// transition is matched, the following actions are taken in order:
///
/// * If there is a
/// \[`trigger_fulfillment`][google.cloud.dialogflow.cx.v3.TransitionRoute.trigger_fulfillment\] associated with
/// the transition, it will be called.
/// * If there is a \[`target_page`][google.cloud.dialogflow.cx.v3.TransitionRoute.target_page\] associated
/// with the transition, the session will transition into the specified page.
/// * If there is a \[`target_flow`][google.cloud.dialogflow.cx.v3.TransitionRoute.target_flow\] associated
/// with the transition, the session will transition into the specified flow.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitionRoute {
/// Output only. The unique identifier of this transition route.
#[prost(string, tag="6")]
pub name: ::prost::alloc::string::String,
/// The unique identifier of an \[Intent][google.cloud.dialogflow.cx.v3.Intent\].
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
/// Indicates that the transition can only happen when the given intent is
/// matched.
/// At least one of `intent` or `condition` must be specified. When both
/// `intent` and `condition` are specified, the transition can only happen
/// when both are fulfilled.
#[prost(string, tag="1")]
pub intent: ::prost::alloc::string::String,
/// The condition to evaluate against [form parameters]\[google.cloud.dialogflow.cx.v3.Form.parameters\] or
/// [session parameters]\[google.cloud.dialogflow.cx.v3.SessionInfo.parameters\].
///
/// See the [conditions
/// reference](<https://cloud.google.com/dialogflow/cx/docs/reference/condition>).
/// At least one of `intent` or `condition` must be specified. When both
/// `intent` and `condition` are specified, the transition can only happen
/// when both are fulfilled.
#[prost(string, tag="2")]
pub condition: ::prost::alloc::string::String,
/// The fulfillment to call when the condition is satisfied. At least one of
/// `trigger_fulfillment` and `target` must be specified. When both are
/// defined, `trigger_fulfillment` is executed first.
#[prost(message, optional, tag="3")]
pub trigger_fulfillment: ::core::option::Option<Fulfillment>,
/// The target to transition to, either a page in the same host flow (the flow
/// that owns this \[TransitionRoute][google.cloud.dialogflow.cx.v3.TransitionRoute\]), or another flow in the same agent.
#[prost(oneof="transition_route::Target", tags="4, 5")]
pub target: ::core::option::Option<transition_route::Target>,
}
/// Nested message and enum types in `TransitionRoute`.
pub mod transition_route {
/// The target to transition to, either a page in the same host flow (the flow
/// that owns this \[TransitionRoute][google.cloud.dialogflow.cx.v3.TransitionRoute\]), or another flow in the same agent.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
/// The target page to transition to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/pages/<Page ID>`.
#[prost(string, tag="4")]
TargetPage(::prost::alloc::string::String),
/// The target flow to transition to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="5")]
TargetFlow(::prost::alloc::string::String),
}
}
/// The request message for \[Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPagesRequest {
/// Required. The flow to list all pages for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// The language to list pages for. The following fields are language
/// dependent:
///
/// * `Page.entry_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
/// * `Page.transition_routes.trigger_fulfillment.messages`
/// *
/// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The maximum number of items to return in a single page. By default 100 and
/// at most 1000.
#[prost(int32, tag="3")]
pub page_size: i32,
/// The next_page_token value returned from a previous list request.
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPagesResponse {
/// The list of pages. There will be a maximum number of items returned based
/// on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub pages: ::prost::alloc::vec::Vec<Page>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[Pages.GetPage][google.cloud.dialogflow.cx.v3.Pages.GetPage\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPageRequest {
/// Required. The name of the page.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/pages/<Page ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// The language to retrieve the page for. The following fields are language
/// dependent:
///
/// * `Page.entry_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
/// * `Page.transition_routes.trigger_fulfillment.messages`
/// *
/// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Pages.CreatePage][google.cloud.dialogflow.cx.v3.Pages.CreatePage\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePageRequest {
/// Required. The flow to create a page for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The page to create.
#[prost(message, optional, tag="2")]
pub page: ::core::option::Option<Page>,
/// The language of the following fields in `page`:
///
/// * `Page.entry_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
/// * `Page.transition_routes.trigger_fulfillment.messages`
/// *
/// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Pages.UpdatePage][google.cloud.dialogflow.cx.v3.Pages.UpdatePage\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePageRequest {
/// Required. The page to update.
#[prost(message, optional, tag="1")]
pub page: ::core::option::Option<Page>,
/// The language of the following fields in `page`:
///
/// * `Page.entry_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
/// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
/// * `Page.transition_routes.trigger_fulfillment.messages`
/// *
/// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The mask to control which fields get updated. If the mask is not present,
/// all fields will be updated.
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[Pages.DeletePage][google.cloud.dialogflow.cx.v3.Pages.DeletePage\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePageRequest {
/// Required. The name of the page to delete.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/Flows/<flow ID>/pages/<Page ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// This field has no effect for pages with no incoming transitions.
/// For pages with incoming transitions:
///
/// * If `force` is set to false, an error will be returned with message
/// indicating the incoming transitions.
/// * If `force` is set to true, Dialogflow will remove the page, as well as
/// any transitions to the page (i.e. [Target
/// page]\[EventHandler.target_page\] in event handlers or [Target
/// page]\[TransitionRoute.target_page\] in transition routes that point to
/// this page will be cleared).
#[prost(bool, tag="2")]
pub force: bool,
}
/// Generated client implementations.
pub mod pages_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
#[derive(Debug, Clone)]
pub struct PagesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PagesClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PagesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PagesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
PagesClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all pages in the specified flow.
pub async fn list_pages(
&mut self,
request: impl tonic::IntoRequest<super::ListPagesRequest>,
) -> Result<tonic::Response<super::ListPagesResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Pages/ListPages",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified page.
pub async fn get_page(
&mut self,
request: impl tonic::IntoRequest<super::GetPageRequest>,
) -> Result<tonic::Response<super::Page>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Pages/GetPage",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates a page in the specified flow.
pub async fn create_page(
&mut self,
request: impl tonic::IntoRequest<super::CreatePageRequest>,
) -> Result<tonic::Response<super::Page>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Pages/CreatePage",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified page.
pub async fn update_page(
&mut self,
request: impl tonic::IntoRequest<super::UpdatePageRequest>,
) -> Result<tonic::Response<super::Page>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Pages/UpdatePage",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified page.
pub async fn delete_page(
&mut self,
request: impl tonic::IntoRequest<super::DeletePageRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Pages/DeletePage",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// Agent/flow validation message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidationMessage {
/// The type of the resources where the message is found.
#[prost(enumeration="validation_message::ResourceType", tag="1")]
pub resource_type: i32,
/// The names of the resources where the message is found.
#[deprecated]
#[prost(string, repeated, tag="2")]
pub resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The resource names of the resources where the message is found.
#[prost(message, repeated, tag="6")]
pub resource_names: ::prost::alloc::vec::Vec<ResourceName>,
/// Indicates the severity of the message.
#[prost(enumeration="validation_message::Severity", tag="3")]
pub severity: i32,
/// The message detail.
#[prost(string, tag="4")]
pub detail: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ValidationMessage`.
pub mod validation_message {
/// Resource types.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResourceType {
/// Unspecified.
Unspecified = 0,
/// Agent.
Agent = 1,
/// Intent.
Intent = 2,
/// Intent training phrase.
IntentTrainingPhrase = 8,
/// Intent parameter.
IntentParameter = 9,
/// Multiple intents.
Intents = 10,
/// Multiple training phrases.
IntentTrainingPhrases = 11,
/// Entity type.
EntityType = 3,
/// Multiple entity types.
EntityTypes = 12,
/// Webhook.
Webhook = 4,
/// Flow.
Flow = 5,
/// Page.
Page = 6,
/// Multiple pages.
Pages = 13,
/// Transition route group.
TransitionRouteGroup = 7,
}
impl ResourceType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ResourceType::Unspecified => "RESOURCE_TYPE_UNSPECIFIED",
ResourceType::Agent => "AGENT",
ResourceType::Intent => "INTENT",
ResourceType::IntentTrainingPhrase => "INTENT_TRAINING_PHRASE",
ResourceType::IntentParameter => "INTENT_PARAMETER",
ResourceType::Intents => "INTENTS",
ResourceType::IntentTrainingPhrases => "INTENT_TRAINING_PHRASES",
ResourceType::EntityType => "ENTITY_TYPE",
ResourceType::EntityTypes => "ENTITY_TYPES",
ResourceType::Webhook => "WEBHOOK",
ResourceType::Flow => "FLOW",
ResourceType::Page => "PAGE",
ResourceType::Pages => "PAGES",
ResourceType::TransitionRouteGroup => "TRANSITION_ROUTE_GROUP",
}
}
}
/// Severity level.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Severity {
/// Unspecified.
Unspecified = 0,
/// The agent doesn't follow Dialogflow best practices.
Info = 1,
/// The agent may not behave as expected.
Warning = 2,
/// The agent may experience failures.
Error = 3,
}
impl Severity {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Severity::Unspecified => "SEVERITY_UNSPECIFIED",
Severity::Info => "INFO",
Severity::Warning => "WARNING",
Severity::Error => "ERROR",
}
}
}
}
/// Resource name and display name.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceName {
/// Name.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Display name.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
}
/// Settings related to NLU.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NluSettings {
/// Indicates the type of NLU model.
#[prost(enumeration="nlu_settings::ModelType", tag="1")]
pub model_type: i32,
/// To filter out false positive results and still get variety in matched
/// natural language inputs for your agent, you can tune the machine learning
/// classification threshold. If the returned score value is less than the
/// threshold value, then a no-match event will be triggered. The score values
/// range from 0.0 (completely uncertain) to 1.0 (completely certain). If set
/// to 0.0, the default of 0.3 is used.
#[prost(float, tag="3")]
pub classification_threshold: f32,
/// Indicates NLU model training mode.
#[prost(enumeration="nlu_settings::ModelTrainingMode", tag="4")]
pub model_training_mode: i32,
}
/// Nested message and enum types in `NluSettings`.
pub mod nlu_settings {
/// NLU model type.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ModelType {
/// Not specified. `MODEL_TYPE_STANDARD` will be used.
Unspecified = 0,
/// Use standard NLU model.
Standard = 1,
/// Use advanced NLU model.
Advanced = 3,
}
impl ModelType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ModelType::Unspecified => "MODEL_TYPE_UNSPECIFIED",
ModelType::Standard => "MODEL_TYPE_STANDARD",
ModelType::Advanced => "MODEL_TYPE_ADVANCED",
}
}
}
/// NLU model training mode.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ModelTrainingMode {
/// Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used.
Unspecified = 0,
/// NLU model training is automatically triggered when a flow gets modified.
/// User can also manually trigger model training in this mode.
Automatic = 1,
/// User needs to manually trigger NLU model training. Best for large flows
/// whose models take long time to train.
Manual = 2,
}
impl ModelTrainingMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ModelTrainingMode::Unspecified => "MODEL_TRAINING_MODE_UNSPECIFIED",
ModelTrainingMode::Automatic => "MODEL_TRAINING_MODE_AUTOMATIC",
ModelTrainingMode::Manual => "MODEL_TRAINING_MODE_MANUAL",
}
}
}
}
/// Flows represents the conversation flows when you build your chatbot agent.
///
/// A flow consists of many pages connected by the transition routes.
/// Conversations always start with the built-in Start Flow (with an all-0 ID).
/// Transition routes can direct the conversation session from the current flow
/// (parent flow) to another flow (sub flow). When the sub flow is finished,
/// Dialogflow will bring the session back to the parent flow, where the sub flow
/// is started.
///
/// Usually, when a transition route is followed by a matched intent, the intent
/// will be "consumed". This means the intent won't activate more transition
/// routes. However, when the followed transition route moves the conversation
/// session into a different flow, the matched intent can be carried over and to
/// be consumed in the target flow.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Flow {
/// The unique identifier of the flow.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The human-readable name of the flow.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// The description of the flow. The maximum length is 500 characters. If
/// exceeded, the request is rejected.
#[prost(string, tag="3")]
pub description: ::prost::alloc::string::String,
/// A flow's transition routes serve two purposes:
///
/// * They are responsible for matching the user's first utterances in the
/// flow.
/// * They are inherited by every page's [transition
/// routes]\[Page.transition_routes\] and can support use cases such as the user
/// saying "help" or "can I talk to a human?", which can be handled in a common
/// way regardless of the current page. Transition routes defined in the page
/// have higher priority than those defined in the flow.
///
/// TransitionRoutes are evalauted in the following order:
///
/// * TransitionRoutes with intent specified..
/// * TransitionRoutes with only condition specified.
///
/// TransitionRoutes with intent specified are inherited by pages in the flow.
#[prost(message, repeated, tag="4")]
pub transition_routes: ::prost::alloc::vec::Vec<TransitionRoute>,
/// A flow's event handlers serve two purposes:
///
/// * They are responsible for handling events (e.g. no match,
/// webhook errors) in the flow.
/// * They are inherited by every page's [event
/// handlers]\[Page.event_handlers\], which can be used to handle common events
/// regardless of the current page. Event handlers defined in the page
/// have higher priority than those defined in the flow.
///
/// Unlike \[transition_routes][google.cloud.dialogflow.cx.v3.Flow.transition_routes\], these handlers are
/// evaluated on a first-match basis. The first one that matches the event
/// get executed, with the rest being ignored.
#[prost(message, repeated, tag="10")]
pub event_handlers: ::prost::alloc::vec::Vec<EventHandler>,
/// A flow's transition route group serve two purposes:
///
/// * They are responsible for matching the user's first utterances in the
/// flow.
/// * They are inherited by every page's [transition
/// route groups]\[Page.transition_route_groups\]. Transition route groups
/// defined in the page have higher priority than those defined in the flow.
///
/// Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
#[prost(string, repeated, tag="15")]
pub transition_route_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// NLU related settings of the flow.
#[prost(message, optional, tag="11")]
pub nlu_settings: ::core::option::Option<NluSettings>,
}
/// The request message for \[Flows.CreateFlow][google.cloud.dialogflow.cx.v3.Flows.CreateFlow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFlowRequest {
/// Required. The agent to create a flow for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The flow to create.
#[prost(message, optional, tag="2")]
pub flow: ::core::option::Option<Flow>,
/// The language of the following fields in `flow`:
///
/// * `Flow.event_handlers.trigger_fulfillment.messages`
/// * `Flow.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Flows.DeleteFlow][google.cloud.dialogflow.cx.v3.Flows.DeleteFlow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFlowRequest {
/// Required. The name of the flow to delete.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// This field has no effect for flows with no incoming transitions.
/// For flows with incoming transitions:
///
/// * If `force` is set to false, an error will be returned with message
/// indicating the incoming transitions.
/// * If `force` is set to true, Dialogflow will remove the flow, as well as
/// any transitions to the flow (i.e. [Target
/// flow]\[EventHandler.target_flow\] in event handlers or [Target
/// flow]\[TransitionRoute.target_flow\] in transition routes that point to
/// this flow will be cleared).
#[prost(bool, tag="2")]
pub force: bool,
}
/// The request message for \[Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFlowsRequest {
/// Required. The agent containing the flows.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return in a single page. By default 100 and
/// at most 1000.
#[prost(int32, tag="2")]
pub page_size: i32,
/// The next_page_token value returned from a previous list request.
#[prost(string, tag="3")]
pub page_token: ::prost::alloc::string::String,
/// The language to list flows for. The following fields are language
/// dependent:
///
/// * `Flow.event_handlers.trigger_fulfillment.messages`
/// * `Flow.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="4")]
pub language_code: ::prost::alloc::string::String,
}
/// The response message for \[Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFlowsResponse {
/// The list of flows. There will be a maximum number of items returned based
/// on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub flows: ::prost::alloc::vec::Vec<Flow>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The response message for \[Flows.GetFlow][google.cloud.dialogflow.cx.v3.Flows.GetFlow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFlowRequest {
/// Required. The name of the flow to get.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// The language to retrieve the flow for. The following fields are language
/// dependent:
///
/// * `Flow.event_handlers.trigger_fulfillment.messages`
/// * `Flow.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Flows.UpdateFlow][google.cloud.dialogflow.cx.v3.Flows.UpdateFlow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFlowRequest {
/// Required. The flow to update.
#[prost(message, optional, tag="1")]
pub flow: ::core::option::Option<Flow>,
/// Required. The mask to control which fields get updated. If `update_mask` is not
/// specified, an error will be returned.
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// The language of the following fields in `flow`:
///
/// * `Flow.event_handlers.trigger_fulfillment.messages`
/// * `Flow.transition_routes.trigger_fulfillment.messages`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Flows.TrainFlow][google.cloud.dialogflow.cx.v3.Flows.TrainFlow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainFlowRequest {
/// Required. The flow to train.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for \[Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateFlowRequest {
/// Required. The flow to validate.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// If not specified, the agent's default language is used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFlowValidationResultRequest {
/// Required. The flow name.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/validationResult`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// If not specified, the agent's default language is used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The response message for \[Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlowValidationResult {
/// The unique identifier of the flow validation result.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/flows/<Flow ID>/validationResult`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Contains all validation messages.
#[prost(message, repeated, tag="2")]
pub validation_messages: ::prost::alloc::vec::Vec<ValidationMessage>,
/// Last time the flow was validated.
#[prost(message, optional, tag="3")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Generated client implementations.
pub mod flows_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
#[derive(Debug, Clone)]
pub struct FlowsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl FlowsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> FlowsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> FlowsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
FlowsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Creates a flow in the specified agent.
pub async fn create_flow(
&mut self,
request: impl tonic::IntoRequest<super::CreateFlowRequest>,
) -> Result<tonic::Response<super::Flow>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/CreateFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes a specified flow.
pub async fn delete_flow(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFlowRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/DeleteFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Returns the list of all flows in the specified agent.
pub async fn list_flows(
&mut self,
request: impl tonic::IntoRequest<super::ListFlowsRequest>,
) -> Result<tonic::Response<super::ListFlowsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/ListFlows",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified flow.
pub async fn get_flow(
&mut self,
request: impl tonic::IntoRequest<super::GetFlowRequest>,
) -> Result<tonic::Response<super::Flow>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/GetFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified flow.
pub async fn update_flow(
&mut self,
request: impl tonic::IntoRequest<super::UpdateFlowRequest>,
) -> Result<tonic::Response<super::Flow>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/UpdateFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Trains the specified flow. Note that only the flow in 'draft' environment
/// is trained.
pub async fn train_flow(
&mut self,
request: impl tonic::IntoRequest<super::TrainFlowRequest>,
) -> Result<
tonic::Response<super::super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/TrainFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Validates the specified flow and creates or updates validation results.
/// Please call this API after the training is completed to get the complete
/// validation results.
pub async fn validate_flow(
&mut self,
request: impl tonic::IntoRequest<super::ValidateFlowRequest>,
) -> Result<tonic::Response<super::FlowValidationResult>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/ValidateFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Gets the latest flow validation result. Flow validation is performed
/// when ValidateFlow is called.
pub async fn get_flow_validation_result(
&mut self,
request: impl tonic::IntoRequest<super::GetFlowValidationResultRequest>,
) -> Result<tonic::Response<super::FlowValidationResult>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Flows/GetFlowValidationResult",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// An intent represents a user's intent to interact with a conversational agent.
///
/// You can provide information for the Dialogflow API to use to match user input
/// to an intent by adding training phrases (i.e., examples of user input) to
/// your intent.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Intent {
/// The unique identifier of the intent.
/// Required for the \[Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent\] method. \[Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent\]
/// populates the name automatically.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The human-readable name of the intent, unique within the agent.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// The collection of training phrases the agent is trained on to identify the
/// intent.
#[prost(message, repeated, tag="3")]
pub training_phrases: ::prost::alloc::vec::Vec<intent::TrainingPhrase>,
/// The collection of parameters associated with the intent.
#[prost(message, repeated, tag="4")]
pub parameters: ::prost::alloc::vec::Vec<intent::Parameter>,
/// The priority of this intent. Higher numbers represent higher
/// priorities.
///
/// - If the supplied value is unspecified or 0, the service
/// translates the value to 500,000, which corresponds to the
/// `Normal` priority in the console.
/// - If the supplied value is negative, the intent is ignored
/// in runtime detect intent requests.
#[prost(int32, tag="5")]
pub priority: i32,
/// Indicates whether this is a fallback intent. Currently only default
/// fallback intent is allowed in the agent, which is added upon agent
/// creation.
/// Adding training phrases to fallback intent is useful in the case of
/// requests that are mistakenly matched, since training phrases assigned to
/// fallback intents act as negative examples that triggers no-match event.
#[prost(bool, tag="6")]
pub is_fallback: bool,
/// The key/value metadata to label an intent. Labels can contain
/// lowercase letters, digits and the symbols '-' and '_'. International
/// characters are allowed, including letters from unicase alphabets. Keys must
/// start with a letter. Keys and values can be no longer than 63 characters
/// and no more than 128 bytes.
///
/// Prefix "sys." is reserved for Dialogflow defined labels. Currently allowed
/// Dialogflow defined labels include:
/// * sys.head
/// * sys.contextual
/// The above labels do not require value. "sys.head" means the intent is a
/// head intent. "sys.contextual" means the intent is a contextual intent.
#[prost(map="string, string", tag="7")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
/// Human readable description for better understanding an intent like its
/// scope, content, result etc. Maximum character limit: 140 characters.
#[prost(string, tag="8")]
pub description: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Intent`.
pub mod intent {
/// Represents an example that the agent is trained on to identify the intent.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainingPhrase {
/// Output only. The unique identifier of the training phrase.
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
/// Required. The ordered list of training phrase parts.
/// The parts are concatenated in order to form the training phrase.
///
/// Note: The API does not automatically annotate training phrases like the
/// Dialogflow Console does.
///
/// Note: Do not forget to include whitespace at part boundaries, so the
/// training phrase is well formatted when the parts are concatenated.
///
/// If the training phrase does not need to be annotated with parameters,
/// you just need a single part with only the \[Part.text][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part.text\] field set.
///
/// If you want to annotate the training phrase, you must create multiple
/// parts, where the fields of each part are populated in one of two ways:
///
/// - `Part.text` is set to a part of the phrase that has no parameters.
/// - `Part.text` is set to a part of the phrase that you want to annotate,
/// and the `parameter_id` field is set.
#[prost(message, repeated, tag="2")]
pub parts: ::prost::alloc::vec::Vec<training_phrase::Part>,
/// Indicates how many times this example was added to the intent.
#[prost(int32, tag="3")]
pub repeat_count: i32,
}
/// Nested message and enum types in `TrainingPhrase`.
pub mod training_phrase {
/// Represents a part of a training phrase.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Part {
/// Required. The text for this part.
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
/// The \[parameter][google.cloud.dialogflow.cx.v3.Intent.Parameter\] used to annotate this part of the
/// training phrase. This field is required for annotated parts of the
/// training phrase.
#[prost(string, tag="2")]
pub parameter_id: ::prost::alloc::string::String,
}
}
/// Represents an intent parameter.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
/// Required. The unique identifier of the parameter. This field
/// is used by [training phrases]\[google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase\] to annotate their
/// \[parts][google.cloud.dialogflow.cx.v3.Intent.TrainingPhrase.Part\].
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
/// Required. The entity type of the parameter.
/// Format: `projects/-/locations/-/agents/-/entityTypes/<System Entity Type
/// ID>` for system entity types (for example,
/// `projects/-/locations/-/agents/-/entityTypes/sys.date`), or
/// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/entityTypes/<Entity Type ID>` for developer entity types.
#[prost(string, tag="2")]
pub entity_type: ::prost::alloc::string::String,
/// Indicates whether the parameter represents a list of values.
#[prost(bool, tag="3")]
pub is_list: bool,
/// Indicates whether the parameter content should be redacted in log. If
/// redaction is enabled, the parameter content will be replaced by parameter
/// name during logging.
/// Note: the parameter content is subject to redaction if either parameter
/// level redaction or [entity type level redaction]\[google.cloud.dialogflow.cx.v3.EntityType.redact\] is
/// enabled.
#[prost(bool, tag="4")]
pub redact: bool,
}
}
/// The request message for \[Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIntentsRequest {
/// Required. The agent to list all intents for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// The language to list intents for. The following fields are language
/// dependent:
///
/// * `Intent.training_phrases.parts.text`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The resource view to apply to the returned intent.
#[prost(enumeration="IntentView", tag="5")]
pub intent_view: i32,
/// The maximum number of items to return in a single page. By default 100 and
/// at most 1000.
#[prost(int32, tag="3")]
pub page_size: i32,
/// The next_page_token value returned from a previous list request.
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIntentsResponse {
/// The list of intents. There will be a maximum number of items returned based
/// on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub intents: ::prost::alloc::vec::Vec<Intent>,
/// Token to retrieve the next page of results, or empty if there are no more
/// results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[Intents.GetIntent][google.cloud.dialogflow.cx.v3.Intents.GetIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIntentRequest {
/// Required. The name of the intent.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// The language to retrieve the intent for. The following fields are language
/// dependent:
///
/// * `Intent.training_phrases.parts.text`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIntentRequest {
/// Required. The agent to create an intent for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The intent to create.
#[prost(message, optional, tag="2")]
pub intent: ::core::option::Option<Intent>,
/// The language of the following fields in `intent`:
///
/// * `Intent.training_phrases.parts.text`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateIntentRequest {
/// Required. The intent to update.
#[prost(message, optional, tag="1")]
pub intent: ::core::option::Option<Intent>,
/// The language of the following fields in `intent`:
///
/// * `Intent.training_phrases.parts.text`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The mask to control which fields get updated. If the mask is not present,
/// all fields will be updated.
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[Intents.DeleteIntent][google.cloud.dialogflow.cx.v3.Intents.DeleteIntent\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIntentRequest {
/// Required. The name of the intent to delete.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// Represents the options for views of an intent.
/// An intent can be a sizable object. Therefore, we provide a resource view that
/// does not return training phrases in the response.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IntentView {
/// Not specified. Treated as INTENT_VIEW_FULL.
Unspecified = 0,
/// Training phrases field is not populated in the response.
Partial = 1,
/// All fields are populated.
Full = 2,
}
impl IntentView {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
IntentView::Unspecified => "INTENT_VIEW_UNSPECIFIED",
IntentView::Partial => "INTENT_VIEW_PARTIAL",
IntentView::Full => "INTENT_VIEW_FULL",
}
}
}
/// Generated client implementations.
pub mod intents_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
#[derive(Debug, Clone)]
pub struct IntentsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl IntentsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> IntentsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> IntentsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
IntentsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all intents in the specified agent.
pub async fn list_intents(
&mut self,
request: impl tonic::IntoRequest<super::ListIntentsRequest>,
) -> Result<tonic::Response<super::ListIntentsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Intents/ListIntents",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified intent.
pub async fn get_intent(
&mut self,
request: impl tonic::IntoRequest<super::GetIntentRequest>,
) -> Result<tonic::Response<super::Intent>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Intents/GetIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates an intent in the specified agent.
pub async fn create_intent(
&mut self,
request: impl tonic::IntoRequest<super::CreateIntentRequest>,
) -> Result<tonic::Response<super::Intent>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Intents/CreateIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified intent.
pub async fn update_intent(
&mut self,
request: impl tonic::IntoRequest<super::UpdateIntentRequest>,
) -> Result<tonic::Response<super::Intent>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Intents/UpdateIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified intent.
pub async fn delete_intent(
&mut self,
request: impl tonic::IntoRequest<super::DeleteIntentRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Intents/DeleteIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// Entities are extracted from user input and represent parameters that are
/// meaningful to your application. For example, a date range, a proper name
/// such as a geographic location or landmark, and so on. Entities represent
/// actionable data for your application.
///
/// When you define an entity, you can also include synonyms that all map to
/// that entity. For example, "soft drink", "soda", "pop", and so on.
///
/// There are three types of entities:
///
/// * **System** - entities that are defined by the Dialogflow API for common
/// data types such as date, time, currency, and so on. A system entity is
/// represented by the `EntityType` type.
///
/// * **Custom** - entities that are defined by you that represent
/// actionable data that is meaningful to your application. For example,
/// you could define a `pizza.sauce` entity for red or white pizza sauce,
/// a `pizza.cheese` entity for the different types of cheese on a pizza,
/// a `pizza.topping` entity for different toppings, and so on. A custom
/// entity is represented by the `EntityType` type.
///
/// * **User** - entities that are built for an individual user such as
/// favorites, preferences, playlists, and so on. A user entity is
/// represented by the \[SessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityType\] type.
///
/// For more information about entity types, see the [Dialogflow
/// documentation](<https://cloud.google.com/dialogflow/docs/entities-overview>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityType {
/// The unique identifier of the entity type.
/// Required for \[EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType\].
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. The human-readable name of the entity type, unique within the agent.
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
/// Required. Indicates the kind of entity type.
#[prost(enumeration="entity_type::Kind", tag="3")]
pub kind: i32,
/// Indicates whether the entity type can be automatically expanded.
#[prost(enumeration="entity_type::AutoExpansionMode", tag="4")]
pub auto_expansion_mode: i32,
/// The collection of entity entries associated with the entity type.
#[prost(message, repeated, tag="5")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
/// Collection of exceptional words and phrases that shouldn't be matched.
/// For example, if you have a size entity type with entry `giant`(an
/// adjective), you might consider adding `giants`(a noun) as an exclusion.
/// If the kind of entity type is `KIND_MAP`, then the phrases specified by
/// entities and excluded phrases should be mutually exclusive.
#[prost(message, repeated, tag="6")]
pub excluded_phrases: ::prost::alloc::vec::Vec<entity_type::ExcludedPhrase>,
/// Enables fuzzy entity extraction during classification.
#[prost(bool, tag="7")]
pub enable_fuzzy_extraction: bool,
/// Indicates whether parameters of the entity type should be redacted in log.
/// If redaction is enabled, page parameters and intent parameters referring to
/// the entity type will be replaced by parameter name when logging.
#[prost(bool, tag="9")]
pub redact: bool,
}
/// Nested message and enum types in `EntityType`.
pub mod entity_type {
/// An **entity entry** for an associated entity type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entity {
/// Required. The primary value associated with this entity entry.
/// For example, if the entity type is *vegetable*, the value could be
/// *scallions*.
///
/// For `KIND_MAP` entity types:
///
/// * A canonical value to be used in place of synonyms.
///
/// For `KIND_LIST` entity types:
///
/// * A string that can contain references to other entity types (with or
/// without aliases).
#[prost(string, tag="1")]
pub value: ::prost::alloc::string::String,
/// Required. A collection of value synonyms. For example, if the entity type
/// is *vegetable*, and `value` is *scallions*, a synonym could be *green
/// onions*.
///
/// For `KIND_LIST` entity types:
///
/// * This collection must contain exactly one synonym equal to `value`.
#[prost(string, repeated, tag="2")]
pub synonyms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// An excluded entity phrase that should not be matched.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExcludedPhrase {
/// Required. The word or phrase to be excluded.
#[prost(string, tag="1")]
pub value: ::prost::alloc::string::String,
}
/// Represents kinds of entities.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Kind {
/// Not specified. This value should be never used.
Unspecified = 0,
/// Map entity types allow mapping of a group of synonyms to a canonical
/// value.
Map = 1,
/// List entity types contain a set of entries that do not map to canonical
/// values. However, list entity types can contain references to other entity
/// types (with or without aliases).
List = 2,
/// Regexp entity types allow to specify regular expressions in entries
/// values.
Regexp = 3,
}
impl Kind {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Kind::Unspecified => "KIND_UNSPECIFIED",
Kind::Map => "KIND_MAP",
Kind::List => "KIND_LIST",
Kind::Regexp => "KIND_REGEXP",
}
}
}
/// Represents different entity type expansion modes. Automated expansion
/// allows an agent to recognize values that have not been explicitly listed in
/// the entity (for example, new kinds of shopping list items).
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AutoExpansionMode {
/// Auto expansion disabled for the entity.
Unspecified = 0,
/// Allows an agent to recognize values that have not been explicitly
/// listed in the entity.
Default = 1,
}
impl AutoExpansionMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AutoExpansionMode::Unspecified => "AUTO_EXPANSION_MODE_UNSPECIFIED",
AutoExpansionMode::Default => "AUTO_EXPANSION_MODE_DEFAULT",
}
}
}
}
/// The request message for \[EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntityTypesRequest {
/// Required. The agent to list all entity types for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// The language to list entity types for. The following fields are language
/// dependent:
///
/// * `EntityType.entities.value`
/// * `EntityType.entities.synonyms`
/// * `EntityType.excluded_phrases.value`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The maximum number of items to return in a single page. By default 100 and
/// at most 1000.
#[prost(int32, tag="3")]
pub page_size: i32,
/// The next_page_token value returned from a previous list request.
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntityTypesResponse {
/// The list of entity types. There will be a maximum number of items returned
/// based on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub entity_types: ::prost::alloc::vec::Vec<EntityType>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEntityTypeRequest {
/// Required. The name of the entity type.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// The language to retrieve the entity type for. The following fields are
/// language dependent:
///
/// * `EntityType.entities.value`
/// * `EntityType.entities.synonyms`
/// * `EntityType.excluded_phrases.value`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEntityTypeRequest {
/// Required. The agent to create a entity type for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The entity type to create.
#[prost(message, optional, tag="2")]
pub entity_type: ::core::option::Option<EntityType>,
/// The language of the following fields in `entity_type`:
///
/// * `EntityType.entities.value`
/// * `EntityType.entities.synonyms`
/// * `EntityType.excluded_phrases.value`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
/// The request message for \[EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateEntityTypeRequest {
/// Required. The entity type to update.
#[prost(message, optional, tag="1")]
pub entity_type: ::core::option::Option<EntityType>,
/// The language of the following fields in `entity_type`:
///
/// * `EntityType.entities.value`
/// * `EntityType.entities.synonyms`
/// * `EntityType.excluded_phrases.value`
///
/// If not specified, the agent's default language is used.
/// [Many
/// languages](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// are supported.
/// Note: languages must be enabled in the agent before they can be used.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The mask to control which fields get updated.
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEntityTypeRequest {
/// Required. The name of the entity type to delete.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/entityTypes/<Entity Type ID>`.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// This field has no effect for entity type not being used.
/// For entity types that are used by intents or pages:
///
/// * If `force` is set to false, an error will be returned with message
/// indicating the referencing resources.
/// * If `force` is set to true, Dialogflow will remove the entity type, as
/// well as any references to the entity type (i.e. Page
/// \[parameter][google.cloud.dialogflow.cx.v3.Form.Parameter\] of the entity type will be changed to
/// '@sys.any' and intent \[parameter][google.cloud.dialogflow.cx.v3.Intent.Parameter\] of the entity type
/// will be removed).
#[prost(bool, tag="2")]
pub force: bool,
}
/// Generated client implementations.
pub mod entity_types_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
#[derive(Debug, Clone)]
pub struct EntityTypesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EntityTypesClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> EntityTypesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> EntityTypesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
EntityTypesClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all entity types in the specified agent.
pub async fn list_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::ListEntityTypesRequest>,
) -> Result<tonic::Response<super::ListEntityTypesResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.EntityTypes/ListEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified entity type.
pub async fn get_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::GetEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.EntityTypes/GetEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates an entity type in the specified agent.
pub async fn create_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::CreateEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.EntityTypes/CreateEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified entity type.
pub async fn update_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::UpdateEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.EntityTypes/UpdateEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified entity type.
pub async fn delete_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::DeleteEntityTypeRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.EntityTypes/DeleteEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// Session entity types are referred to as **User** entity types and are
/// entities that are built for an individual user such as favorites,
/// preferences, playlists, and so on.
///
/// You can redefine a session entity type at the session level to extend or
/// replace a [custom entity type]\[google.cloud.dialogflow.cx.v3.EntityType\] at the user session level (we
/// refer to the entity types defined at the agent level as "custom entity
/// types").
///
/// Note: session entity types apply to all queries, regardless of the language.
///
/// For more information about entity types, see the [Dialogflow
/// documentation](<https://cloud.google.com/dialogflow/docs/entities-overview>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SessionEntityType {
/// Required. The unique identifier of the session entity type.
/// Format: `projects/<Project ID>/locations/<Location
/// ID>/agents/<Agent ID>/sessions/<Session ID>/entityTypes/<Entity Type
/// ID>` or `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
/// Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
/// environment.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// Required. Indicates whether the additional data should override or supplement the
/// custom entity type definition.
#[prost(enumeration="session_entity_type::EntityOverrideMode", tag="3")]
pub entity_override_mode: i32,
/// Required. The collection of entities to override or supplement the custom entity
/// type.
#[prost(message, repeated, tag="4")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
}
/// Nested message and enum types in `SessionEntityType`.
pub mod session_entity_type {
/// The types of modifications for the session entity type.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EntityOverrideMode {
/// Not specified. This value should be never used.
Unspecified = 0,
/// The collection of session entities overrides the collection of entities
/// in the corresponding custom entity type.
Override = 1,
/// The collection of session entities extends the collection of entities in
/// the corresponding custom entity type.
///
/// Note: Even in this override mode calls to `ListSessionEntityTypes`,
/// `GetSessionEntityType`, `CreateSessionEntityType` and
/// `UpdateSessionEntityType` only return the additional entities added in
/// this session entity type. If you want to get the supplemented list,
/// please call \[EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType\] on the custom entity type
/// and merge.
Supplement = 2,
}
impl EntityOverrideMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
EntityOverrideMode::Unspecified => "ENTITY_OVERRIDE_MODE_UNSPECIFIED",
EntityOverrideMode::Override => "ENTITY_OVERRIDE_MODE_OVERRIDE",
EntityOverrideMode::Supplement => "ENTITY_OVERRIDE_MODE_SUPPLEMENT",
}
}
}
}
/// The request message for \[SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionEntityTypesRequest {
/// Required. The session to list all session entity types from.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
/// ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return in a single page. By default 100 and
/// at most 1000.
#[prost(int32, tag="2")]
pub page_size: i32,
/// The next_page_token value returned from a previous list request.
#[prost(string, tag="3")]
pub page_token: ::prost::alloc::string::String,
}
/// The response message for \[SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionEntityTypesResponse {
/// The list of session entity types. There will be a maximum number of items
/// returned based on the page_size field in the request.
#[prost(message, repeated, tag="1")]
pub session_entity_types: ::prost::alloc::vec::Vec<SessionEntityType>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for \[SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSessionEntityTypeRequest {
/// Required. The name of the session entity type.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
/// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
/// Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
/// environment.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// The request message for \[SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSessionEntityTypeRequest {
/// Required. The session to create a session entity type for.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
/// ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment.
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
/// Required. The session entity type to create.
#[prost(message, optional, tag="2")]
pub session_entity_type: ::core::option::Option<SessionEntityType>,
}
/// The request message for \[SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSessionEntityTypeRequest {
/// Required. The session entity type to update.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
/// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
/// Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
/// environment.
#[prost(message, optional, tag="1")]
pub session_entity_type: ::core::option::Option<SessionEntityType>,
/// The mask to control which fields get updated.
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request message for \[SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityType\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSessionEntityTypeRequest {
/// Required. The name of the session entity type to delete.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
/// `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
/// Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
/// environment.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod session_entity_types_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
#[derive(Debug, Clone)]
pub struct SessionEntityTypesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SessionEntityTypesClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SessionEntityTypesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SessionEntityTypesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SessionEntityTypesClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Returns the list of all session entity types in the specified session.
pub async fn list_session_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::ListSessionEntityTypesRequest>,
) -> Result<
tonic::Response<super::ListSessionEntityTypesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.SessionEntityTypes/ListSessionEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Retrieves the specified session entity type.
pub async fn get_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::GetSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.SessionEntityTypes/GetSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Creates a session entity type.
pub async fn create_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::CreateSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.SessionEntityTypes/CreateSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Updates the specified session entity type.
pub async fn update_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.SessionEntityTypes/UpdateSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Deletes the specified session entity type.
pub async fn delete_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSessionEntityTypeRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.SessionEntityTypes/DeleteSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
/// The request to detect user's intent.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectIntentRequest {
/// Required. The name of the session this query is sent to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
/// ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment.
/// It's up to the API caller to choose an appropriate `Session ID`. It can be
/// a random number or some type of session identifiers (preferably hashed).
/// The length of the `Session ID` must not exceed 36 characters.
///
/// 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>).
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
/// The parameters of this query.
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
/// Required. The input specification.
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
/// Instructs the speech synthesizer how to generate the output audio.
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// The message returned from the DetectIntent method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectIntentResponse {
/// Output only. The unique identifier of the response. It can be used to
/// locate a response in the training example set or for reporting issues.
#[prost(string, tag="1")]
pub response_id: ::prost::alloc::string::String,
/// The result of the conversational query.
#[prost(message, optional, tag="2")]
pub query_result: ::core::option::Option<QueryResult>,
/// The audio data bytes encoded as specified in the request.
/// Note: The output audio is generated based on the values of default platform
/// text responses found in the
/// \[`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages\] field. If
/// multiple default text responses exist, they will be concatenated when
/// generating audio. If no default platform text responses exist, the
/// generated audio content will be empty.
///
/// In some scenarios, multiple output audio fields may be present in the
/// response structure. In these cases, only the top-most-level audio output
/// has content.
#[prost(bytes="vec", tag="4")]
pub output_audio: ::prost::alloc::vec::Vec<u8>,
/// The config used by the speech synthesizer to generate the output audio.
#[prost(message, optional, tag="5")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// The top-level message sent by the client to the
/// \[Sessions.StreamingDetectIntent][google.cloud.dialogflow.cx.v3.Sessions.StreamingDetectIntent\] method.
///
/// Multiple request messages should be sent in order:
///
/// 1. The first message must contain
/// \[session][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.session\],
/// \[query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input\] plus optionally
/// \[query_params][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_params\]. If the client
/// wants to receive an audio response, it should also contain
/// \[output_audio_config][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.output_audio_config\].
///
/// 2. If \[query_input][google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.query_input\] was set to
/// \[query_input.audio.config][google.cloud.dialogflow.cx.v3.AudioInput.config\], all subsequent messages
/// must contain \[query_input.audio.audio][google.cloud.dialogflow.cx.v3.AudioInput.audio\] to continue with
/// Speech recognition.
/// If you decide to rather detect an intent from text
/// input after you already started Speech recognition, please send a message
/// with \[query_input.text][google.cloud.dialogflow.cx.v3.QueryInput.text\].
///
/// However, note that:
///
/// * Dialogflow will bill you for the audio duration so far.
/// * Dialogflow discards all Speech recognition results in favor of the
/// input text.
/// * Dialogflow will use the language code from the first message.
///
/// After you sent all input, you must half-close or abort the request stream.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingDetectIntentRequest {
/// The name of the session this query is sent to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
/// ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment.
/// It's up to the API caller to choose an appropriate `Session ID`. It can be
/// a random number or some type of session identifiers (preferably hashed).
/// The length of the `Session ID` must not exceed 36 characters.
/// Note: session must be set in the first request.
///
/// 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>).
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
/// The parameters of this query.
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
/// Required. The input specification.
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
/// Instructs the speech synthesizer how to generate the output audio.
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// The top-level message returned from the `StreamingDetectIntent` method.
///
/// Multiple response messages can be returned in order:
///
/// 1. If the input was set to streaming audio, the first one or more messages
/// contain `recognition_result`. Each `recognition_result` represents a more
/// complete transcript of what the user said. The last `recognition_result`
/// has `is_final` set to `true`.
///
/// 2. The last message contains `detect_intent_response`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingDetectIntentResponse {
/// The output response.
#[prost(oneof="streaming_detect_intent_response::Response", tags="1, 2")]
pub response: ::core::option::Option<streaming_detect_intent_response::Response>,
}
/// Nested message and enum types in `StreamingDetectIntentResponse`.
pub mod streaming_detect_intent_response {
/// The output response.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
/// The result of speech recognition.
#[prost(message, tag="1")]
RecognitionResult(super::StreamingRecognitionResult),
/// The response from detect intent.
#[prost(message, tag="2")]
DetectIntentResponse(super::DetectIntentResponse),
}
}
/// Contains a speech recognition result corresponding to a portion of the audio
/// that is currently being processed or an indication that this is the end
/// of the single requested utterance.
///
/// Example:
///
/// 1. transcript: "tube"
///
/// 2. transcript: "to be a"
///
/// 3. transcript: "to be"
///
/// 4. transcript: "to be or not to be"
/// is_final: true
///
/// 5. transcript: " that's"
///
/// 6. transcript: " that is"
///
/// 7. message_type: `END_OF_SINGLE_UTTERANCE`
///
/// 8. transcript: " that is the question"
/// is_final: true
///
/// Only two of the responses contain final results (#4 and #8 indicated by
/// `is_final: true`). Concatenating these generates the full transcript: "to be
/// or not to be that is the question".
///
/// In each response we populate:
///
/// * for `TRANSCRIPT`: `transcript` and possibly `is_final`.
///
/// * for `END_OF_SINGLE_UTTERANCE`: only `message_type`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingRecognitionResult {
/// Type of the result message.
#[prost(enumeration="streaming_recognition_result::MessageType", tag="1")]
pub message_type: i32,
/// Transcript text representing the words that the user spoke.
/// Populated if and only if `message_type` = `TRANSCRIPT`.
#[prost(string, tag="2")]
pub transcript: ::prost::alloc::string::String,
/// If `false`, the `StreamingRecognitionResult` represents an
/// interim result that may change. If `true`, the recognizer will not return
/// any further hypotheses about this piece of the audio. May only be populated
/// for `message_type` = `TRANSCRIPT`.
#[prost(bool, tag="3")]
pub is_final: bool,
/// The Speech confidence between 0.0 and 1.0 for the current portion of audio.
/// A higher number indicates an estimated greater likelihood that the
/// recognized words are correct. The default of 0.0 is a sentinel value
/// indicating that confidence was not set.
///
/// This field is typically only provided if `is_final` is true and you should
/// not rely on it being accurate or even set.
#[prost(float, tag="4")]
pub confidence: f32,
/// An estimate of the likelihood that the speech recognizer will
/// not change its guess about this interim recognition result:
/// * If the value is unspecified or 0.0, Dialogflow didn't compute the
/// stability. In particular, Dialogflow will only provide stability for
/// `TRANSCRIPT` results with `is_final = false`.
/// * Otherwise, the value is in (0.0, 1.0] where 0.0 means completely
/// unstable and 1.0 means completely stable.
#[prost(float, tag="6")]
pub stability: f32,
/// Word-specific information for the words recognized by Speech in
/// \[transcript][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.transcript\]. Populated if and only if `message_type` = `TRANSCRIPT` and
/// \[InputAudioConfig.enable_word_info\] is set.
#[prost(message, repeated, tag="7")]
pub speech_word_info: ::prost::alloc::vec::Vec<SpeechWordInfo>,
/// Time offset of the end of this Speech recognition result relative to the
/// beginning of the audio. Only populated for `message_type` =
/// `TRANSCRIPT`.
#[prost(message, optional, tag="8")]
pub speech_end_offset: ::core::option::Option<::prost_types::Duration>,
}
/// Nested message and enum types in `StreamingRecognitionResult`.
pub mod streaming_recognition_result {
/// Type of the response message.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageType {
/// Not specified. Should never be used.
Unspecified = 0,
/// Message contains a (possibly partial) transcript.
Transcript = 1,
/// Event indicates that the server has detected the end of the user's speech
/// utterance and expects no additional speech. Therefore, the server will
/// not process additional audio (although it may subsequently return
/// additional results). The client should stop sending additional audio
/// data, half-close the gRPC connection, and wait for any additional results
/// until the server closes the gRPC connection. This message is only sent if
/// \[`single_utterance`][google.cloud.dialogflow.cx.v3.InputAudioConfig.single_utterance\] was set to
/// `true`, and is not used otherwise.
EndOfSingleUtterance = 2,
}
impl MessageType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
MessageType::Unspecified => "MESSAGE_TYPE_UNSPECIFIED",
MessageType::Transcript => "TRANSCRIPT",
MessageType::EndOfSingleUtterance => "END_OF_SINGLE_UTTERANCE",
}
}
}
}
/// Represents the parameters of a conversational query.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParameters {
/// The time zone of this conversational query from the [time zone
/// database](<https://www.iana.org/time-zones>), e.g., America/New_York,
/// Europe/Paris. If not provided, the time zone specified in the agent is
/// used.
#[prost(string, tag="1")]
pub time_zone: ::prost::alloc::string::String,
/// The geo location of this conversational query.
#[prost(message, optional, tag="2")]
pub geo_location: ::core::option::Option<super::super::super::super::r#type::LatLng>,
/// Additional session entity types to replace or extend developer entity types
/// with. The entity synonyms apply to all languages and persist for the
/// session of this query.
#[prost(message, repeated, tag="3")]
pub session_entity_types: ::prost::alloc::vec::Vec<SessionEntityType>,
/// This field can be used to pass custom data into the webhook associated with
/// the agent. Arbitrary JSON objects are supported.
#[prost(message, optional, tag="4")]
pub payload: ::core::option::Option<::prost_types::Struct>,
/// Additional parameters to be put into [session
/// parameters]\[SessionInfo.parameters\]. To remove a
/// parameter from the session, clients should explicitly set the parameter
/// value to null.
///
/// Depending on your protocol or client library language, this is a
/// map, associative array, symbol table, dictionary, or JSON object
/// composed of a collection of (MapKey, MapValue) pairs:
///
/// - MapKey type: string
/// - MapKey value: parameter name
/// - MapValue type:
/// - If parameter's entity type is a composite entity: map
/// - Else: depending on parameter value type, could be one of string,
/// number, boolean, null, list or map
/// - MapValue value:
/// - If parameter's entity type is a composite entity:
/// map from composite entity property names to property values
/// - Else: parameter value
#[prost(message, optional, tag="5")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
/// The unique identifier of the \[page][google.cloud.dialogflow.cx.v3.Page\] to override the [current
/// page]\[QueryResult.current_page\] in the session. Format: `projects/<Project
/// ID>/locations/<Location ID>/agents/<Agent ID>/pages/<page ID>`.
///
/// If `current_page` is specified, the previous state of the session will be
/// ignored by Dialogflow, including the [previous
/// page]\[QueryResult.current_page\] and the [previous session
/// parameters]\[QueryResult.parameters\].
/// In most cases, \[current_page][google.cloud.dialogflow.cx.v3.QueryParameters.current_page\] and
/// \[parameters][google.cloud.dialogflow.cx.v3.QueryParameters.parameters\] should be configured together to
/// direct a session to a specific state.
#[prost(string, tag="6")]
pub current_page: ::prost::alloc::string::String,
/// Whether to disable webhook calls for this request.
#[prost(bool, tag="7")]
pub disable_webhook: bool,
/// Configures whether sentiment analysis should be performed. If not
/// provided, sentiment analysis is not performed.
#[prost(bool, tag="8")]
pub analyze_query_text_sentiment: bool,
/// 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.
#[prost(map="string, string", tag="10")]
pub webhook_headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// Represents the query input. It can contain one of:
///
/// 1. A conversational query in the form of text.
///
/// 2. An intent query that specifies which intent to trigger.
///
/// 3. Natural language speech audio to be processed.
///
/// 4. An event to be triggered.
///
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryInput {
/// Required. The language of the input. See [Language
/// Support](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// for a list of the currently supported language codes. Note that queries in
/// the same session do not necessarily need to specify the same language.
#[prost(string, tag="4")]
pub language_code: ::prost::alloc::string::String,
/// Required. The input specification.
#[prost(oneof="query_input::Input", tags="2, 3, 5, 6, 7")]
pub input: ::core::option::Option<query_input::Input>,
}
/// Nested message and enum types in `QueryInput`.
pub mod query_input {
/// Required. The input specification.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Input {
/// The natural language text to be processed.
#[prost(message, tag="2")]
Text(super::TextInput),
/// The intent to be triggered.
#[prost(message, tag="3")]
Intent(super::IntentInput),
/// The natural language speech audio to be processed.
#[prost(message, tag="5")]
Audio(super::AudioInput),
/// The event to be triggered.
#[prost(message, tag="6")]
Event(super::EventInput),
/// The DTMF event to be handled.
#[prost(message, tag="7")]
Dtmf(super::DtmfInput),
}
}
/// Represents the result of a conversational query.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResult {
/// The language that was triggered during intent detection.
/// See [Language
/// Support](<https://cloud.google.com/dialogflow/cx/docs/reference/language>)
/// for a list of the currently supported language codes.
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
/// The collected [session parameters]\[google.cloud.dialogflow.cx.v3.SessionInfo.parameters\].
///
/// Depending on your protocol or client library language, this is a
/// map, associative array, symbol table, dictionary, or JSON object
/// composed of a collection of (MapKey, MapValue) pairs:
///
/// - MapKey type: string
/// - MapKey value: parameter name
/// - MapValue type:
/// - If parameter's entity type is a composite entity: map
/// - Else: depending on parameter value type, could be one of string,
/// number, boolean, null, list or map
/// - MapValue value:
/// - If parameter's entity type is a composite entity:
/// map from composite entity property names to property values
/// - Else: parameter value
#[prost(message, optional, tag="3")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
/// The list of rich messages returned to the client. Responses vary from
/// simple text messages to more sophisticated, structured payloads used
/// to drive complex logic.
#[prost(message, repeated, tag="4")]
pub response_messages: ::prost::alloc::vec::Vec<ResponseMessage>,
/// The list of webhook call status in the order of call sequence.
#[prost(message, repeated, tag="13")]
pub webhook_statuses: ::prost::alloc::vec::Vec<super::super::super::super::rpc::Status>,
/// The list of webhook payload in \[WebhookResponse.payload][google.cloud.dialogflow.cx.v3.WebhookResponse.payload\], in
/// the order of call sequence. If some webhook call fails or doesn't return
/// any payload, an empty `Struct` would be used instead.
#[prost(message, repeated, tag="6")]
pub webhook_payloads: ::prost::alloc::vec::Vec<::prost_types::Struct>,
/// The current \[Page][google.cloud.dialogflow.cx.v3.Page\]. Some, not all fields are filled in this message,
/// including but not limited to `name` and `display_name`.
#[prost(message, optional, tag="7")]
pub current_page: ::core::option::Option<Page>,
/// The \[Intent][google.cloud.dialogflow.cx.v3.Intent\] that matched the conversational query. Some, not all fields
/// are filled in this message, including but not limited to: `name` and
/// `display_name`.
/// This field is deprecated, please use \[QueryResult.match][google.cloud.dialogflow.cx.v3.QueryResult.match\] instead.
#[deprecated]
#[prost(message, optional, tag="8")]
pub intent: ::core::option::Option<Intent>,
/// The intent detection confidence. Values range from 0.0 (completely
/// uncertain) to 1.0 (completely certain).
/// This value is for informational purpose only and is only used to
/// help match the best intent within the classification threshold.
/// This value may change for the same end-user expression at any time due to a
/// model retraining or change in implementation.
/// This field is deprecated, please use \[QueryResult.match][google.cloud.dialogflow.cx.v3.QueryResult.match\] instead.
#[deprecated]
#[prost(float, tag="9")]
pub intent_detection_confidence: f32,
/// Intent match result, could be an intent or an event.
#[prost(message, optional, tag="15")]
pub r#match: ::core::option::Option<Match>,
/// The free-form diagnostic info. For example, this field could contain
/// webhook call latency. The string keys of the Struct's fields map can change
/// without notice.
#[prost(message, optional, tag="10")]
pub diagnostic_info: ::core::option::Option<::prost_types::Struct>,
/// The sentiment analyss result, which depends on
/// \[`analyze_query_text_sentiment`\]
/// \[google.cloud.dialogflow.cx.v3.QueryParameters.analyze_query_text_sentiment\], specified in the request.
#[prost(message, optional, tag="17")]
pub sentiment_analysis_result: ::core::option::Option<SentimentAnalysisResult>,
/// The original conversational query.
#[prost(oneof="query_result::Query", tags="1, 11, 12, 14")]
pub query: ::core::option::Option<query_result::Query>,
}
/// Nested message and enum types in `QueryResult`.
pub mod query_result {
/// The original conversational query.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
/// If [natural language text]\[google.cloud.dialogflow.cx.v3.TextInput\] was provided as input, this field
/// will contain a copy of the text.
#[prost(string, tag="1")]
Text(::prost::alloc::string::String),
/// If an \[intent][google.cloud.dialogflow.cx.v3.IntentInput\] was provided as input, this field will
/// contain a copy of the intent identifier.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
#[prost(string, tag="11")]
TriggerIntent(::prost::alloc::string::String),
/// If [natural language speech audio]\[google.cloud.dialogflow.cx.v3.AudioInput\] was provided as input,
/// this field will contain the transcript for the audio.
#[prost(string, tag="12")]
Transcript(::prost::alloc::string::String),
/// If an \[event][google.cloud.dialogflow.cx.v3.EventInput\] was provided as input, this field will contain
/// the name of the event.
#[prost(string, tag="14")]
TriggerEvent(::prost::alloc::string::String),
}
}
/// Represents the natural language text to be processed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextInput {
/// Required. The UTF-8 encoded natural language text to be processed. Text length must
/// not exceed 256 characters.
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
}
/// Represents the intent to trigger programmatically rather than as a result of
/// natural language processing.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntentInput {
/// Required. The unique identifier of the intent.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
#[prost(string, tag="1")]
pub intent: ::prost::alloc::string::String,
}
/// Represents the natural speech audio to be processed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioInput {
/// Required. Instructs the speech recognizer how to process the speech audio.
#[prost(message, optional, tag="1")]
pub config: ::core::option::Option<InputAudioConfig>,
/// The natural language speech audio to be processed.
/// A single request can contain up to 1 minute of speech audio data.
/// The [transcribed text]\[google.cloud.dialogflow.cx.v3.QueryResult.transcript\] cannot contain more than 256
/// bytes.
///
/// For non-streaming audio detect intent, both `config` and `audio` must be
/// provided.
/// For streaming audio detect intent, `config` must be provided in
/// the first request and `audio` must be provided in all following requests.
#[prost(bytes="vec", tag="2")]
pub audio: ::prost::alloc::vec::Vec<u8>,
}
/// Represents the event to trigger.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventInput {
/// Name of the event.
#[prost(string, tag="1")]
pub event: ::prost::alloc::string::String,
}
/// Represents the input for dtmf event.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DtmfInput {
/// The dtmf digits.
#[prost(string, tag="1")]
pub digits: ::prost::alloc::string::String,
/// The finish digit (if any).
#[prost(string, tag="2")]
pub finish_digit: ::prost::alloc::string::String,
}
/// Represents one match result of \[MatchIntent][\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Match {
/// The \[Intent][google.cloud.dialogflow.cx.v3.Intent\] that matched the query. Some, not all fields are filled in
/// this message, including but not limited to: `name` and `display_name`. Only
/// filled for \[`INTENT`][google.cloud.dialogflow.cx.v3.Match.MatchType\] match type.
#[prost(message, optional, tag="1")]
pub intent: ::core::option::Option<Intent>,
/// The event that matched the query. Only filled for
/// \[`EVENT`][google.cloud.dialogflow.cx.v3.Match.MatchType\] match type.
#[prost(string, tag="6")]
pub event: ::prost::alloc::string::String,
/// The collection of parameters extracted from the query.
///
/// Depending on your protocol or client library language, this is a
/// map, associative array, symbol table, dictionary, or JSON object
/// composed of a collection of (MapKey, MapValue) pairs:
///
/// - MapKey type: string
/// - MapKey value: parameter name
/// - MapValue type:
/// - If parameter's entity type is a composite entity: map
/// - Else: depending on parameter value type, could be one of string,
/// number, boolean, null, list or map
/// - MapValue value:
/// - If parameter's entity type is a composite entity:
/// map from composite entity property names to property values
/// - Else: parameter value
#[prost(message, optional, tag="2")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
/// Final text input which was matched during MatchIntent. This value can be
/// different from original input sent in request because of spelling
/// correction or other processing.
#[prost(string, tag="3")]
pub resolved_input: ::prost::alloc::string::String,
/// Type of this \[Match][google.cloud.dialogflow.cx.v3.Match\].
#[prost(enumeration="r#match::MatchType", tag="4")]
pub match_type: i32,
/// The confidence of this match. Values range from 0.0 (completely uncertain)
/// to 1.0 (completely certain).
/// This value is for informational purpose only and is only used to help match
/// the best intent within the classification threshold. This value may change
/// for the same end-user expression at any time due to a model retraining or
/// change in implementation.
#[prost(float, tag="5")]
pub confidence: f32,
}
/// Nested message and enum types in `Match`.
pub mod r#match {
/// Type of a Match.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MatchType {
/// Not specified. Should never be used.
Unspecified = 0,
/// The query was matched to an intent.
Intent = 1,
/// The query directly triggered an intent.
DirectIntent = 2,
/// The query was used for parameter filling.
ParameterFilling = 3,
/// No match was found for the query.
NoMatch = 4,
/// Indicates an empty query.
NoInput = 5,
/// The query directly triggered an event.
Event = 6,
}
impl MatchType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
MatchType::Unspecified => "MATCH_TYPE_UNSPECIFIED",
MatchType::Intent => "INTENT",
MatchType::DirectIntent => "DIRECT_INTENT",
MatchType::ParameterFilling => "PARAMETER_FILLING",
MatchType::NoMatch => "NO_MATCH",
MatchType::NoInput => "NO_INPUT",
MatchType::Event => "EVENT",
}
}
}
}
/// Request of \[MatchIntent][\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchIntentRequest {
/// Required. The name of the session this query is sent to.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
/// ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
/// If `Environment ID` is not specified, we assume default 'draft'
/// environment.
/// It's up to the API caller to choose an appropriate `Session ID`. It can be
/// a random number or some type of session identifiers (preferably hashed).
/// The length of the `Session ID` must not exceed 36 characters.
///
/// For more information, see the [sessions
/// guide](<https://cloud.google.com/dialogflow/cx/docs/concept/session>).
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
/// The parameters of this query.
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
/// Required. The input specification.
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
}
/// Response of \[MatchIntent][\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchIntentResponse {
/// Match results, if more than one, ordered descendingly by the confidence
/// we have that the particular intent matches the query.
#[prost(message, repeated, tag="4")]
pub matches: ::prost::alloc::vec::Vec<Match>,
/// The current \[Page][google.cloud.dialogflow.cx.v3.Page\]. Some, not all fields are filled in this message,
/// including but not limited to `name` and `display_name`.
#[prost(message, optional, tag="5")]
pub current_page: ::core::option::Option<Page>,
/// The original conversational query.
#[prost(oneof="match_intent_response::Query", tags="1, 2, 3, 6")]
pub query: ::core::option::Option<match_intent_response::Query>,
}
/// Nested message and enum types in `MatchIntentResponse`.
pub mod match_intent_response {
/// The original conversational query.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
/// If [natural language text]\[google.cloud.dialogflow.cx.v3.TextInput\] was provided as input, this field
/// will contain a copy of the text.
#[prost(string, tag="1")]
Text(::prost::alloc::string::String),
/// If an \[intent][google.cloud.dialogflow.cx.v3.IntentInput\] was provided as input, this field will
/// contain a copy of the intent identifier.
/// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
/// ID>/intents/<Intent ID>`.
#[prost(string, tag="2")]
TriggerIntent(::prost::alloc::string::String),
/// If [natural language speech audio]\[google.cloud.dialogflow.cx.v3.AudioInput\] was provided as input,
/// this field will contain the transcript for the audio.
#[prost(string, tag="3")]
Transcript(::prost::alloc::string::String),
/// If an \[event][google.cloud.dialogflow.cx.v3.EventInput\] was provided as input, this field will
/// contain a copy of the event name.
#[prost(string, tag="6")]
TriggerEvent(::prost::alloc::string::String),
}
}
/// Request of \[FulfillIntent][\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FulfillIntentRequest {
/// Must be same as the corresponding MatchIntent request, otherwise the
/// behavior is undefined.
#[prost(message, optional, tag="1")]
pub match_intent_request: ::core::option::Option<MatchIntentRequest>,
/// The matched intent/event to fulfill.
#[prost(message, optional, tag="2")]
pub r#match: ::core::option::Option<Match>,
/// Instructs the speech synthesizer how to generate output audio.
#[prost(message, optional, tag="3")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// Response of \[FulfillIntent][\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FulfillIntentResponse {
/// Output only. The unique identifier of the response. It can be used to
/// locate a response in the training example set or for reporting issues.
#[prost(string, tag="1")]
pub response_id: ::prost::alloc::string::String,
/// The result of the conversational query.
#[prost(message, optional, tag="2")]
pub query_result: ::core::option::Option<QueryResult>,
/// The audio data bytes encoded as specified in the request.
/// Note: The output audio is generated based on the values of default platform
/// text responses found in the
/// \[`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages\] field. If
/// multiple default text responses exist, they will be concatenated when
/// generating audio. If no default platform text responses exist, the
/// generated audio content will be empty.
///
/// In some scenarios, multiple output audio fields may be present in the
/// response structure. In these cases, only the top-most-level audio output
/// has content.
#[prost(bytes="vec", tag="3")]
pub output_audio: ::prost::alloc::vec::Vec<u8>,
/// The config used by the speech synthesizer to generate the output audio.
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
/// The result of sentiment analysis. Sentiment analysis inspects user input
/// and identifies the prevailing subjective opinion, especially to determine a
/// user's attitude as positive, negative, or neutral.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SentimentAnalysisResult {
/// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
/// sentiment).
#[prost(float, tag="1")]
pub score: f32,
/// A non-negative number in the [0, +inf) range, which represents the absolute
/// magnitude of sentiment, regardless of score (positive or negative).
#[prost(float, tag="2")]
pub magnitude: f32,
}
/// Generated client implementations.
pub mod sessions_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// A session represents an interaction with a user. You retrieve user input
/// and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
/// user intent and respond.
#[derive(Debug, Clone)]
pub struct SessionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SessionsClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SessionsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SessionsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SessionsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Processes a natural language query and returns structured, actionable data
/// 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).
pub async fn detect_intent(
&mut self,
request: impl tonic::IntoRequest<super::DetectIntentRequest>,
) -> Result<tonic::Response<super::DetectIntentResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Sessions/DetectIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// 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).
pub async fn streaming_detect_intent(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::StreamingDetectIntentRequest,
>,
) -> Result<
tonic::Response<
tonic::codec::Streaming<super::StreamingDetectIntentResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Sessions/StreamingDetectIntent",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
/// Returns preliminary intent match results, doesn't change the session
/// status.
pub async fn match_intent(
&mut self,
request: impl tonic::IntoRequest<super::MatchIntentRequest>,
) -> Result<tonic::Response<super::MatchIntentResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Sessions/MatchIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
/// Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
/// Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
/// [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
pub async fn fulfill_intent(
&mut self,
request: impl tonic::IntoRequest<super::FulfillIntentRequest>,
) -> Result<tonic::Response<super::FulfillIntentResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dialogflow.cx.v3.Sessions/FulfillIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}