Interface ToolCallBatchPartitioner.ToolCallClassifier

Enclosing class:
ToolCallBatchPartitioner

public static interface ToolCallBatchPartitioner.ToolCallClassifier
Strategy interface: callers implement to connect their Tool/ActionMetadata lookup with the partitioner. Provides defaults that extract paths from the common argument keys; override when the tool's argument shape differs.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if call's underlying tool is safe to run in parallel: idempotent, parallelizable, not requires-confirmation.
    static String
    Canonicalises a path for overlap comparison.
    default Set<String>
    Returns the set of paths / URIs / resource IDs that call reads or writes.
  • Method Details

    • isParallelSafe

      boolean isParallelSafe(ChatResponse.ToolCall call)
      Returns true if call's underlying tool is safe to run in parallel: idempotent, parallelizable, not requires-confirmation. Unknown tools should return false (conservative default).
    • pathsFor

      default Set<String> pathsFor(ChatResponse.ToolCall call)
      Returns the set of paths / URIs / resource IDs that call reads or writes. Default implementation scans ToolCallBatchPartitioner.DEFAULT_PATH_KEYS against
      invalid reference
      ToolCall#getArguments()
      . Override to handle tool-specific argument shapes (e.g. a batch files: [a, b, c] array).
    • normalise

      static String normalise(String path)
      Canonicalises a path for overlap comparison. Lowercases (Locale.ROOT) and strips a trailing slash so "/tmp/a" and "/tmp/a/" collide as intended.