Class Tool

  • All Implemented Interfaces:

    
    public final class Tool
    
                        
    • Constructor Detail

    • Method Detail

      • name

         final String name()

        Name of the tool.

        This is how the tool will be called by the model and in tool_use blocks.

      • deferLoading

         final Optional<Boolean> deferLoading()

        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

      • description

         final Optional<String> description()

        Description of what this tool does.

        Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.

      • eagerInputStreaming

         final Optional<Boolean> eagerInputStreaming()

        Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.

      • strict

         final Optional<Boolean> strict()

        When true, guarantees schema validation on tool names and inputs

      • _inputSchema

         final JsonField<Tool.InputSchema> _inputSchema()

        Returns the raw JSON value of inputSchema.

        Unlike inputSchema, this method doesn't throw if the JSON field has an unexpected type.

      • _name

         final JsonField<String> _name()

        Returns the raw JSON value of name.

        Unlike name, this method doesn't throw if the JSON field has an unexpected type.

      • _deferLoading

         final JsonField<Boolean> _deferLoading()

        Returns the raw JSON value of deferLoading.

        Unlike deferLoading, this method doesn't throw if the JSON field has an unexpected type.

      • _description

         final JsonField<String> _description()

        Returns the raw JSON value of description.

        Unlike description, this method doesn't throw if the JSON field has an unexpected type.

      • _eagerInputStreaming

         final JsonField<Boolean> _eagerInputStreaming()

        Returns the raw JSON value of eagerInputStreaming.

        Unlike eagerInputStreaming, this method doesn't throw if the JSON field has an unexpected type.

      • _strict

         final JsonField<Boolean> _strict()

        Returns the raw JSON value of strict.

        Unlike strict, this method doesn't throw if the JSON field has an unexpected type.

      • _type

         final JsonField<Tool.Type> _type()

        Returns the raw JSON value of type.

        Unlike type, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final Tool validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.

      • builder

         final static Tool.Builder builder()

        Returns a mutable builder for constructing an instance of Tool.

        The following fields are required:

        .inputSchema()
        .name()