Skip to main content

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 BaseTool interface 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 DuckDuckGoSearchRun tool.
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 auth property for the LangchainToolRequest.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hyperdock_langchain-0.5.7.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyperdock_langchain-0.5.7-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for hyperdock_langchain-0.5.7.tar.gz
Algorithm Hash digest
SHA256 60e376d98791b6d86b20c8257851d1cc5a736386f1344a0b73fdc5f26c939d0c
MD5 7a827f1f6f3154dfb2ff943e78f943c6
BLAKE2b-256 84c180f369cf375ab4716be2421ad899efca77993ba53e577d6d84a94093c256

See more details on using hashes here.

File details

Details for the file hyperdock_langchain-0.5.7-py3-none-any.whl.

File metadata

File hashes

Hashes for hyperdock_langchain-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7413ed4cd3328fd20069b9e2a5ab459dc10e51ce5b88d5f30875dbade8419c8f
MD5 34446d1b4df73277e03285c18e58bdc0
BLAKE2b-256 ead705e70c46c42887d1fac6f2d1a0e67b1b69de419b3af7a2cc1f325e013054

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page