@@ -19,10 +19,17 @@ import {
1919import { FunctionDefinitionFormat } from './types/functions' ;
2020
2121interface HandleFunctionCallParams {
22+ /** Name of the function to be called */
2223 functionName : string ;
24+ /** Dictionary containing all input arguments required to execute the specified function */
2325 functionArguments : Record < string , any > ;
26+ /** Specifies with credentials of which linked account the function should be executed */
2427 linkedAccountOwnerId ?: string ;
28+ /** @deprecated Use allowedOnly instead. If true, only returns enabled functions of apps that are allowed to be used by the agent/accessor */
2529 allowedAppsOnly ?: boolean ;
30+ /** If true, only returns enabled functions of apps that are allowed to be used by the agent/accessor. If false, returns all functions of all apps. */
31+ allowedOnly ?: boolean ;
32+ /** Format of the function definition to return */
2633 format ?: FunctionDefinitionFormat ;
2734}
2835
@@ -97,22 +104,18 @@ export class ACI {
97104 *
98105 * It supports handling built-in meta functions (ACI_SEARCH_FUNCTIONS, ACI_EXECUTE_FUNCTION) and also handling
99106 * executing third-party functions directly.
100- *
101- * @param functionName - Name of the function to be called
102- * @param functionArguments - Object containing the input arguments for the function
103- * @param linkedAccountOwnerId - Specifies the end-user (account owner) on behalf of whom to execute functions
104- * @param allowedAppsOnly - If true, only returns functions/apps that are allowed to be used by the agent/accessor
105- * @param format - Format of the function definition (for ACI_SEARCH_FUNCTIONS)
107+ *
108+ * @param {HandleFunctionCallParams } params
106109 * @returns The result of the function execution (varies based on the function)
107110 */
108111 public async handleFunctionCall ( params : HandleFunctionCallParams ) : Promise < any > {
109- const { functionName, functionArguments, linkedAccountOwnerId, allowedAppsOnly, format } =
112+ const { functionName, functionArguments, linkedAccountOwnerId, allowedOnly , allowedAppsOnly, format } =
110113 params ;
111114
112115 if ( functionName === ACI_SEARCH_FUNCTIONS ) {
113116 const functions = await this . functions . search ( {
114117 ...functionArguments ,
115- allowed_apps_only : allowedAppsOnly ,
118+ allowed_only : allowedOnly ?? allowedAppsOnly ,
116119 format : format ,
117120 } ) ;
118121
0 commit comments