Add LangChain integration for Hermes Function Calling #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
LangChain Integration for Hermes Function Calling
This pull request adds full LangChain integration to the Hermes Function Calling framework. The integration allows Hermes tools to be used within LangChain agents and vice versa, expanding the capabilities of both frameworks.
Changes Made
langchainandlangchain-coretorequirements.txtget_langchain_tools()function tofunctions.pyto expose Hermes tools as LangChain toolslangchain_integration.pywith utilities for integrating Hermes tools with LangChain agents:HermesToolAdapter: Adapter to convert Hermes tools to LangChain toolscreate_hermes_agent: Function to create a LangChain agent that can use Hermes toolsexecute_tool_call: Function to execute a Hermes tool callconvert_hermes_result_to_langchain: Function to convert Hermes tool results to LangChain ToolMessagesrun_hermes_with_langchain: Example function showing how to run a query using Hermes tools through LangChaintest_langchain_integration.pyto demonstrate the integrationBenefits
This integration provides several benefits:
Usage
After installing the required dependencies, you can use the integration as follows:
Fixes #23