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 picking from schema modifiers
haxzie committed
May 13, 2025 at 14:29 UTC
604299420f1c5dd4875a2362d878d33c4044393d
2 files changed
+6
-9
packages/core/src/toolset/BaseToolset.ts
+4
-4
@@ -1,12 +1,12 @@
1
import type { Toolset } from '../types/toolset.types';
2
import type { Tool, ToolListParams } from '../types/tool.types';
3
import type { Composio } from '../composio';
4
-import { ModifiersParams } from '../types/modifiers.types';
4
+import { ModifiersParams, SchemaModifiersParams } from '../types/modifiers.types';
5
6
/**
7
* Base class for non-agentic toolsets that only support schema modifiers
8
* This is used for toolsets that don't need to handle tool execution modifiers
9
- * eg: OpenAI, Langchain, etc.
9
+ * eg: OpenAI, Anthropic, etc.
10
*/
11
export abstract class BaseNonAgenticToolset<TToolCollection, TTool>
12
implements Toolset<TTool, TToolCollection>
@@ -20,10 +20,10 @@ export abstract class BaseNonAgenticToolset<TToolCollection, TTool>
20
21
abstract getTools(
22
params?: ToolListParams,
23
- modifiers?: Pick<ModifiersParams, 'schema'>
23
+ modifiers?: SchemaModifiersParams
24
): Promise<TToolCollection>;
25
26
- abstract getToolBySlug(slug: string, modifiers?: Pick<ModifiersParams, 'schema'>): Promise<TTool>;
26
+ abstract getToolBySlug(slug: string, modifiers?: SchemaModifiersParams): Promise<TTool>;
27
28
abstract wrapTool(tool: Tool): TTool;
29
packages/core/src/toolset/ComposioToolset.ts
+2
-5
@@ -1,4 +1,4 @@
1
-import { ModifiersParams } from '../types/modifiers.types';
1
+import { ModifiersParams, SchemaModifiersParams } from '../types/modifiers.types';
2
import { Tool, ToolListParams } from '../types/tool.types';
3
import { BaseNonAgenticToolset } from './BaseToolset';
4
@@ -28,10 +28,7 @@ export class ComposioToolset extends BaseNonAgenticToolset<Array<CustomTool>, Cu
28
return tools?.map(tool => this.wrapTool(tool as Tool)) ?? [];
29
}
30
31
- async getToolBySlug(
32
- slug: string,
33
- modifiers?: Pick<ModifiersParams, 'schema'>
34
- ): Promise<CustomTool> {
31
+ async getToolBySlug(slug: string, modifiers?: SchemaModifiersParams): Promise<CustomTool> {
32
const tool = await this.getComposio().tools.getToolBySlug(slug, modifiers?.schema);
33
return this.wrapTool(tool as Tool);
34
}