Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 9b71c72

Browse files
twishabansalkurtisvganubhav756
authored
fix!: rename package to 'toolbox_llamaindex' (#8)
* chore: chore: separate sdk from server repo * chore: fix package name * fix!: Improve PyPI package name. * improve package name * fix package name * lint * lint * change license year for header checker lint * reformat * Change mypy command * change back mypy command * chore: rename folder * lint * Create py.typed * random commit to get rid of conventional commits * revert random commit * chore: add missing trampolinerc * Revert "chore: add missing trampolinerc" (#14) --------- Co-authored-by: Kurtis Van Gent <[email protected]> Co-authored-by: Anubhav Dhawan <[email protected]>
1 parent 2eee1a4 commit 9b71c72

File tree

10 files changed

+33
-31
lines changed

10 files changed

+33
-31
lines changed

.github/workflows/lint.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ jobs:
5050
} catch (e) {
5151
console.log('Failed to remove label. Another job may have already removed it!');
5252
}
53+
5354
- name: Checkout code
5455
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
5556
with:
5657
ref: ${{ github.event.pull_request.head.sha }}
5758
repository: ${{ github.event.pull_request.head.repo.full_name }}
5859
token: ${{ secrets.GITHUB_TOKEN }}
60+
5961
- name: Setup Python
6062
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
6163
with:
@@ -71,7 +73,8 @@ jobs:
7173
run: |
7274
black --check .
7375
isort --check .
76+
7477
- name: Run type-check
7578
env:
7679
MYPYPATH: './src'
77-
run: mypy --install-types --non-interactive --cache-dir=.mypy_cache/ -p toolbox_llamaindex_sdk
80+
run: mypy --install-types --non-interactive --cache-dir=.mypy_cache/ -p toolbox_llamaindex

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ applications, enabling advanced orchestration and interaction with GenAI models.
3131
You can install the Toolbox SDK for LlamaIndex using `pip`.
3232

3333
```bash
34-
pip install toolbox-llamaindex-sdk
34+
pip install toolbox-llamaindex
3535
```
3636

3737
## Usage
3838

3939
Import and initialize the toolbox client.
4040

4141
```py
42-
from toolbox_llamaindex_sdk import ToolboxClient
42+
from toolbox_llamaindex import ToolboxClient
4343

4444
# Replace with your Toolbox service's URL
4545
toolbox = ToolboxClient("http://127.0.0.1:5000")
@@ -173,7 +173,7 @@ toolbox.add_auth_token("my_auth_service", get_auth_token)
173173

174174
```py
175175
import asyncio
176-
from toolbox_llamaindex_sdk import ToolboxClient
176+
from toolbox_llamaindex import ToolboxClient
177177

178178
async def get_auth_token():
179179
# Replace with your actual ID token retrieval logic.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "toolbox-llamaindex-sdk"
2+
name = "toolbox-llamaindex"
33
version="0.0.1"
44
description = "Python SDK for interacting with the Toolbox service with LlamaIndex"
55
license = {file = "LICENSE"}

src/toolbox_llamaindex/py.typed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

tests/test_client.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from llama_index.core.tools import FunctionTool
2222
from llama_index.core.tools.types import ToolMetadata, ToolOutput
2323

24-
from toolbox_llamaindex_sdk import ToolboxClient
25-
from toolbox_llamaindex_sdk.utils import ManifestSchema, ParameterSchema, ToolSchema
24+
from toolbox_llamaindex import ToolboxClient
25+
from toolbox_llamaindex.utils import ManifestSchema, ParameterSchema, ToolSchema
2626

2727
# Sample manifest data for testing
2828
manifest_data = {
@@ -86,7 +86,7 @@ async def test_close_not_closing_session():
8686

8787

8888
@pytest.mark.asyncio
89-
@patch("toolbox_llamaindex_sdk.client._load_manifest")
89+
@patch("toolbox_llamaindex.client._load_manifest")
9090
async def test_load_tool_manifest_success(mock_load_manifest):
9191
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
9292
mock_load_manifest.return_value = ManifestSchema(**manifest_data)
@@ -99,7 +99,7 @@ async def test_load_tool_manifest_success(mock_load_manifest):
9999

100100

101101
@pytest.mark.asyncio
102-
@patch("toolbox_llamaindex_sdk.client._load_manifest")
102+
@patch("toolbox_llamaindex.client._load_manifest")
103103
async def test_load_tool_manifest_failure(mock_load_manifest):
104104
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
105105
mock_load_manifest.side_effect = Exception("Failed to load manifest")
@@ -110,7 +110,7 @@ async def test_load_tool_manifest_failure(mock_load_manifest):
110110

111111

112112
@pytest.mark.asyncio
113-
@patch("toolbox_llamaindex_sdk.client._load_manifest")
113+
@patch("toolbox_llamaindex.client._load_manifest")
114114
async def test_load_toolset_manifest_success(mock_load_manifest):
115115
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
116116
mock_load_manifest.return_value = ManifestSchema(**manifest_data)
@@ -132,7 +132,7 @@ async def test_load_toolset_manifest_success(mock_load_manifest):
132132

133133

134134
@pytest.mark.asyncio
135-
@patch("toolbox_llamaindex_sdk.client._load_manifest")
135+
@patch("toolbox_llamaindex.client._load_manifest")
136136
async def test_load_toolset_manifest_failure(mock_load_manifest):
137137
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
138138
mock_load_manifest.side_effect = Exception("Failed to load manifest")
@@ -166,8 +166,8 @@ async def test_generate_tool_missing_tool():
166166

167167

168168
@pytest.mark.asyncio
169-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._load_tool_manifest")
170-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._generate_tool")
169+
@patch("toolbox_llamaindex.client.ToolboxClient._load_tool_manifest")
170+
@patch("toolbox_llamaindex.client.ToolboxClient._generate_tool")
171171
async def test_load_tool_success(mock_generate_tool, mock_load_manifest):
172172
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
173173
mock_load_manifest.return_value = ManifestSchema(**manifest_data)
@@ -191,7 +191,7 @@ async def test_load_tool_success(mock_generate_tool, mock_load_manifest):
191191

192192

193193
@pytest.mark.asyncio
194-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._load_tool_manifest")
194+
@patch("toolbox_llamaindex.client.ToolboxClient._load_tool_manifest")
195195
async def test_load_tool_failure(mock_load_manifest):
196196
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
197197
mock_load_manifest.side_effect = Exception("Failed to load manifest")
@@ -202,8 +202,8 @@ async def test_load_tool_failure(mock_load_manifest):
202202

203203

204204
@pytest.mark.asyncio
205-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._load_toolset_manifest")
206-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._generate_tool")
205+
@patch("toolbox_llamaindex.client.ToolboxClient._load_toolset_manifest")
206+
@patch("toolbox_llamaindex.client.ToolboxClient._generate_tool")
207207
async def test_load_toolset_success(mock_generate_tool, mock_load_manifest):
208208
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
209209
mock_load_manifest.return_value = ManifestSchema(**manifest_data)
@@ -260,7 +260,7 @@ async def test_load_toolset_success(mock_generate_tool, mock_load_manifest):
260260

261261

262262
@pytest.mark.asyncio
263-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._load_toolset_manifest")
263+
@patch("toolbox_llamaindex.client.ToolboxClient._load_toolset_manifest")
264264
async def test_load_toolset_failure(mock_load_manifest):
265265
"""Test handling of _load_toolset_manifest failure."""
266266
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
@@ -272,9 +272,7 @@ async def test_load_toolset_failure(mock_load_manifest):
272272

273273

274274
@pytest.mark.asyncio
275-
@patch(
276-
"toolbox_llamaindex_sdk.client._invoke_tool", return_value={"result": "test_result"}
277-
)
275+
@patch("toolbox_llamaindex.client._invoke_tool", return_value={"result": "test_result"})
278276
async def test_generate_tool_invoke(mock_invoke_tool):
279277
"""Test invoking the tool function generated by _generate_tool."""
280278
mock_session = Mock(spec=aiohttp.ClientSession)
@@ -572,7 +570,7 @@ async def test_process_auth_params(
572570

573571

574572
@pytest.mark.asyncio
575-
@patch("toolbox_llamaindex_sdk.client._load_manifest")
573+
@patch("toolbox_llamaindex.client._load_manifest")
576574
@pytest.mark.parametrize(
577575
"params, auth_tokens, expected_fn_schema_str, expected_tool_param_auth",
578576
[
@@ -631,8 +629,8 @@ async def test_load_tool(
631629

632630

633631
@pytest.mark.asyncio
634-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._load_tool_manifest")
635-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._generate_tool")
632+
@patch("toolbox_llamaindex.client.ToolboxClient._load_tool_manifest")
633+
@patch("toolbox_llamaindex.client.ToolboxClient._generate_tool")
636634
async def test_load_tool_deprecation_warning(mock_generate_tool, mock_load_manifest):
637635
"""Test load_tool with deprecated auth_headers argument."""
638636
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
@@ -668,7 +666,7 @@ async def test_load_tool_deprecation_warning(mock_generate_tool, mock_load_manif
668666

669667

670668
@pytest.mark.asyncio
671-
@patch("toolbox_llamaindex_sdk.client._load_manifest")
669+
@patch("toolbox_llamaindex.client._load_manifest")
672670
@pytest.mark.parametrize(
673671
"params, auth_tokens, expected_tool_param_auth, expected_num_tools",
674672
[
@@ -727,8 +725,8 @@ async def test_load_toolset(
727725

728726

729727
@pytest.mark.asyncio
730-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._load_toolset_manifest")
731-
@patch("toolbox_llamaindex_sdk.client.ToolboxClient._generate_tool")
728+
@patch("toolbox_llamaindex.client.ToolboxClient._load_toolset_manifest")
729+
@patch("toolbox_llamaindex.client.ToolboxClient._generate_tool")
732730
async def test_load_toolset_deprecation_warning(mock_generate_tool, mock_load_manifest):
733731
"""Test load_toolset with deprecated auth_headers argument."""
734732
client = ToolboxClient("https://my-toolbox.com", session=aiohttp.ClientSession())
@@ -765,7 +763,7 @@ async def test_load_toolset_deprecation_warning(mock_generate_tool, mock_load_ma
765763

766764

767765
@pytest.mark.asyncio
768-
@patch("toolbox_llamaindex_sdk.client._invoke_tool")
766+
@patch("toolbox_llamaindex.client._invoke_tool")
769767
@pytest.mark.parametrize(
770768
"manifest, tool_param_auth, id_token_getters, expected_invoke_tool_call",
771769
[
@@ -907,7 +905,7 @@ async def test_del_closes_session_not_running(mock_close):
907905

908906

909907
@pytest.mark.asyncio
910-
@patch("toolbox_llamaindex_sdk.client.asyncio.get_event_loop")
908+
@patch("toolbox_llamaindex.client.asyncio.get_event_loop")
911909
@patch("aiohttp.ClientSession.close")
912910
async def test_del_handles_exception(mock_close, mock_get_event_loop):
913911
"""Test that __del__ handles exceptions gracefully."""
@@ -923,7 +921,7 @@ async def test_del_handles_exception(mock_close, mock_get_event_loop):
923921

924922

925923
@pytest.mark.asyncio
926-
@patch("toolbox_llamaindex_sdk.client.asyncio.get_event_loop")
924+
@patch("toolbox_llamaindex.client.asyncio.get_event_loop")
927925
async def test_del_loop_not_running(mock_get_event_loop):
928926
"""Test that __del__ handles the case where the loop is not running."""
929927

tests/test_e2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import pytest_asyncio
3636
from aiohttp import ClientResponseError
3737

38-
from toolbox_llamaindex_sdk.client import ToolboxClient
38+
from toolbox_llamaindex.client import ToolboxClient
3939

4040

4141
@pytest.mark.asyncio

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import pytest
2424
from pydantic import BaseModel
2525

26-
from toolbox_llamaindex_sdk.utils import (
26+
from toolbox_llamaindex.utils import (
2727
ParameterSchema,
2828
_convert_none_to_empty_string,
2929
_get_auth_headers,

0 commit comments

Comments
 (0)