Using AI Elements in Pages
Using in pages
AI Assistant provide a run function that can be called directly in pages. There are two ways to call it: visual calling and full code calling.
Visual calling
In statements, select AI Assistant → the assistant you want to call → Run, and pass in the assistant's input args.
Full code calling
You can also call it through full code. The calling syntax in pages is as follows:
// this.app.{AI Assistant Element ID}.run(param1, param2)
this.app.AIDemo.aiassistants.ClientManagementAssistant.run("Add on custmer", {"paramA": "Tony"});
Using AI agent in pages
AI Agent provide a run function that can be called directly in pages. There are two ways to call it: visual calling and full code calling.
Visual calling
In statements, select Agent → the Agent you want to call → Run, and pass in the AI Agent's input args.
Full code calling
You can also call it through full code. The calling syntax in pages is as follows:
// this.app.{AI Agent Element ID}.run(param1, param2)
this.app.AIDemo.aiagents.ClientManagementagent.run("Add one customer", "Tony");
Using large language models in pages
Large Language Model provide a run function that can be called directly in pages. There are two ways to call it: visual calling and full code calling.
Visual calling
In statements, select Large Language Model → the large language model you want to call → Run.
Then set the input args: the model to call, prompt, and output format.
Full code calling
You can also call it through full code. The calling syntax in pages is as follows:
// this.app.{Large Language Model Element ID}.runLlm(param)
this.app.AIDemo.llms.alibur.runLlm({
"dataType": "Ltext",
"promptList": [{ // Prompt
"role": "system",
"prompt": `Query detailed information for ${this.Table1.activeRow.custName.value}`,
"id": "config-9o9ztc2"
}],
"llmConfig": { // Large Language Model Configuration
"model": "qwen-max-latest"
},
"outputArgs": [{
"title": "Customer Details",
"name": "customerDetails",
"dataType": "RowData",
"generic": "AIDemo.models.CustomerModel"
}]
});