@devries-cameron20 / composio-1 / commits / bb5ff3038
Fork 0

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

haxzie committed May 20, 2025 at 12:18 UTC bb5ff3038b1c18213c097c76bf7be7d560776b52
2 files changed +5 -6
packages/core/src/composio.ts
+1 -5
@@ -57,10 +57,8 @@ export class Composio<TProvider extends BaseComposioProvider<unknown, unknown> =
57 provider: TProvider;
58 // auth configs
59 authConfigs: AuthConfigs;
60 - createAuthConfig: AuthConfigs['create'];
60 // connected accounts
61 connectedAccounts: ConnectedAccounts;
63 - initiateConnection: ConnectedAccounts['initiate'];
62
63 /**
64 * @param {Object} config Configuration for the Composio SDK.
@@ -104,15 +102,13 @@ export class Composio<TProvider extends BaseComposioProvider<unknown, unknown> =
102 */
103 this.provider = (config.provider ?? new OpenAIProvider()) as TProvider;
104 this.tools = new Tools(this.client, this.provider);
107 - this.provider._setExecuteToolFn(this.tools.execute);
105 +
106 this.toolkits = new Toolkits(this.client);
107 this.triggers = new Triggers(this.client);
108 this.authConfigs = new AuthConfigs(this.client);
111 - this.createAuthConfig = this.authConfigs.create.bind(this.authConfigs);
109
110 // Initialize the connected accounts model.
111 this.connectedAccounts = new ConnectedAccounts(this.client);
115 - this.initiateConnection = this.connectedAccounts.initiate.bind(this.connectedAccounts);
112
113 /**
114 * Initialize the client telemetry.
packages/core/src/models/Tools.ts
+4 -1
@@ -62,9 +62,12 @@ export class Tools<
62 this.client = client;
63 this.customTools = new CustomTools(client);
64 this.provider = provider;
65 + // Bind the execute method to ensure correct 'this' context
66 + this.execute = this.execute.bind(this);
67 + // Set the execute method for the provider
68 + this.provider._setExecuteToolFn(this.execute);
69
70 // Bind methods that use customTools to ensure correct 'this' context
67 - this.execute = this.execute.bind(this);
71 this.getRawComposioToolBySlug = this.getRawComposioToolBySlug.bind(this);
72 this.getRawComposioTools = this.getRawComposioTools.bind(this);
73 }