Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Remove top level functions

haxziebb5ff3038b1c
diff --git a/packages/core/src/composio.ts b/packages/core/src/composio.ts
index f8ce44c99..4da91f715 100644
--- a/packages/core/src/composio.ts
+++ b/packages/core/src/composio.ts
@@ -57,10 +57,8 @@ export class Composio<TProvider extends BaseComposioProvider<unknown, unknown> =
provider: TProvider;
// auth configs
authConfigs: AuthConfigs;
- createAuthConfig: AuthConfigs['create'];
// connected accounts
connectedAccounts: ConnectedAccounts;
- initiateConnection: ConnectedAccounts['initiate'];
/**
* @param {Object} config Configuration for the Composio SDK.
@@ -104,15 +102,13 @@ export class Composio<TProvider extends BaseComposioProvider<unknown, unknown> =
*/
this.provider = (config.provider ?? new OpenAIProvider()) as TProvider;
this.tools = new Tools(this.client, this.provider);
- this.provider._setExecuteToolFn(this.tools.execute);
+
this.toolkits = new Toolkits(this.client);
this.triggers = new Triggers(this.client);
this.authConfigs = new AuthConfigs(this.client);
- this.createAuthConfig = this.authConfigs.create.bind(this.authConfigs);
// Initialize the connected accounts model.
this.connectedAccounts = new ConnectedAccounts(this.client);
- this.initiateConnection = this.connectedAccounts.initiate.bind(this.connectedAccounts);
/**
* Initialize the client telemetry.
diff --git a/packages/core/src/models/Tools.ts b/packages/core/src/models/Tools.ts
index 526ba1152..cc3d803bd 100644
--- a/packages/core/src/models/Tools.ts
+++ b/packages/core/src/models/Tools.ts
@@ -62,9 +62,12 @@ export class Tools<
this.client = client;
this.customTools = new CustomTools(client);
this.provider = provider;
+ // Bind the execute method to ensure correct 'this' context
+ this.execute = this.execute.bind(this);
+ // Set the execute method for the provider
+ this.provider._setExecuteToolFn(this.execute);
// Bind methods that use customTools to ensure correct 'this' context
- this.execute = this.execute.bind(this);
this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
this.getRawComposioTools = this.getRawComposioTools.bind(this);
}