Skip to content

feat(integration): Adding langchain and crewai adapter for uAgents #679

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

abhifetch
Copy link
Collaborator

Proposed Changes

Addititon of langchain uagents adapter in experiment

Linked Issues

[if applicable, add links to issues resolved by this PR]

Types of changes

What type of change does this pull request make (put an x in the boxes that apply)?

  • Bug fix (non-breaking change that fixes an issue).
  • New feature added (non-breaking change that adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to stop working as expected).
  • Documentation update.
  • Something else (e.g., tests, scripts, example, deployment, infrastructure).

Checklist

Put an x in the boxes that apply:

  • I have read the CONTRIBUTING guide
  • Checks and tests pass locally

If applicable

  • I have added tests that prove my fix is effective or that my feature works
  • I have added/updated the documentation (executed the script in python/scripts/generate_api_docs.py)

Further comments

[if this is a relatively large or complex change, kick off a discussion by explaining why you chose the solution you did, what alternatives you considered, etc...]

@abhifetch
Copy link
Collaborator Author

abhifetch commented Apr 7, 2025

can find example and readme for how to use it here : https://github.com/abhifetch/uAgents-Adapter

@abhifetch abhifetch changed the title Adding langchain adapter for uAgents feat(integration): Adding langchain adapter for uAgents Apr 7, 2025
Copy link

github-actions bot commented Apr 7, 2025

Coverage report

This PR does not seem to contain any modification to coverable code.

@abhifetch abhifetch changed the title feat(integration): Adding langchain adapter for uAgents feat(integration): Adding langchain and crewai adapter for uAgents Apr 9, 2025
Copy link
Member

@Archento Archento left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution.

I strongly believe that this belongs in the 3-applications folder of the official uAgents examples repo as it introduces dependencies into the core framework and is more of an integration than a core functionality of uagents.
Also, the target folder here would be /contrib rather than /experimental

@abhifetch abhifetch requested a review from Archento April 9, 2025 11:27
@abhifetch
Copy link
Collaborator Author

@Archento Thanks for the suggestion, I have discussed this with @ejfitzgerald and got this into the experimental folder. I know this is integration, we want developers to use these integrations and directly get their agent on agentverse with chat protocol enabled.

@ejfitzgerald can you please comment on what should be preferred here.

@jrriehl
Copy link
Contributor

jrriehl commented Apr 16, 2025

These look really cool, but as others have already pointed out, openai and langchain_core are not dependencies of uagents, so these will fail without an extra installation step. I feel like these could go directly in https://github.com/fetchai/uAgent-Examples and would be a perfect fit there as integrations.

abhifetch added a commit that referenced this pull request Apr 17, 2025
Changes made as per suggestions by @qati #679 (comment)
@abhifetch abhifetch force-pushed the uAgentsLangchainAdapter branch from 49c28ab to ffeaf80 Compare April 17, 2025 07:46
@abhifetch abhifetch requested a review from qati April 17, 2025 07:56
Copy link
Member

@Archento Archento left a comment

Choose a reason for hiding this comment

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

A couple of things here:

  • why is the register tool not a separate class that both derivates can use
  • why do you use threading when most of the current architecture can make better use of multiprocessing or even simply asyncio tasks in a single thread
  • adding to the above: hardcoded time.sleep should generally be avoided and instead sequential event based approaches used
  • the chat handlers have overly complex case logic which is prone to errors and could potentially be simplified
  • the pyproject file could be updated to adhere to the current python standard which is tool agnostic (avoid, if possible, that Poetry needs to be used)
  • pytest is imported but there are no tests
  • since >=python3.10 is defined, please also adhere to the new typing requirements

All of these should eventually be tackled but I assume this can happen down the line / as a patch afterwards.

Otherwise looks good to me 👍🏻

@abhifetch
Copy link
Collaborator Author

Thankyou @Archento , I will address all of these in the coming release.

@jrriehl jrriehl merged commit b12b6c5 into main Apr 17, 2025
10 checks passed
@jrriehl jrriehl deleted the uAgentsLangchainAdapter branch April 17, 2025 13:53
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.

5 participants