@@ -27,6 +27,12 @@ WebServerAI is an innovative project that integrates advanced tools such as CTE
2727 * [ How to enable the AI] ( #how-to-enable-the-ai )
2828 * [ Using the AI] ( #using-the-ai )
2929 * [ Previewing Content] ( #previewing-content )
30+ * [ Functions] ( #functions )
31+ * [ Loading] ( #loading )
32+ * [ Submitting Data] ( #submitting-data-required )
33+ * [ Adding Commands] ( #adding-commands-required )
34+ * [ Sending Data] ( #sending-data-required )
35+ * [ Getting Results] ( #getting-results )
3036 * [ Extensions] ( #extensions )
3137 * [ Creating the Extensions] ( #creating-an-extensions )
3238 * [ Components] ( #components )
@@ -257,6 +263,66 @@ You can use the `wsa-exclude` attribute on a element to ignore the element from
257263
258264***
259265
266+ ## Functions
267+ These are some functions that you can use for the AI
268+
269+ ### Loading
270+ Using this line of code will load the WebServerAI data
271+ ``` js
272+ {variableName}.load ()
273+ ```
274+
275+ ### Submitting Data (Required)
276+ To submit the users text use this function
277+ ``` js
278+ /*
279+ * Submits the users data
280+ * $input is users information
281+ */
282+ (... ).submit (($input )=> {
283+ if ($input){
284+ // Functions go here
285+ }
286+ })
287+ ```
288+
289+ ### Adding commands (Required)
290+ To add a command to the AI. ** This must be placed inside of the submit function!**
291+ ``` js
292+ (... ).submit (($input )=> {
293+ if ($input){
294+ (... ).addCmd ($input); // Add command here
295+ }
296+ });
297+ ```
298+
299+ ### Sending data (Required)
300+ To send the command to the AI use this command. ** This must be placed inside of the submit function!**
301+ ``` js
302+ ... submit (($input )=> {
303+ if ($input){
304+ (... )
305+ (... ).send ($input, true );
306+ }
307+ });
308+ ```
309+
310+ ### Getting results
311+ To get the results you this command. ** This must be placed inside of the submit function!**
312+ ``` js
313+ ... submit (($input )=> {
314+ if ($input){
315+ (... )
316+ (... ).results (($o )=> {
317+ // Returns an array
318+ console .log ($o);
319+ });
320+ }
321+ });
322+ ```
323+
324+ ***
325+
260326
261327![ Live Demo] ( https://github.com/XHiddenProjects/WebServerAI/blob/main/extras/LiveDemo.gif )
262328
0 commit comments