Reverts ArcadeAI/arcade-mcp#759 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a new LangChain/LangGraph integration layer that wraps and executes Arcade tools, including authorization and error/interrupt handling; bugs here could impact tool execution semantics for adopters. Changes are mostly additive and scoped to `contrib/langchain`. > > **Overview** > Re-introduces a standalone `contrib/langchain` Python package (`langchain-arcade`) to expose Arcade tools as LangChain `StructuredTool`s. > > Adds sync/async `ToolManager` implementations plus utilities to generate Pydantic arg schemas from `ToolDefinition`, optionally rewrite tool names (underscores vs dots), and handle authorization via LangGraph `NodeInterrupt` or structured error responses. > > Includes packaging/dev scaffolding (`pyproject.toml`, `tox.ini`, `Makefile`, `.gitignore`, `LICENSE`, `README`) and a comprehensive test suite covering manager behaviors and auth flows. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit abd23b6d954470cb1e7376158468c0e59cdc7d7a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
33 lines
897 B
Python
33 lines
897 B
Python
import os
|
|
|
|
import pytest
|
|
from arcadepy import Arcade
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def arcade_base_url():
|
|
"""
|
|
Retrieve the ARCADE_BASE_URL from the environment, falling back to a default
|
|
if not found.
|
|
"""
|
|
return os.getenv("ARCADE_BASE_URL", "http://localhost:9099")
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def arcade_api_key():
|
|
"""
|
|
Retrieve the ARCADE_API_KEY from the environment, falling back to a default
|
|
if not found.
|
|
"""
|
|
return os.getenv("ARCADE_API_KEY", "test_api_key")
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def arcade_client(arcade_base_url, arcade_api_key):
|
|
"""
|
|
Creates a single Arcade client instance for use in all tests.
|
|
Any method calls on this client can be patched/mocked within the tests.
|
|
"""
|
|
client = Arcade(api_key=arcade_api_key, base_url=arcade_base_url)
|
|
yield client
|
|
# Teardown logic would go here if necessary
|