arcade-mcp/contrib/langchain
Eric Gustin 936319ccba
Fix langchain-arcade SyncOffsetPage iteration (#262)
## PR Description
The `ArcadeToolManager` was retrieving tools from the Arcade client
incorrectly as it was only returning the first page of results.

This PR removes the use of `SyncOffsetPage`'s `.items` attribute since
`.items` only contains the tools in the **current page**. Since
`SyncOffsetPage` implements an `__iter__` that iterates over all pages,
we can simply drop the `.items`.

## Try it for yourself
Run the following code without the changes in this PR and notice that
only 25 tools are in the internal tool list, which also happens to be
the size of a page. Now run again, but with the changes in this PR and
notice that all tools hosted by Arcade are in the internal tool list.
```python
import os

from langchain_arcade import ArcadeToolManager

arcade_api_key = os.environ.get("ARCADE_API_KEY")
manager = ArcadeToolManager(api_key=arcade_api_key)

tools = manager.init_tools()
print(len(manager.tools))
```
2025-02-20 13:24:03 -08:00
..
langchain_arcade Fix langchain-arcade SyncOffsetPage iteration (#262) 2025-02-20 13:24:03 -08:00
tests Use AuthorizationResponse and ToolDefinition (#221) 2025-01-23 18:32:00 -08:00
.gitignore Remove toml (#210) 2025-01-17 09:56:43 -08:00
LICENSE Update README and LICENSE (#220) 2025-01-23 19:43:48 -08:00
Makefile Update Examples & Various Renames (#233) 2025-01-28 17:17:29 -08:00
pyproject.toml Fix langchain-arcade SyncOffsetPage iteration (#262) 2025-02-20 13:24:03 -08:00
README.md Fix langchain-arcade SyncOffsetPage iteration (#262) 2025-02-20 13:24:03 -08:00
tox.ini Update langchain integration to 0.2.0 (#213) 2025-01-22 13:01:15 -08:00

LangChain Integration

License Downloads

DocsIntegrationsPython ClientJavaScript Client

Overview

langchain-arcade allows you to use Arcade tools in your LangChain and LangGraph applications.

Installation

pip install langchain-arcade

Usage

See the examples for usage examples