Skip to content

feat(toolbox-langchain)!: Base toolbox-langchain over toolbox-core #229

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 53 commits into from
May 16, 2025

Conversation

anubhav756
Copy link
Contributor

@anubhav756 anubhav756 commented May 8, 2025

This PR introduces a new dependency on the foundational library toolbox-core.

Breaking Changes

This PR introduces changes to how "strictness" is handled across several toolbox functions. The strict flag has been removed from load_tool, aload_tool, add_auth_token_getter(s), and bind_param(s). Additionally, the default behavior of load_toolset for strict=False has changed.

Why?

Enforces more explicit error handling and reduce ambiguity, particularly in scenarios where unused configurations might otherwise be silently ignored.

* (a)load_tool do not support strict flag now:

Before

tool = await client.aload_tool("my-tool", strict=True)

After

tool = await client.aload_tool("my-tool")
tool = await client.aload_tool("my-tool", strict=True) # <-- Error

* (a)load_toolset functionality changes for strict=False

  • Before

tools = toolbox.load_toolset(
    auth_token_getters={...},
    bound_params={...},
    strict=False,
)

Does not throw error if none of the loaded tools use a given auth token getter or bound param. Only throws a warning.

After

tools = toolbox.load_toolset(
    auth_token_getters={...},
    bound_params={...},
    # strict=False, <-- default
)

Throws error if none of the loaded tools use a given auth token getter or bound param.

* add_auth_token_getter(s) do not support strict flag

Before

# Warning
auth_tool = tool.add_auth_token_getters(
    {"unused_auth": ...},
    strict=False,
)

# Error
auth_tool = tool.add_auth_token_getters(
    {"unused_auth": ...},
    # strict=True, <-- default
)

After

# Error
auth_tool = tool.add_auth_token_getters(
    {"unused_auth": ...},
)

* bind_param(s) do not support strict flag

Before

# Warning
bound_tool = tool.bind_params(
    {"unused_param": ...},
    strict=False,
)

# Error
bound_tool = tool.bind_params(
    {"unused_param": ...},
    # strict=True, <-- default
)

After

# Error
bound_tool = tool.bind_params(
    {"unused_param": ...},
)

@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch 2 times, most recently from d6753ea to 7e299e3 Compare May 8, 2025 10:56
@anubhav756 anubhav756 changed the base branch from anubhav-sync-client-test to anubhav-sync-add-header May 8, 2025 11:04
@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch 2 times, most recently from 8b8c8ea to 10dfe8c Compare May 8, 2025 15:11
@anubhav756 anubhav756 changed the base branch from anubhav-sync-add-header to anubhav-perm-error May 9, 2025 18:52
@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch 2 times, most recently from e5d1d94 to 854c9df Compare May 9, 2025 19:19
@anubhav756 anubhav756 changed the base branch from anubhav-perm-error to anubhav-protected May 9, 2025 19:20
@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch 6 times, most recently from c294769 to 56c7c2d Compare May 9, 2025 20:14
@anubhav756 anubhav756 changed the base branch from anubhav-protected to anubhav-default-toolset May 9, 2025 20:15
@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch from b229394 to 6ef6e62 Compare May 10, 2025 05:25
@anubhav756 anubhav756 changed the base branch from anubhav-default-toolset to anubhav-reverse-deprecation May 10, 2025 05:35
@anubhav756 anubhav756 marked this pull request as ready for review May 10, 2025 05:57
@anubhav756 anubhav756 requested a review from a team as a code owner May 10, 2025 05:57
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch from 204a6f5 to 64f214c Compare May 12, 2025 14:14
@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch from 6ef6e62 to ffdedf9 Compare May 12, 2025 14:14
Copy link
Contributor

@kurtisvg kurtisvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For breaking changes, let's make sure we call out what steps are required to migrate before hand. It's not clear to me which API is breaking here.

Ideally, we want this to be a non-breaking change. Is that possible?

@anubhav756 anubhav756 force-pushed the anubhav-lc-wraps-core branch from a128a8e to 9bfb8d1 Compare May 16, 2025 21:24
@anubhav756 anubhav756 merged commit 03d1b16 into main May 16, 2025
20 checks passed
@anubhav756 anubhav756 deleted the anubhav-lc-wraps-core branch May 16, 2025 22:06
@release-please release-please bot mentioned this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants