Class OnlineQueryParams.SingleRowInput

java.lang.Object
ai.chalk.models.OnlineQueryParams.SingleRowInput
Enclosing class:
OnlineQueryParams

public static class OnlineQueryParams.SingleRowInput extends Object
Helper class for building input data for single-row online queries. Provides a more convenient way to add input values for single-row queries without needing to wrap each value in List.of() or Arrays.asList().
  • Constructor Details

    • SingleRowInput

      public SingleRowInput()
      Create a new SingleRowInput builder.
  • Method Details

    • withInput

      public final <T> OnlineQueryParams.SingleRowInput withInput(Feature<T> feature, T value)
      Add a value to the row using a typed Feature.
      Parameters:
      feature - The feature to add a value for
      value - The value for this feature
      Returns:
      This SingleRowInput for method chaining
    • withInput

      public final OnlineQueryParams.SingleRowInput withInput(String featureFqn, Object value)
      Add a value to the row using a feature fully qualified name (FQN).
      Parameters:
      featureFqn - The fully qualified name of the feature
      value - The value for this feature
      Returns:
      This SingleRowInput for method chaining
    • withInputs

      public final OnlineQueryParams.SingleRowInput withInputs(Map<String,Object> inputs)
      Add multiple values to the row using a map of feature FQNs to values.
      Parameters:
      inputs - Map of feature FQNs to their values
      Returns:
      This SingleRowInput for method chaining
    • withHasManyInput

      public final OnlineQueryParams.SingleRowInput withHasManyInput(String featureFqn, List<Map<String,Object>> rows)
      Add a has-many input: a list of child rows (each row a Map of column FQN to value) for a single-row query. The child rows represent the has-many relationship data.
      Parameters:
      featureFqn - The fully qualified name of the has-many feature (e.g. "user.transactions")
      rows - The list of child row maps
      Returns:
      This SingleRowInput for method chaining