hyperdock-langchain
Project description
Hyperdock for Langchain Community Tools
But seriously, what is a Hyperdock?
- Hyperdock is just a fancy name for a collection of tools. Which are, just python functions returning
str! - In this case, the collection will contain functions that invoke tools extending
BaseToolinterface of langchain.
How to use it?
- To use tools from
langchain-community, install langchain-community first.
$ pip install langchain-community # or maybe uv add langchain-community
- Some tool might require additional dependencies. For example, slack tools of langchain-community requires
slack-sdk. Check the requirements of the tool, and install them as well. - Make a dock with the tools you want to use. For example, let's say you want to use
DuckDuckGoSearchRuntool.
from hyperdock_langchain import dock as langchain_dock, LangchainToolRequest
from langchain_community.tools import DuckDuckGoSearchRun
# ...
dock = langchain_dock(
LangchainToolRequest(tool_type=DuckDuckGoSearchRun), # you should pass the tool type, not a tool instance.
# ...
)
- You might want to use hyperpocket's auth feature while using the langchain tools. In that case, you can define
authproperty for theLangchainToolRequest. - The auth property must be possible to serialized as
hyperpocket.tool.ToolAuth.
from hyperdock_langchain import dock as langchain_dock, LangchainToolRequest
from langchain_community.tools import SlackGetMessage
# ...
dock = langchain_dock(
LangchainToolRequest(tool_type=SlackGetMessage, auth={"auth_provider": "slack"}),
# ...
)
- If auth is provided, this dock recognize the credentials generated and set them as a proper environment variable.
- After you make your dock, call from_dock from your pocket instantiation. For example, Let's say you're using hyperpocket for langchain. You can do:
from hyperpocket.tool import from_dock
from hyperpocket_langchain import PocketLangchain
from hyperdock_langchain import dock as langchain_dock, LangchainToolRequest
dock = langchain_dock(
#...
)
# ...
def agent():
# ...
# initialize the pocket
pocket = PocketLangchain(
tools=[
*from_dock(dock),
]
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyperdock_langchain-0.5.7.tar.gz.
File metadata
- Download URL: hyperdock_langchain-0.5.7.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60e376d98791b6d86b20c8257851d1cc5a736386f1344a0b73fdc5f26c939d0c
|
|
| MD5 |
7a827f1f6f3154dfb2ff943e78f943c6
|
|
| BLAKE2b-256 |
84c180f369cf375ab4716be2421ad899efca77993ba53e577d6d84a94093c256
|
File details
Details for the file hyperdock_langchain-0.5.7-py3-none-any.whl.
File metadata
- Download URL: hyperdock_langchain-0.5.7-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7413ed4cd3328fd20069b9e2a5ab459dc10e51ce5b88d5f30875dbade8419c8f
|
|
| MD5 |
34446d1b4df73277e03285c18e58bdc0
|
|
| BLAKE2b-256 |
ead705e70c46c42887d1fac6f2d1a0e67b1b69de419b3af7a2cc1f325e013054
|