@@ -6,7 +6,46 @@ Gleap.setWSApiUrl("ws://0.0.0.0:9000");
66
77Gleap . initialize ( "ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV" ) ;
88
9+ const transactionTool = {
10+ // Name the tool. Only lowecase letters and - as well as _ are allowed.
11+ name : "send-money" ,
12+ // Describe the tool. This can also contain further instructions for the LLM.
13+ description : "Send money to a given contact." ,
14+ // Let the LLM know what the tool is doing. This will allow Kai to update the customer accordingly.
15+ response :
16+ "The transfer got initiated but not completed yet. The user must confirm the transfer in the banking app." ,
17+ // Set the execution type to auto or button.
18+ executionType : "auto" ,
19+ // Specify the parameters (it's also possible to pass an empty array)
20+ parameters : [
21+ {
22+ name : "amount" ,
23+ description :
24+ "The amount of money to send. Must be positive and provided by the user." ,
25+ type : "number" ,
26+ required : true ,
27+ } ,
28+ {
29+ name : "contact" ,
30+ description : "The contact to send money to." ,
31+ type : "string" ,
32+ enum : [ "Alice" , "Bob" ] , // Optional
33+ required : true ,
34+ } ,
35+ ] ,
36+ } ;
37+
38+ Gleap . on ( "tool-execution" , ( tool ) => {
39+ console . log ( tool ) ;
40+ } ) ;
41+
42+ // Add all available tools to the array.
43+ const tools = [ transactionTool ] ;
44+
45+ // Set the AI tools.
46+ Gleap . setAiTools ( tools ) ;
47+
948Gleap . on ( "outbound-sent" , ( data ) => {
10- const { outboundId, outbound, formData } = data ;
49+ const { outboundId, outbound, formData } = data ;
1150 console . log ( data ) ;
1251} ) ;
0 commit comments