Skip to content

Commit

Permalink
Merge branch 'master' into fix-constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar-composio authored Jan 3, 2025
2 parents 4cc8629 + 4012478 commit c9813ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion js/src/frameworks/langchain.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ describe("Apps class tests", () => {
},
});

langchainToolSet.getTools({
const tools = await langchainToolSet.getTools({
actions: ["starRepositoryCustomAction"],
});

await expect(tools.length).toBe(1);
const actionOuput = await langchainToolSet.executeAction({
action: "starRepositoryCustomAction",
params: {
Expand Down
11 changes: 3 additions & 8 deletions js/src/sdk/base.toolset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,14 @@ export class ComposioToolSet {
filterByAvailableApps: parsedFilters.filterByAvailableApps,
});

const toolsWithCustomActions = (
await this.userActionRegistry.getAllActions()
).filter((action) => {
const { name: actionName, toolName } = action.metadata || {};
const customActions = await this.userActionRegistry.getAllActions();
const toolsWithCustomActions = customActions.filter((action) => {
const { name: actionName } = action || {};
return (
(!filters.actions ||
filters.actions.some(
(name) => name.toLowerCase() === actionName?.toLowerCase()
)) &&
(!filters.apps ||
filters.apps.some(
(name) => name.toLowerCase() === toolName?.toLowerCase()
)) &&
(!filters.tags ||
filters.tags.some((tag) => tag.toLowerCase() === "custom"))
);
Expand Down

0 comments on commit c9813ef

Please sign in to comment.