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

fix: use fusejs to filter search results for slack channels and users #418

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

njhale
Copy link
Member

@njhale njhale commented Feb 6, 2025

Update the Search Channels and Search Users tools to use Fuse.js to filter slack channel names and user names by similarity to the query string.

Note: This may not return exact matches, but will allow LLMs to filter the channels and users down to results with similar names.

Addresses obot-platform/obot#1660

const publicChannels = publicResult.channels.filter(channel => channel.name.includes(query))
const privateChannels = privateResult.channels.filter(channel => channel.name.includes(query))
const result = await webClient.conversations.list({limit: 100, types: 'public_channel,private_channel'})
const channels = (new Fuse(
Copy link
Member Author

Choose a reason for hiding this comment

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

we can improve the results for searchUsers as with this as well. maybe its worth doing it in this PR as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure I think that makes sense to do here

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Update the `Search Channels` tool to use Fuse.js to filter slack channel
names by similarity to the query string.

Note: This may not return exact matches, but will allow LLMs to filter
the channels down to results with similar names.

Addresses obot-platform/obot#1660

Signed-off-by: Nick Hale <[email protected]>
@njhale njhale force-pushed the fix/slack-search-channels branch from 2a16d77 to 76dd764 Compare February 6, 2025 21:05
@njhale njhale force-pushed the fix/slack-search-channels branch from 76dd764 to e562f73 Compare February 6, 2025 21:34
@njhale njhale requested a review from g-linville February 6, 2025 21:35
@njhale njhale changed the title fix: use fusejs to filter search results for slack channels fix: use fusejs to filter search results for slack channels and users Feb 6, 2025
@njhale njhale merged commit 5d0385b into obot-platform:main Feb 7, 2025
1 check passed
@njhale njhale deleted the fix/slack-search-channels branch February 7, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants