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

SlackToolkit Problem - sample code does not work #28989

Closed
4 tasks done
ccurme opened this issue Jan 2, 2025 Discussed in #28566 · 0 comments · Fixed by #28990
Closed
4 tasks done

SlackToolkit Problem - sample code does not work #28989

ccurme opened this issue Jan 2, 2025 Discussed in #28566 · 0 comments · Fixed by #28990
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@ccurme
Copy link
Collaborator

ccurme commented Jan 2, 2025

Discussed in #28566

Originally posted by edwardgonen December 6, 2024

Checked other resources

  • I added a very descriptive title to this question.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

from langchain_community.agent_toolkits import SlackToolkit

toolkit = SlackToolkit()

Description

I have the
SLACK_USER_TOKEN= set correctly and installed all the needed packages including slack_sdk
But the SlackToolkin() gives exception:
Exception has occurred: PydanticUserError
SlackToolkit is not fully defined; you should define WebClient, then call SlackToolkit.model_rebuild().

For further information visit https://errors.pydantic.dev/2.10/u/class-not-fully-defined
File "/Users/user/Projects/slack/main.py", line 13, in
toolkit = SlackToolkit()
^^^^^^^^^^^^^^
pydantic.errors.PydanticUserError: SlackToolkit is not fully defined; you should define WebClient, then call SlackToolkit.model_rebuild().

For further information visit https://errors.pydantic.dev/2.10/u/class-not-fully-defined

I've tried to add WebClient but then fail on get_tools().

Can anyone help?

System Info

langchain==0.3.8
langchain-anthropic==0.3.0
langchain-community==0.3.8
langchain-core==0.3.21
langchain-experimental==0.3.3
langchain-openai==0.2.10
langchain-text-splitters==0.3.2

MAC

Python 3.12.3

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jan 2, 2025
@ccurme ccurme closed this as completed in efc687a Jan 2, 2025
pprados pushed a commit to pprados/langchain that referenced this issue Jan 3, 2025
Believe the current implementation raises PydanticUserError following
[this](https://github.com/pydantic/pydantic/releases/tag/v2.10.1)
Pydantic release.

Resolves langchain-ai#28989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant