Skip to content

fix!: Improve PyPI package name. #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are still having issues, please be sure to include as much information as
- OS type and version:
- Python version: `python --version`
- pip version: `pip --version`
- `toolbox-langchain-sdk` version: `pip show toolbox-langchain-sdk`
- `toolbox-langchain` version: `pip show toolbox-langchain`

#### Steps to reproduce

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ jobs:
- name: Run type-check
env:
MYPYPATH: './src'
run: mypy --install-types --non-interactive --cache-dir=.mypy_cache/ -p toolbox_langchain_sdk
run: mypy --install-types --non-interactive --cache-dir=.mypy_cache/ -p toolbox_langchain
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ applications, enabling advanced orchestration and interaction with GenAI models.
Here's a minimal example to get you started:

```py
from toolbox_langchain_sdk import ToolboxClient
from toolbox_langchain import ToolboxClient
from langchain_google_vertexai import ChatVertexAI

toolbox = ToolboxClient("http://127.0.0.1:5000")
Expand All @@ -60,15 +60,15 @@ print(result)
You can install the Toolbox SDK for LangChain using `pip`.

```bash
pip install toolbox-langchain-sdk
pip install toolbox-langchain
```

## Usage

Import and initialize the toolbox client.

```py
from toolbox_langchain_sdk import ToolboxClient
from toolbox_langchain import ToolboxClient

# Replace with your Toolbox service's URL
toolbox = ToolboxClient("http://127.0.0.1:5000")
Expand Down Expand Up @@ -126,7 +126,7 @@ guide](https://langchain-ai.github.io/langgraph/) with minimal changes.
Represent each tool as a LangGraph node, encapsulating the tool's execution within the node's functionality:

```py
from toolbox_langchain_sdk import ToolboxClient
from toolbox_langchain import ToolboxClient
from langgraph.graph import StateGraph, MessagesState
from langgraph.prebuilt import ToolNode

Expand Down Expand Up @@ -245,7 +245,8 @@ auth_tools = toolbox.load_toolset(auth_tokens={"my_auth": get_auth_token})
### Complete Example

```py
from toolbox_langchain_sdk import ToolboxClient
import asyncio
from toolbox_langchain import ToolboxClient

async def get_auth_token():
# ... Logic to retrieve ID token (e.g., from local storage, OAuth flow)
Expand Down Expand Up @@ -324,7 +325,7 @@ use the asynchronous interfaces of the `ToolboxClient`.

```py
import asyncio
from toolbox_langchain_sdk import ToolboxClient
from toolbox_langchain import ToolboxClient

async def main():
toolbox = ToolboxClient("http://127.0.0.1:5000")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "toolbox-langchain-sdk"
name = "toolbox-langchain"
version="0.0.1"
description = "Python SDK for interacting with the Toolbox service with LangChain"
license = {file = "LICENSE"}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import pytest
from aiohttp import ClientSession

from toolbox_langchain_sdk.async_client import AsyncToolboxClient
from toolbox_langchain_sdk.async_tools import AsyncToolboxTool
from toolbox_langchain_sdk.utils import ManifestSchema
from toolbox_langchain.async_client import AsyncToolboxClient
from toolbox_langchain.async_tools import AsyncToolboxTool
from toolbox_langchain.utils import ManifestSchema

URL = "http://test_url"
MANIFEST_JSON = {
Expand Down Expand Up @@ -68,7 +68,7 @@ def mock_client(self, mock_session):
async def test_create_with_existing_session(self, mock_client, mock_session):
assert mock_client._AsyncToolboxClient__session == mock_session

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_tool(
self, mock_load_manifest, mock_client, mock_session, manifest_schema
):
Expand All @@ -83,7 +83,7 @@ async def test_aload_tool(
assert isinstance(tool, AsyncToolboxTool)
assert tool.name == tool_name

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_tool_auth_headers_deprecated(
self, mock_load_manifest, mock_client, manifest_schema
):
Expand All @@ -99,7 +99,7 @@ async def test_aload_tool_auth_headers_deprecated(
assert issubclass(w[-1].category, DeprecationWarning)
assert "auth_headers" in str(w[-1].message)

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_tool_auth_headers_and_tokens(
self, mock_load_manifest, mock_client, manifest_schema
):
Expand All @@ -117,7 +117,7 @@ async def test_aload_tool_auth_headers_and_tokens(
assert issubclass(w[-1].category, DeprecationWarning)
assert "auth_headers" in str(w[-1].message)

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_toolset(
self, mock_load_manifest, mock_client, mock_session, manifest_schema
):
Expand All @@ -131,7 +131,7 @@ async def test_aload_toolset(
assert isinstance(tool, AsyncToolboxTool)
assert tool.name in ["test_tool_1", "test_tool_2"]

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_toolset_with_toolset_name(
self, mock_load_manifest, mock_client, mock_session, manifest_schema
):
Expand All @@ -148,7 +148,7 @@ async def test_aload_toolset_with_toolset_name(
assert isinstance(tool, AsyncToolboxTool)
assert tool.name in ["test_tool_1", "test_tool_2"]

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_toolset_auth_headers_deprecated(
self, mock_load_manifest, mock_client, manifest_schema
):
Expand All @@ -163,7 +163,7 @@ async def test_aload_toolset_auth_headers_deprecated(
assert issubclass(w[-1].category, DeprecationWarning)
assert "auth_headers" in str(w[-1].message)

@patch("toolbox_langchain_sdk.async_client._load_manifest")
@patch("toolbox_langchain.async_client._load_manifest")
async def test_aload_toolset_auth_headers_and_tokens(
self, mock_load_manifest, mock_client, manifest_schema
):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_async_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import pytest_asyncio
from pydantic import ValidationError

from toolbox_langchain_sdk.async_tools import AsyncToolboxTool
from toolbox_langchain.async_tools import AsyncToolboxTool


@pytest.mark.asyncio
Expand Down
20 changes: 10 additions & 10 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import pytest
from pydantic import BaseModel

from toolbox_langchain_sdk.client import ToolboxClient
from toolbox_langchain_sdk.tools import ToolboxTool
from toolbox_langchain.client import ToolboxClient
from toolbox_langchain.tools import ToolboxTool

URL = "http://test_url"

Expand All @@ -36,7 +36,7 @@ def toolbox_client(self):

return client

@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_tool")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_tool")
def test_load_tool(self, mock_aload_tool, toolbox_client):
mock_tool = Mock(spec=ToolboxTool)
mock_tool.name = "mock-tool"
Expand All @@ -51,7 +51,7 @@ def test_load_tool(self, mock_aload_tool, toolbox_client):
assert tool.args_schema == mock_tool.args_schema
mock_aload_tool.assert_called_once_with("test_tool", {}, None, {}, True)

@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_toolset")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_toolset")
def test_load_toolset(self, mock_aload_toolset, toolbox_client):
mock_tools = [Mock(spec=ToolboxTool), Mock(spec=ToolboxTool)]
mock_tools[0].name = "mock-tool-0"
Expand All @@ -73,7 +73,7 @@ def test_load_toolset(self, mock_aload_toolset, toolbox_client):
mock_aload_toolset.assert_called_once_with(None, {}, None, {}, True)

@pytest.mark.asyncio
@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_tool")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_tool")
async def test_aload_tool(self, mock_aload_tool, toolbox_client):
mock_tool = Mock(spec=ToolboxTool)
mock_tool.name = "mock-tool"
Expand All @@ -88,7 +88,7 @@ async def test_aload_tool(self, mock_aload_tool, toolbox_client):
mock_aload_tool.assert_called_once_with("test_tool", {}, None, {}, True)

@pytest.mark.asyncio
@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_toolset")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_toolset")
async def test_aload_toolset(self, mock_aload_toolset, toolbox_client):
mock_tools = [Mock(spec=ToolboxTool), Mock(spec=ToolboxTool)]
mock_tools[0].name = "mock-tool-0"
Expand All @@ -109,7 +109,7 @@ async def test_aload_toolset(self, mock_aload_toolset, toolbox_client):
)
mock_aload_toolset.assert_called_once_with(None, {}, None, {}, True)

@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_tool")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_tool")
def test_load_tool_with_args(self, mock_aload_tool, toolbox_client):
mock_tool = Mock(spec=ToolboxTool)
mock_tool.name = "mock-tool"
Expand All @@ -135,7 +135,7 @@ def test_load_tool_with_args(self, mock_aload_tool, toolbox_client):
"test_tool_name", auth_tokens, auth_headers, bound_params, False
)

@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_toolset")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_toolset")
def test_load_toolset_with_args(self, mock_aload_toolset, toolbox_client):
mock_tools = [Mock(spec=ToolboxTool), Mock(spec=ToolboxTool)]
mock_tools[0].name = "mock-tool-0"
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_load_toolset_with_args(self, mock_aload_toolset, toolbox_client):
)

@pytest.mark.asyncio
@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_tool")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_tool")
async def test_aload_tool_with_args(self, mock_aload_tool, toolbox_client):
mock_tool = Mock(spec=ToolboxTool)
mock_tool.name = "mock-tool"
Expand All @@ -193,7 +193,7 @@ async def test_aload_tool_with_args(self, mock_aload_tool, toolbox_client):
)

@pytest.mark.asyncio
@patch("toolbox_langchain_sdk.client.AsyncToolboxClient.aload_toolset")
@patch("toolbox_langchain.client.AsyncToolboxClient.aload_toolset")
async def test_aload_toolset_with_args(self, mock_aload_toolset, toolbox_client):
mock_tools = [Mock(spec=ToolboxTool), Mock(spec=ToolboxTool)]
mock_tools[0].name = "mock-tool-0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from aiohttp import ClientResponseError
from pydantic import ValidationError

from toolbox_langchain_sdk.client import ToolboxClient
from toolbox_langchain.client import ToolboxClient


@pytest.mark.asyncio
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import pytest
from pydantic import BaseModel

from toolbox_langchain_sdk.async_tools import AsyncToolboxTool
from toolbox_langchain_sdk.tools import ToolboxTool
from toolbox_langchain.async_tools import AsyncToolboxTool
from toolbox_langchain.tools import ToolboxTool


class TestToolboxTool:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import pytest
from pydantic import BaseModel

from toolbox_langchain_sdk.utils import (
from toolbox_langchain.utils import (
ParameterSchema,
_convert_none_to_empty_string,
_get_auth_headers,
Expand Down