Skip to content

types

Class info

Classes

Name Children Inherits
ToolHandler
schemez.tool_executor.types
Protocol for user-provided tool handler.

    🛈 DocStrings

    Type definitions for tool executor.

    ToolHandler

    Bases: Protocol

    Protocol for user-provided tool handler.

    Source code in src/schemez/tool_executor/types.py
    class ToolHandler(Protocol):
        """Protocol for user-provided tool handler."""
    
        async def __call__(self, method_name: str, input_props: BaseModel) -> str:
            """Process a tool call.
    
            Args:
                method_name: Name of the tool being called (e.g., "get_weather")
                input_props: Validated input model instance
    
            Returns:
                String result from the tool execution
    
            Raises:
                Exception: If tool execution fails
            """
            ...
    

    __call__ async

    __call__(method_name: str, input_props: BaseModel) -> str
    

    Process a tool call.

    Parameters:

    Name Type Description Default
    method_name str

    Name of the tool being called (e.g., "get_weather")

    required
    input_props BaseModel

    Validated input model instance

    required

    Returns:

    Type Description
    str

    String result from the tool execution

    Raises:

    Type Description
    Exception

    If tool execution fails

    Source code in src/schemez/tool_executor/types.py
    async def __call__(self, method_name: str, input_props: BaseModel) -> str:
        """Process a tool call.
    
        Args:
            method_name: Name of the tool being called (e.g., "get_weather")
            input_props: Validated input model instance
    
        Returns:
            String result from the tool execution
    
        Raises:
            Exception: If tool execution fails
        """
        ...