• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Plug-in<a name="EN-US_TOPIC_0000001077767652"></a>
2
3The AI engine framework has defined a set of algorithm plug-in access specifications. Each plug-in needs to implement specified APIs to implement functions such as obtaining the plug-in version information and algorithm inference type, executing synchronous and asynchronous algorithms, loading algorithm plug-ins, uninstalling algorithm plug-ins, setting algorithm configuration information, and obtaining specified algorithm configuration information. Specifically, implement the  **SyncProcess**  API for the synchronous algorithm and the  **AsyncProcess**  API for the asynchronous algorithm.
4
5[Table 1](#table1329717488505)  describes the  **IPlugin**  APIs.
6
7**Table  1**  IPlugin APIs
8
9<a name="table1329717488505"></a>
10<table><thead align="left"><tr id="row52971848135020"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p1728114205110"><a name="p1728114205110"></a><a name="p1728114205110"></a>API</p>
11</th>
12<th class="cellrowborder" valign="top" width="29.34293429342934%" id="mcps1.2.4.1.2"><p id="p172818410516"><a name="p172818410516"></a><a name="p172818410516"></a>Description</p>
13</th>
14<th class="cellrowborder" valign="top" width="37.32373237323732%" id="mcps1.2.4.1.3"><p id="p197291748518"><a name="p197291748518"></a><a name="p197291748518"></a>Parameters</p>
15</th>
16</tr>
17</thead>
18<tbody><tr id="row15297194895013"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p872954205114"><a name="p872954205114"></a><a name="p872954205114"></a>const long long GetVersion() const;</p>
19</td>
20<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p572944205112"><a name="p572944205112"></a><a name="p572944205112"></a><strong id="b20629921155910"><a name="b20629921155910"></a><a name="b20629921155910"></a>Function</strong>: Obtains the plug-in version information.</p>
21<p id="p107294413512"><a name="p107294413512"></a><a name="p107294413512"></a><strong id="b8276163752217"><a name="b8276163752217"></a><a name="b8276163752217"></a>Return value</strong>: version number (long long)</p>
22</td>
23<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p18729174145115"><a name="p18729174145115"></a><a name="p18729174145115"></a>-</p>
24</td>
25</tr>
26<tr id="row2297124812500"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p117290419511"><a name="p117290419511"></a><a name="p117290419511"></a>const char *GetInferMode() const;</p>
27</td>
28<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p27294415118"><a name="p27294415118"></a><a name="p27294415118"></a><strong id="b1533152821817"><a name="b1533152821817"></a><a name="b1533152821817"></a>Function</strong>: Obtains the algorithm inference type.</p>
29<p id="p7729124165117"><a name="p7729124165117"></a><a name="p7729124165117"></a><strong id="b2038319406228"><a name="b2038319406228"></a><a name="b2038319406228"></a>Return value</strong>: <strong id="b0137831142112"><a name="b0137831142112"></a><a name="b0137831142112"></a>SYNC</strong> or <strong id="b4295192932114"><a name="b4295192932114"></a><a name="b4295192932114"></a>ASYNC</strong></p>
30</td>
31<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p107293425116"><a name="p107293425116"></a><a name="p107293425116"></a>-</p>
32</td>
33</tr>
34<tr id="row129814805012"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p4729749518"><a name="p4729749518"></a><a name="p4729749518"></a>int SyncProcess(IRequest *request, IResponse *&amp;response);</p>
35</td>
36<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p273084115114"><a name="p273084115114"></a><a name="p273084115114"></a><strong id="b16617151915342"><a name="b16617151915342"></a><a name="b16617151915342"></a>Function</strong>: Executes a synchronous algorithm.</p>
37<p id="p4730142514"><a name="p4730142514"></a><a name="p4730142514"></a><strong id="b102731816123611"><a name="b102731816123611"></a><a name="b102731816123611"></a>Return value</strong>: Returns <strong id="b132798168368"><a name="b132798168368"></a><a name="b132798168368"></a>0</strong> if the operation is successful; returns a non-zero value otherwise.</p>
38</td>
39<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p167306485114"><a name="p167306485114"></a><a name="p167306485114"></a><strong id="b1069405117544"><a name="b1069405117544"></a><a name="b1069405117544"></a>request</strong>: Passes the request content to the algorithm plug-in over the data channel between the engine server and the plug-in. This parameter must not be null.</p>
40<p id="p373014485110"><a name="p373014485110"></a><a name="p373014485110"></a><strong id="b14964162419400"><a name="b14964162419400"></a><a name="b14964162419400"></a>response</strong>: Receives the synchronous algorithm execution result returned by the algorithm plug-in over the data channel between the engine server and the plug-in. This parameter must not be null.</p>
41</td>
42</tr>
43<tr id="row16298748135017"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p187308420519"><a name="p187308420519"></a><a name="p187308420519"></a>int AsyncProcess(IRequest *request, IPluginAlgorithmCallback *callback);</p>
44</td>
45<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p17301414513"><a name="p17301414513"></a><a name="p17301414513"></a><strong id="b3141553184215"><a name="b3141553184215"></a><a name="b3141553184215"></a>Function</strong>: Executes an asynchronous algorithm.</p>
46<p id="p147307419512"><a name="p147307419512"></a><a name="p147307419512"></a><strong id="b687904545214"><a name="b687904545214"></a><a name="b687904545214"></a>Return value</strong>: Returns <strong id="b15879845115212"><a name="b15879845115212"></a><a name="b15879845115212"></a>0</strong> if the operation is successful; returns a non-zero value otherwise.</p>
47</td>
48<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p187303415118"><a name="p187303415118"></a><a name="p187303415118"></a><strong id="b121481271938"><a name="b121481271938"></a><a name="b121481271938"></a>request</strong>: Passes the request content to the algorithm plug-in over the data channel between the engine server and the plug-in. This parameter must not be null.</p>
49<p id="p273014415111"><a name="p273014415111"></a><a name="p273014415111"></a><strong id="b118911239511"><a name="b118911239511"></a><a name="b118911239511"></a>callback</strong>: Returns the asynchronous algorithm execution result to the engine server. This parameter must not be null.</p>
50</td>
51</tr>
52<tr id="row0298648135020"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p57316445115"><a name="p57316445115"></a><a name="p57316445115"></a>int Prepare(long long transactionId, const DataInfo &amp;inputInfo, DataInfo &amp;outputInfo);</p>
53</td>
54<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p17731343517"><a name="p17731343517"></a><a name="p17731343517"></a><strong id="b0828326172412"><a name="b0828326172412"></a><a name="b0828326172412"></a>Function</strong>: Loads an algorithm plug-in.</p>
55<p id="p873110465115"><a name="p873110465115"></a><a name="p873110465115"></a><strong id="b557063317174"><a name="b557063317174"></a><a name="b557063317174"></a>Return value</strong>: Returns <strong id="b1557416338177"><a name="b1557416338177"></a><a name="b1557416338177"></a>0</strong> if the operation is successful; returns a non-zero value otherwise.</p>
56</td>
57<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p17731114165112"><a name="p17731114165112"></a><a name="p17731114165112"></a><strong id="b7749839131710"><a name="b7749839131710"></a><a name="b7749839131710"></a>transactionId</strong>: Indicates the transaction ID, which is used to identify the client and session. This parameter must not be null.</p>
58<p id="p13731104205111"><a name="p13731104205111"></a><a name="p13731104205111"></a><strong id="b1432792318205"><a name="b1432792318205"></a><a name="b1432792318205"></a>inputInfo</strong>: Indicates input information specified for algorithm plug-in loading. This parameter can be null.</p>
59<p id="p117313420517"><a name="p117313420517"></a><a name="p117313420517"></a><strong id="b042175652110"><a name="b042175652110"></a><a name="b042175652110"></a>outputInfo</strong>: Indicates output information in the return result of algorithm plug-in loading. This parameter can be null.</p>
60</td>
61</tr>
62<tr id="row132988482502"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p137312415517"><a name="p137312415517"></a><a name="p137312415517"></a>int Release(bool isFullUnload, long long transactionId, const DataInfo &amp;inputInfo);</p>
63</td>
64<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p1473114420516"><a name="p1473114420516"></a><a name="p1473114420516"></a><strong id="b114914567339"><a name="b114914567339"></a><a name="b114914567339"></a>Function</strong>: Uninstalls an algorithm plug-in.</p>
65<p id="p973184165118"><a name="p973184165118"></a><a name="p973184165118"></a><strong id="b78344137343"><a name="b78344137343"></a><a name="b78344137343"></a>Return value</strong>: Returns <strong id="b1783421310349"><a name="b1783421310349"></a><a name="b1783421310349"></a>0</strong> if the operation is successful; returns a non-zero value otherwise.</p>
66</td>
67<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p7732546518"><a name="p7732546518"></a><a name="p7732546518"></a><strong id="b1874862293815"><a name="b1874862293815"></a><a name="b1874862293815"></a>isFullUnload</strong>: Indicates whether a plug-in is called by only one client. A plug-in can be uninstalled only when it is called by only one client. This parameter must not be null.</p>
68<p id="p1173213410515"><a name="p1173213410515"></a><a name="p1173213410515"></a><strong id="b11951635163814"><a name="b11951635163814"></a><a name="b11951635163814"></a>transactionId</strong>: Indicates the transaction ID, which is used to identify the client and session. This parameter must not be null.</p>
69<p id="p6732642517"><a name="p6732642517"></a><a name="p6732642517"></a><strong id="b330968114416"><a name="b330968114416"></a><a name="b330968114416"></a>inputInfo</strong>: Indicates input information specified for algorithm plug-in uninstallation. This parameter can be null.</p>
70</td>
71</tr>
72<tr id="row12991848165011"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p197328419511"><a name="p197328419511"></a><a name="p197328419511"></a>int SetOption(int optionType, const DataInfo &amp;inputInfo);</p>
73</td>
74<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p473213411517"><a name="p473213411517"></a><a name="p473213411517"></a><strong id="b11504650164417"><a name="b11504650164417"></a><a name="b11504650164417"></a>Function</strong>: Sets configuration items. You can use this API to pass algorithm's extended information to plug-ins.</p>
75<p id="p12732440511"><a name="p12732440511"></a><a name="p12732440511"></a><strong id="b13517165514413"><a name="b13517165514413"></a><a name="b13517165514413"></a>Return value</strong>: Returns <strong id="b1522125574410"><a name="b1522125574410"></a><a name="b1522125574410"></a>0</strong> if the operation is successful; returns a non-zero value otherwise.</p>
76</td>
77<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p117321446518"><a name="p117321446518"></a><a name="p117321446518"></a><strong id="b1085717564449"><a name="b1085717564449"></a><a name="b1085717564449"></a>optionType</strong>: Indicates the algorithm for obtaining the configuration item information. An algorithm plug-in can use this parameter as needed. This parameter must not be null.</p>
78<p id="p18732447514"><a name="p18732447514"></a><a name="p18732447514"></a><strong id="b1659115820440"><a name="b1659115820440"></a><a name="b1659115820440"></a>inputInfo</strong>: Indicates algorithm parameter information. An algorithm plug-in can use this parameter as needed. This parameter can be null.</p>
79</td>
80</tr>
81<tr id="row629954865010"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p4733947512"><a name="p4733947512"></a><a name="p4733947512"></a>int GetOption(int optionType, const DataInfo &amp;inputInfo, DataInfo &amp;outputInfo);</p>
82</td>
83<td class="cellrowborder" valign="top" width="29.34293429342934%" headers="mcps1.2.4.1.2 "><p id="p177331049517"><a name="p177331049517"></a><a name="p177331049517"></a><strong id="b17538727204613"><a name="b17538727204613"></a><a name="b17538727204613"></a>Function</strong>: Obtains configuration item information based on the specified <strong id="b0543527134610"><a name="b0543527134610"></a><a name="b0543527134610"></a>optionType</strong> and <strong id="b1854413275465"><a name="b1854413275465"></a><a name="b1854413275465"></a>inputInfo</strong>.</p>
84<p id="p19733114175119"><a name="p19733114175119"></a><a name="p19733114175119"></a><strong id="b347423014611"><a name="b347423014611"></a><a name="b347423014611"></a>Return value</strong>: Returns <strong id="b8479153044618"><a name="b8479153044618"></a><a name="b8479153044618"></a>0</strong> if the operation is successful; returns a non-zero value otherwise.</p>
85</td>
86<td class="cellrowborder" valign="top" width="37.32373237323732%" headers="mcps1.2.4.1.3 "><p id="p1273354145117"><a name="p1273354145117"></a><a name="p1273354145117"></a><strong id="b16246133304610"><a name="b16246133304610"></a><a name="b16246133304610"></a>optionType</strong>: Indicates the algorithm for obtaining the configuration item information. This parameter must not be null.</p>
87<p id="p773394115116"><a name="p773394115116"></a><a name="p773394115116"></a><strong id="b9497734104614"><a name="b9497734104614"></a><a name="b9497734104614"></a>inputInfo</strong>: Indicates input information specified for obtaining configuration item information of the algorithm. This parameter can be null.</p>
88<p id="p3733349519"><a name="p3733349519"></a><a name="p3733349519"></a><strong id="b1537435164617"><a name="b1537435164617"></a><a name="b1537435164617"></a>outputInfo</strong>: Indicates the configuration item information in the return result. This parameter can be null.</p>
89</td>
90</tr>
91</tbody>
92</table>
93
94Algorithm plug-in APIs including  **Prepare**,  **SyncProcess**,  **AsyncProcess**,  **Release**,  **SetOption**, and  **GetOption**  are in 1:1 mapping with the client APIs including  **AieClientPrepare**,  **AieClientSyncProcess**,  **AieClientAsyncProcess**,  **AieClientRelease**,  **AieClientSetOption**, and  **AieClientGetOption**. The  **GetInferMode**  API is used to return the algorithm execution type, which can be synchronous or asynchronous.
95
96[Table 2](#table461192635114)  describes the  **IPluginCallback**  APIs.
97
98**Table  2**  IPluginCallback APIs
99
100<a name="table461192635114"></a>
101<table><thead align="left"><tr id="row1061222605116"><th class="cellrowborder" valign="top" width="28.642864286428644%" id="mcps1.2.4.1.1"><p id="p12501314513"><a name="p12501314513"></a><a name="p12501314513"></a>API</p>
102</th>
103<th class="cellrowborder" valign="top" width="28.062806280628067%" id="mcps1.2.4.1.2"><p id="p9501131175119"><a name="p9501131175119"></a><a name="p9501131175119"></a>Description</p>
104</th>
105<th class="cellrowborder" valign="top" width="43.29432943294329%" id="mcps1.2.4.1.3"><p id="p0501431145119"><a name="p0501431145119"></a><a name="p0501431145119"></a>Parameters</p>
106</th>
107</tr>
108</thead>
109<tbody><tr id="row6612726205112"><td class="cellrowborder" valign="top" width="28.642864286428644%" headers="mcps1.2.4.1.1 "><p id="p85013185116"><a name="p85013185116"></a><a name="p85013185116"></a>void OnEvent(PluginEvent event, IResponse *response);</p>
110</td>
111<td class="cellrowborder" valign="top" width="28.062806280628067%" headers="mcps1.2.4.1.2 "><p id="p105053145110"><a name="p105053145110"></a><a name="p105053145110"></a><strong id="b2961171272212"><a name="b2961171272212"></a><a name="b2961171272212"></a>Function</strong>: Returns the asynchronous algorithm execution result.</p>
112</td>
113<td class="cellrowborder" valign="top" width="43.29432943294329%" headers="mcps1.2.4.1.3 "><p id="p650193115116"><a name="p650193115116"></a><a name="p650193115116"></a><strong id="b14537929102415"><a name="b14537929102415"></a><a name="b14537929102415"></a>event</strong>: Enumerates the algorithm execution result. The value can be <strong id="b55381140182615"><a name="b55381140182615"></a><a name="b55381140182615"></a>ON_PLUGIN_SUCCEED</strong> or <strong id="b13980433268"><a name="b13980433268"></a><a name="b13980433268"></a>ON_PLUGIN_FAIL</strong>.</p>
114<p id="p35053185113"><a name="p35053185113"></a><a name="p35053185113"></a><strong id="b1212654152616"><a name="b1212654152616"></a><a name="b1212654152616"></a>response</strong>: Encapsulates the algorithm execution result.</p>
115</td>
116</tr>
117</tbody>
118</table>
119
120The  **Request**  and  **Response**  classes define the requests and responses used for communication between the AI engine server and algorithm plug-ins. A request encapsulates the request content and input data of the caller. The plug-in returns the calculation result to the AI engine server through a response.
121
122[Table 3](#table16273647125120)  describes the attributes of the  **Request**  class.
123
124**Table  3**  Attributes of the Request class
125
126<a name="table16273647125120"></a>
127<table><thead align="left"><tr id="row1727454745110"><th class="cellrowborder" valign="top" width="23.17231723172317%" id="mcps1.2.4.1.1"><p id="p203081522515"><a name="p203081522515"></a><a name="p203081522515"></a>Name</p>
128</th>
129<th class="cellrowborder" valign="top" width="43.494349434943494%" id="mcps1.2.4.1.2"><p id="p1330917523513"><a name="p1330917523513"></a><a name="p1330917523513"></a>Description</p>
130</th>
131<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p153091152175116"><a name="p153091152175116"></a><a name="p153091152175116"></a>Default Value</p>
132</th>
133</tr>
134</thead>
135<tbody><tr id="row527454745113"><td class="cellrowborder" valign="top" width="23.17231723172317%" headers="mcps1.2.4.1.1 "><p id="p03095528514"><a name="p03095528514"></a><a name="p03095528514"></a>innerSequenceId_</p>
136</td>
137<td class="cellrowborder" valign="top" width="43.494349434943494%" headers="mcps1.2.4.1.2 "><p id="p730911521513"><a name="p730911521513"></a><a name="p730911521513"></a><strong id="b981061216467"><a name="b981061216467"></a><a name="b981061216467"></a>Type</strong>: long long</p>
138<p id="p12309105210517"><a name="p12309105210517"></a><a name="p12309105210517"></a><strong id="b1196921312469"><a name="b1196921312469"></a><a name="b1196921312469"></a>Function</strong>: reserved</p>
139</td>
140<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p930919521513"><a name="p930919521513"></a><a name="p930919521513"></a>0</p>
141</td>
142</tr>
143<tr id="row32741247175116"><td class="cellrowborder" valign="top" width="23.17231723172317%" headers="mcps1.2.4.1.1 "><p id="p3309175220514"><a name="p3309175220514"></a><a name="p3309175220514"></a>requestId_</p>
144</td>
145<td class="cellrowborder" valign="top" width="43.494349434943494%" headers="mcps1.2.4.1.2 "><p id="p1230915216512"><a name="p1230915216512"></a><a name="p1230915216512"></a><strong id="b138808447463"><a name="b138808447463"></a><a name="b138808447463"></a>Type</strong>: int</p>
146<p id="p11309195212517"><a name="p11309195212517"></a><a name="p11309195212517"></a><strong id="b8504120114718"><a name="b8504120114718"></a><a name="b8504120114718"></a>Function</strong>: Indicates the request sequence, which is used to bind the return result.</p>
147</td>
148<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1130965265119"><a name="p1130965265119"></a><a name="p1130965265119"></a>0</p>
149</td>
150</tr>
151<tr id="row112741847115118"><td class="cellrowborder" valign="top" width="23.17231723172317%" headers="mcps1.2.4.1.1 "><p id="p11309175275117"><a name="p11309175275117"></a><a name="p11309175275117"></a>operationId_</p>
152</td>
153<td class="cellrowborder" valign="top" width="43.494349434943494%" headers="mcps1.2.4.1.2 "><p id="p1530925235120"><a name="p1530925235120"></a><a name="p1530925235120"></a><strong id="b7143927134813"><a name="b7143927134813"></a><a name="b7143927134813"></a>Type</strong>: int</p>
154<p id="p5309165265113"><a name="p5309165265113"></a><a name="p5309165265113"></a><strong id="b142411438164814"><a name="b142411438164814"></a><a name="b142411438164814"></a>Function</strong>: reserved</p>
155</td>
156<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p030912527512"><a name="p030912527512"></a><a name="p030912527512"></a>0</p>
157</td>
158</tr>
159<tr id="row182749478511"><td class="cellrowborder" valign="top" width="23.17231723172317%" headers="mcps1.2.4.1.1 "><p id="p1931035225114"><a name="p1931035225114"></a><a name="p1931035225114"></a>transactionId_</p>
160</td>
161<td class="cellrowborder" valign="top" width="43.494349434943494%" headers="mcps1.2.4.1.2 "><p id="p13101152175113"><a name="p13101152175113"></a><a name="p13101152175113"></a><strong id="b1547420592496"><a name="b1547420592496"></a><a name="b1547420592496"></a>Type</strong>: long long</p>
162<p id="p12310125215120"><a name="p12310125215120"></a><a name="p12310125215120"></a><strong id="b12604311507"><a name="b12604311507"></a><a name="b12604311507"></a>Function</strong>: Indicates the transaction ID, which is the combination of <strong id="b2155123195211"><a name="b2155123195211"></a><a name="b2155123195211"></a>clientId</strong> and <strong id="b17763524185218"><a name="b17763524185218"></a><a name="b17763524185218"></a>sessionId</strong>.</p>
163</td>
164<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1831005265113"><a name="p1831005265113"></a><a name="p1831005265113"></a>0</p>
165</td>
166</tr>
167<tr id="row14274134755111"><td class="cellrowborder" valign="top" width="23.17231723172317%" headers="mcps1.2.4.1.1 "><p id="p1931045285110"><a name="p1931045285110"></a><a name="p1931045285110"></a>algoPluginType_</p>
168</td>
169<td class="cellrowborder" valign="top" width="43.494349434943494%" headers="mcps1.2.4.1.2 "><p id="p143101452165112"><a name="p143101452165112"></a><a name="p143101452165112"></a><strong id="b893851675519"><a name="b893851675519"></a><a name="b893851675519"></a>Type</strong>: int</p>
170<p id="p2310352145115"><a name="p2310352145115"></a><a name="p2310352145115"></a><strong id="b78543521559"><a name="b78543521559"></a><a name="b78543521559"></a>Function</strong>: Indicates the algorithm type ID allocated by the AI engine framework based on the plug-in loading sequence.</p>
171</td>
172<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p8310152115111"><a name="p8310152115111"></a><a name="p8310152115111"></a>0</p>
173</td>
174</tr>
175<tr id="row11275547135119"><td class="cellrowborder" valign="top" width="23.17231723172317%" headers="mcps1.2.4.1.1 "><p id="p1331035212512"><a name="p1331035212512"></a><a name="p1331035212512"></a>msg_</p>
176</td>
177<td class="cellrowborder" valign="top" width="43.494349434943494%" headers="mcps1.2.4.1.2 "><p id="p63104525518"><a name="p63104525518"></a><a name="p63104525518"></a><strong id="b1670914289565"><a name="b1670914289565"></a><a name="b1670914289565"></a>Type</strong>: DataInfo</p>
178<p id="p10310352125110"><a name="p10310352125110"></a><a name="p10310352125110"></a><strong id="b151491632185612"><a name="b151491632185612"></a><a name="b151491632185612"></a>Function</strong>: Stores the input parameters for calling the algorithm API.</p>
179</td>
180<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p7310125218519"><a name="p7310125218519"></a><a name="p7310125218519"></a>.data = nullptr</p>
181<p id="p0310185235113"><a name="p0310185235113"></a><a name="p0310185235113"></a>.length = 0</p>
182</td>
183</tr>
184</tbody>
185</table>
186
187[Table 4](#table1798597135212)  describes the attributes of the  **Response**  class.
188
189**Table  4**  Attributes of the Response class
190
191<a name="table1798597135212"></a>
192<table><thead align="left"><tr id="row209850785217"><th class="cellrowborder" valign="top" width="22.122212221222124%" id="mcps1.2.4.1.1"><p id="p6669101317529"><a name="p6669101317529"></a><a name="p6669101317529"></a>Name</p>
193</th>
194<th class="cellrowborder" valign="top" width="49.834983498349835%" id="mcps1.2.4.1.2"><p id="p1666931318527"><a name="p1666931318527"></a><a name="p1666931318527"></a>Description</p>
195</th>
196<th class="cellrowborder" valign="top" width="28.04280428042804%" id="mcps1.2.4.1.3"><p id="p1966901311520"><a name="p1966901311520"></a><a name="p1966901311520"></a>Default Value</p>
197</th>
198</tr>
199</thead>
200<tbody><tr id="row149854735212"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p166901314528"><a name="p166901314528"></a><a name="p166901314528"></a>innerSequenceId_</p>
201</td>
202<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p166691813145216"><a name="p166691813145216"></a><a name="p166691813145216"></a><strong id="b129294378214"><a name="b129294378214"></a><a name="b129294378214"></a>Type</strong>: long long</p>
203<p id="p17669151316526"><a name="p17669151316526"></a><a name="p17669151316526"></a><strong id="b14115237626"><a name="b14115237626"></a><a name="b14115237626"></a>Function</strong>: reserved</p>
204</td>
205<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p136691135528"><a name="p136691135528"></a><a name="p136691135528"></a>0</p>
206</td>
207</tr>
208<tr id="row199868705211"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p11669813145211"><a name="p11669813145211"></a><a name="p11669813145211"></a>requestId_</p>
209</td>
210<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p10669201316529"><a name="p10669201316529"></a><a name="p10669201316529"></a><strong id="b615115411522"><a name="b615115411522"></a><a name="b615115411522"></a>Type</strong>: int</p>
211<p id="p166693133522"><a name="p166693133522"></a><a name="p166693133522"></a><strong id="b184331942824"><a name="b184331942824"></a><a name="b184331942824"></a>Function</strong>: Indicates the request sequence, which is used to bind the return result.</p>
212</td>
213<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p266961385216"><a name="p266961385216"></a><a name="p266961385216"></a>0</p>
214</td>
215</tr>
216<tr id="row1898612735212"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p066951315526"><a name="p066951315526"></a><a name="p066951315526"></a>retCode__</p>
217</td>
218<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p166991310529"><a name="p166991310529"></a><a name="p166991310529"></a><strong id="b162021245723"><a name="b162021245723"></a><a name="b162021245723"></a>Type</strong>: int</p>
219<p id="p146692134527"><a name="p146692134527"></a><a name="p146692134527"></a><strong id="b291255018210"><a name="b291255018210"></a><a name="b291255018210"></a>Function</strong>: Indicates the inference result code of the asynchronous algorithm.</p>
220</td>
221<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p5669101395220"><a name="p5669101395220"></a><a name="p5669101395220"></a>0</p>
222</td>
223</tr>
224<tr id="row298617775218"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p1966921318528"><a name="p1966921318528"></a><a name="p1966921318528"></a>retDesc_</p>
225</td>
226<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p36691613155217"><a name="p36691613155217"></a><a name="p36691613155217"></a><strong id="b162461753448"><a name="b162461753448"></a><a name="b162461753448"></a>Type</strong>: string</p>
227<p id="p1067091319529"><a name="p1067091319529"></a><a name="p1067091319529"></a><strong id="b58297541946"><a name="b58297541946"></a><a name="b58297541946"></a>Function</strong>: reserved</p>
228</td>
229<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p15670191355218"><a name="p15670191355218"></a><a name="p15670191355218"></a>-</p>
230</td>
231</tr>
232<tr id="row798614711527"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p1467011314524"><a name="p1467011314524"></a><a name="p1467011314524"></a>transactionId_</p>
233</td>
234<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p1567010132524"><a name="p1567010132524"></a><a name="p1567010132524"></a><strong id="b621230052"><a name="b621230052"></a><a name="b621230052"></a>Type</strong>: long long</p>
235<p id="p0670161311522"><a name="p0670161311522"></a><a name="p0670161311522"></a><strong id="b182156282052"><a name="b182156282052"></a><a name="b182156282052"></a>Function</strong>: Indicates the transaction ID, which is the combination of <strong id="b122209281516"><a name="b122209281516"></a><a name="b122209281516"></a>clientId</strong> and <strong id="b1922032818514"><a name="b1922032818514"></a><a name="b1922032818514"></a>sessionId</strong>.</p>
236</td>
237<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p86701313135217"><a name="p86701313135217"></a><a name="p86701313135217"></a>0</p>
238</td>
239</tr>
240<tr id="row189861676522"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p567011138522"><a name="p567011138522"></a><a name="p567011138522"></a>algoPluginType_</p>
241</td>
242<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p17670121385214"><a name="p17670121385214"></a><a name="p17670121385214"></a><strong id="b169111225155"><a name="b169111225155"></a><a name="b169111225155"></a>Type</strong>: int</p>
243<p id="p1667010131526"><a name="p1667010131526"></a><a name="p1667010131526"></a><strong id="b14607332259"><a name="b14607332259"></a><a name="b14607332259"></a>Function</strong>: Indicates the algorithm type ID allocated by the AI engine framework based on the plug-in loading sequence.</p>
244</td>
245<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p1267015136527"><a name="p1267015136527"></a><a name="p1267015136527"></a>INVALID_ALGO_PLUGIN_TYPE(-1)</p>
246</td>
247</tr>
248<tr id="row199862715524"><td class="cellrowborder" valign="top" width="22.122212221222124%" headers="mcps1.2.4.1.1 "><p id="p1670913155216"><a name="p1670913155216"></a><a name="p1670913155216"></a>result_</p>
249</td>
250<td class="cellrowborder" valign="top" width="49.834983498349835%" headers="mcps1.2.4.1.2 "><p id="p1670191315529"><a name="p1670191315529"></a><a name="p1670191315529"></a><strong id="b163471135954"><a name="b163471135954"></a><a name="b163471135954"></a>Type</strong>: DataInfo</p>
251<p id="p4670313155214"><a name="p4670313155214"></a><a name="p4670313155214"></a><strong id="b498363911518"><a name="b498363911518"></a><a name="b498363911518"></a>Function</strong>: Stores the inference result of the asynchronous algorithm.</p>
252</td>
253<td class="cellrowborder" valign="top" width="28.04280428042804%" headers="mcps1.2.4.1.3 "><p id="p20670101375219"><a name="p20670101375219"></a><a name="p20670101375219"></a>.data = nullptr</p>
254<p id="p867010135520"><a name="p867010135520"></a><a name="p867010135520"></a>.length = 0</p>
255</td>
256</tr>
257</tbody>
258</table>
259
260For details about the development process, see the development example for the KWS plug-in.
261
262