Skip to content

chore: Restore add_auth_token(s) as deprecated for backward compatibility #236

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 55 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
77bfdb2
fix(toolbox-langchain)!: Base toolbox-langchain over toolbox-core
anubhav756 May 8, 2025
53a673c
fix: add toolbox-core as package dependency
anubhav756 May 8, 2025
42f4d35
fix: Base sync client
anubhav756 May 8, 2025
2aeb718
fix: Fix running background asyncio in current loop issue
anubhav756 May 8, 2025
bbc4bba
fix: Base toolbox sync & async tools to toolbox core counterparts
anubhav756 May 8, 2025
56e14cd
fix: Fix getting pydantic model from ToolboxSyncTool
anubhav756 May 8, 2025
44fa98e
fix: Fix issue causing async core tools for creating sync tools
anubhav756 May 8, 2025
f44dc26
fix: Fix reading name from correct param
anubhav756 May 8, 2025
00a3666
fix: Fix issue of unknown parameter due to pydantic initialization
anubhav756 May 8, 2025
24d7a55
fix: Fix nit error + add comment
anubhav756 May 8, 2025
113a312
fix: Fix sync tool name assertion
anubhav756 May 8, 2025
3e09cf2
chore: Temporarily remove unittests
anubhav756 May 8, 2025
c92e5dd
chore: Remove unused strict flag + fix default values + fix docstring
anubhav756 May 8, 2025
d8fd735
fix: Update package to be from git repo
anubhav756 May 9, 2025
595eebe
fix: Fix toolbox-core package local path
anubhav756 May 9, 2025
5f587d4
fix: Fix local package path
anubhav756 May 9, 2025
6f14d52
fix: Update git path
anubhav756 May 9, 2025
9d1ae03
fix: Fix tests
anubhav756 May 9, 2025
dc3a4ff
fix: Fix using correct object for fetching loop
anubhav756 May 9, 2025
c8e6154
fix: Return invoke result
anubhav756 May 9, 2025
b058840
fix: Integration test errors
anubhav756 May 9, 2025
b83b8e3
chore: Delint
anubhav756 May 9, 2025
b771dc4
fix: Fix integration test
anubhav756 May 9, 2025
c2a4e64
fix: Fix integration tests
anubhav756 May 9, 2025
2d917a0
chore: Add unit tests previously deleted
anubhav756 May 9, 2025
395b2a1
chore: Delint
anubhav756 May 9, 2025
6cc15d2
fix: Fix using correct protected member variables
anubhav756 May 9, 2025
1625389
chore: Delint
anubhav756 May 9, 2025
6c224ac
chore: Fix types
anubhav756 May 9, 2025
f8cfe3a
fix: Ensure bg loop/thread not null
anubhav756 May 9, 2025
fb4d742
fix: Check bg loop/thread value
anubhav756 May 9, 2025
36d093b
fix: Revert warnings to prefer auth_tokens over auth_headers
anubhav756 May 9, 2025
248b1db
chore: Update unittests
anubhav756 May 9, 2025
8e2ed29
docs: Improve docstrings
anubhav756 May 10, 2025
3bccd7a
chore: Add TODO note
anubhav756 May 10, 2025
b169c45
chore: Improve TODO note
anubhav756 May 10, 2025
28c62ab
fix: Fix integration test
anubhav756 May 14, 2025
d5c57df
chore: Delint
anubhav756 May 14, 2025
ba29e2d
chore: Rename internal member variable names to be more concise
anubhav756 May 14, 2025
a0f3020
chore: Delint
anubhav756 May 14, 2025
abd6dd8
chore: Add toolbox actual package version in toml and local path in r…
anubhav756 May 15, 2025
f3817b3
fix: Fix editable toolbox-core package path in requirements.txt
anubhav756 May 15, 2025
3562bd7
fix: Fix lowest supported version until released
anubhav756 May 15, 2025
23618c4
fix: Fix issue causing relative path in requirements.txt to cause issues
anubhav756 May 15, 2025
ac535a3
docs: Fix issue README
anubhav756 May 15, 2025
9d3552f
fix: Use correct core client interfaces in langchain client
anubhav756 May 16, 2025
551b113
fix: Use correct core tool interfaces in langchain tool
anubhav756 May 16, 2025
6906393
fix: Use correct interface from core tool
anubhav756 May 16, 2025
f61e81e
fix: Use correct interfaces of toolbox-core
anubhav756 May 16, 2025
9bfb8d1
chore: Update async client unit tests
anubhav756 May 16, 2025
e6cfed2
chore: Fix client unit tests
anubhav756 May 16, 2025
3637bba
chore: Delint
anubhav756 May 16, 2025
9a34f6f
chore: Fix tools unit tests
anubhav756 May 16, 2025
faa9d68
chore: Restore add_auth_token(s) as deprecated for backward compatibi…
anubhav756 May 10, 2025
1de5a13
Merge branch 'main' into anubhav-deprecate-add-auth-token
anubhav756 May 16, 2025
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
13 changes: 13 additions & 0 deletions packages/toolbox-langchain/src/toolbox_langchain/async_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from typing import Any, Callable, Union

from deprecated import deprecated
from langchain_core.tools import BaseTool
from toolbox_core.tool import ToolboxTool as ToolboxCoreTool
from toolbox_core.utils import params_to_pydantic_model
Expand Down Expand Up @@ -108,6 +109,18 @@ def add_auth_token_getter(
"""
return self.add_auth_token_getters({auth_source: get_id_token})

@deprecated("Please use `add_auth_token_getters` instead.")
def add_auth_tokens(
self, auth_tokens: dict[str, Callable[[], str]], strict: bool = True
) -> "AsyncToolboxTool":
return self.add_auth_token_getters(auth_tokens)

@deprecated("Please use `add_auth_token_getter` instead.")
def add_auth_token(
self, auth_source: str, get_id_token: Callable[[], str], strict: bool = True
) -> "AsyncToolboxTool":
return self.add_auth_token_getter(auth_source, get_id_token)

def bind_params(
self,
bound_params: dict[str, Union[Any, Callable[[], Any]]],
Expand Down
13 changes: 13 additions & 0 deletions packages/toolbox-langchain/src/toolbox_langchain/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from asyncio import to_thread
from typing import Any, Callable, Union

from deprecated import deprecated
from langchain_core.tools import BaseTool
from toolbox_core.sync_tool import ToolboxSyncTool as ToolboxCoreSyncTool
from toolbox_core.utils import params_to_pydantic_model
Expand Down Expand Up @@ -94,6 +95,18 @@ def add_auth_token_getter(
"""
return self.add_auth_token_getters({auth_source: get_id_token})

@deprecated("Please use `add_auth_token_getters` instead.")
def add_auth_tokens(
self, auth_tokens: dict[str, Callable[[], str]], strict: bool = True
) -> "ToolboxTool":
return self.add_auth_token_getters(auth_tokens)

@deprecated("Please use `add_auth_token_getter` instead.")
def add_auth_token(
self, auth_source: str, get_id_token: Callable[[], str], strict: bool = True
) -> "ToolboxTool":
return self.add_auth_token_getter(auth_source, get_id_token)

def bind_params(
self,
bound_params: dict[str, Union[Any, Callable[[], Any]]],
Expand Down