tool2agent API Documentation - v0.0.0
    Preparing search index...

    Type Alias Middleware<InputType, OutputType, NewInputType, NewOutputType>

    Middleware that transforms a Tool2Agent into another Tool2Agent. This allows applying transformations to inputs, outputs, or execute functions.

    type Middleware<
        InputType,
        OutputType,
        NewInputType = InputType,
        NewOutputType = OutputType,
    > = {
        applyTo: (
            tool: Tool2Agent<InputType, OutputType>,
        ) => Tool2Agent<NewInputType, NewOutputType>;
        pipe<FinalInputType, FinalOutputType>(
            next: Middleware<
                NewInputType,
                NewOutputType,
                FinalInputType,
                FinalOutputType,
            >,
        ): Middleware<InputType, OutputType, FinalInputType, FinalOutputType>;
    }

    Type Parameters

    • InputType

      The input type of the original tool

    • OutputType

      The output type of the original tool

    • NewInputType = InputType

      The input type of the transformed tool (defaults to InputType)

    • NewOutputType = OutputType

      The output type of the transformed tool (defaults to OutputType)

    Index

    Properties

    Methods

    Properties

    The middleware function that transforms a Tool2Agent.

    Methods