Files
langchain/libs/cli/langchain_cli/integration_template/docs/toolkits.ipynb
T

4.9 KiB

Cell:
[Cell type raw - unsupported, skipped]

__ModuleName__Toolkit

  • TODO: Make sure API reference link is correct.

This will help you getting started with the ModuleName toolkit. For detailed documentation of all __ModuleName__Toolkit features and configurations head to the API reference.

Setup

  • TODO: Update with relevant info.

If you want to get automated tracing from runs of individual tools, you can also set your LangSmith API key by uncommenting below:

In [ ]:
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
# os.environ["LANGSMITH_TRACING"] = "true"

Installation

This toolkit lives in the __package_name__ package:

In [ ]:
%pip install -qU __package_name__

Instantiation

Now we can instantiate our toolkit:

  • TODO: Update model instantiation with relevant params.
In [ ]:
from __module_name__ import __ModuleName__Toolkit

toolkit = __ModuleName__Toolkit(
    # ...
)

Tools

View available tools:

In [ ]:
toolkit.get_tools()

TODO: list API reference pages for individual tools.

Use within an agent

In [ ]:
from langgraph.prebuilt import create_react_agent

agent_executor = create_react_agent(llm, tools)
In [ ]:
example_query = "..."

events = agent_executor.stream(
    {"messages": [("user", example_query)]},
    stream_mode="values",
)
for event in events:
    event["messages"][-1].pretty_print()

TODO: Any functionality or considerations specific to this toolkit

Fill in or delete if not relevant.

API reference

For detailed documentation of all __ModuleName__Toolkit features and configurations head to the API reference.