Skip to content

feat(toolbox-llamaindex)!: Base toolbox-llamaindex over toolbox-core #244

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 9 commits into from
May 20, 2025

Conversation

anubhav756
Copy link
Contributor

@anubhav756 anubhav756 commented May 16, 2025

Similar to #229 but for toolbox-llamaindex.

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 self-assigned this May 16, 2025
@anubhav756 anubhav756 changed the title chore: Add toolbox-core as a dependency fix(toolbox-llamaindex)!: Add toolbox-core as a dependency May 19, 2025
@anubhav756 anubhav756 changed the title fix(toolbox-llamaindex)!: Add toolbox-core as a dependency feat(toolbox-llamaindex)!: Base toolbox-llamaindex over toolbox-core May 19, 2025
@anubhav756 anubhav756 marked this pull request as ready for review May 19, 2025 14:40
@anubhav756 anubhav756 requested a review from a team as a code owner May 19, 2025 14:40
@anubhav756 anubhav756 force-pushed the anubhav-llamaindex-wraps-core branch from d10bff2 to f915eeb Compare May 20, 2025 06:41
@anubhav756 anubhav756 force-pushed the anubhav-llamaindex-wraps-core branch from f915eeb to c7dbfbe Compare May 20, 2025 06:42
@anubhav756 anubhav756 merged commit 64aa5a8 into main May 20, 2025
19 checks passed
@anubhav756 anubhav756 deleted the anubhav-llamaindex-wraps-core branch May 20, 2025 06:51
@release-please release-please bot mentioned this pull request May 20, 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.

2 participants