Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(community): Add Slack Tool #7291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MadisonMajarais
Copy link

This PR adds a new Slack Tool that helps users to perform the following actions in Slack channels:

  • Get/Search messages
  • Get Channel Information
  • Post a new message
  • Schedule a new message

This PR helps to align LangChain.js with the Slack tool in LangChain (python).

Discussion # #7134

Example Usage:


let res = await agentExecutor.invoke({
  messages: [
    new HumanMessage("send a greeting message to the general channel"),
  ],
});

console.log(res.output);

res = await agentExecutor.invoke({
  messages: [
    new HumanMessage("Schedule a greeting message to the general channel at 11:15 am on December 12, 2024 in New York time."),
  ],
});

console.log(res.output);

res = await agentExecutor.invoke({
  messages: [
    new HumanMessage("When did I say 'hi' in the slack channels?"),
  ],
});

console.log(res.output);```

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 29, 2024
Copy link

vercel bot commented Nov 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Nov 29, 2024 11:00am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Nov 29, 2024 11:00am

@dosubot dosubot bot added the auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features label Nov 29, 2024
Copy link
Collaborator

@jacoblee93 jacoblee93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new SlackPostMessageTool(),
];

const agent = await createOpenAIToolsAgent({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the createReactAgent method from @langchain/langgraph

@jacoblee93 jacoblee93 added the close PRs that need one or two touch-ups to be ready label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features close PRs that need one or two touch-ups to be ready size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants