Skip to content

[NEW CONTENT] Document class-based tools approach #110

Open
@zastrowm

Description

@zastrowm

Proposed Content

Callouts on how to create class-based tools which enable customizing the behavior of the tool + dynamically changing properties.

Location

https://strandsagents.com/latest/user-guide/concepts/tools/python-tools/

Rationale

A proposed use case:

I'd like to have a file_read tool and want to dynamically change various restrictions like file extensions, directories, basically to pass in variables that the LLM can't mess with

Using modules or @tool decorator, the tool is basically a singleton

Users can already:

  • Derive from PythonAgentTool (not preferred) or create a class in which @tool methods are exposed as tools (preferred), but we don't document this anywhere.

Content Outline (Optional)

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions