Class InterruptConfig.Builder<I,O>

java.lang.Object
com.google.genkit.ai.InterruptConfig.Builder<I,O>
Enclosing class:
InterruptConfig<I,O>

public static class InterruptConfig.Builder<I,O> extends Object
Builder for InterruptConfig.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public InterruptConfig.Builder<I,O> name(String name)
      Sets the interrupt name.
      Parameters:
      name - the name
      Returns:
      this builder
    • description

      public InterruptConfig.Builder<I,O> description(String description)
      Sets the description.
      Parameters:
      description - the description
      Returns:
      this builder
    • inputType

      public InterruptConfig.Builder<I,O> inputType(Class<I> inputType)
      Sets the input type class.
      Parameters:
      inputType - the input type class
      Returns:
      this builder
    • outputType

      public InterruptConfig.Builder<I,O> outputType(Class<O> outputType)
      Sets the output type class.
      Parameters:
      outputType - the output type class
      Returns:
      this builder
    • inputSchema

      public InterruptConfig.Builder<I,O> inputSchema(Map<String,Object> inputSchema)
      Sets the input schema.
      Parameters:
      inputSchema - the input schema
      Returns:
      this builder
    • outputSchema

      public InterruptConfig.Builder<I,O> outputSchema(Map<String,Object> outputSchema)
      Sets the output schema.
      Parameters:
      outputSchema - the output schema
      Returns:
      this builder
    • requestMetadata

      public InterruptConfig.Builder<I,O> requestMetadata(Function<I,Map<String,Object>> requestMetadata)
      Sets the request metadata function.

      This function is called with the tool input when the interrupt is triggered, and should return metadata that will be included in the interrupt.

      Parameters:
      requestMetadata - function to generate metadata from input
      Returns:
      this builder
    • build

      public InterruptConfig<I,O> build()
      Builds the InterruptConfig.
      Returns:
      the built config