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

having issues making my langchain tools that use argschema work #636

Open
turbopape opened this issue May 18, 2024 · 0 comments
Open

having issues making my langchain tools that use argschema work #636

turbopape opened this issue May 18, 2024 · 0 comments

Comments

@turbopape
Copy link

Hey,
first of all, thanks for this great lib. It actually opens new horizons in the way I write my stuff :)

I come from a setup relying quite heavily on many langchain tools.

I write those using annotations and using argschema with pydantic models to extract tools args like so:

from langchain.pydantic_v1 import BaseModel, Field
class SomeArgs(Basemodel):
some_field: some_type = Field(description="instructions..."

@tool(args_schema=SomeArgs)
def my_tool(some_field: some_type):
etc...

the problem is that if I don't force pydantic to be V1, these tools won't work on langchain, so I had to do so.
seems that crewAI is using pedantic V2, and this seems to be an issue:
when I add such tools to an Agent, I get the following error:
ImportError: cannot import name 'InstanceOf' from 'pydantic'
is there anymeans I can switch to pydantic 1 for crew ? otherwise I would have to rewrite many of my tools,
thanks :)

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

No branches or pull requests

1 participant