Class FilesystemInterceptor.Builder

java.lang.Object
com.alibaba.cloud.ai.graph.agent.extension.interceptor.FilesystemInterceptor.Builder
Enclosing class:
FilesystemInterceptor

public static class FilesystemInterceptor.Builder extends Object
Builder for FilesystemInterceptor with comprehensive configuration options. Note: Token limit and large result eviction features have been moved to LargeResultEvictionInterceptor. Use both interceptors together if needed.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • systemPrompt

      public FilesystemInterceptor.Builder systemPrompt(String systemPrompt)
      Set custom system prompt to guide filesystem usage. Set to null to disable system prompt injection.
    • readOnly

      public FilesystemInterceptor.Builder readOnly(boolean readOnly)
      Set whether the filesystem should be read-only. When true, write_file and edit_file tools are not provided. Default: false
    • customToolDescriptions

      public FilesystemInterceptor.Builder customToolDescriptions(Map<String,String> customToolDescriptions)
      Set custom tool descriptions to override defaults. Map keys should be tool names: "ls", "read_file", "write_file", "edit_file", "glob", "grep". Example:
       Map<String, String> customDescs = Map.of(
           "read_file", "Custom read file description",
           "write_file", "Custom write file description"
       );
       builder.customToolDescriptions(customDescs);
       
    • addCustomToolDescription

      public FilesystemInterceptor.Builder addCustomToolDescription(String toolName, String description)
      Add a single custom tool description. Convenience method for adding one description at a time.
      Parameters:
      toolName - Name of the tool ("ls", "read_file", etc.)
      description - Custom description for the tool
    • build

      public FilesystemInterceptor build()