Class AnthropicContent.Builder

java.lang.Object
dev.langchain4j.model.anthropic.internal.api.AnthropicContent.Builder
Enclosing class:
AnthropicContent

public static class AnthropicContent.Builder extends Object
Builder for constructing AnthropicContent instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • type

      public AnthropicContent.Builder type(String type)
      Sets the content type.
      Parameters:
      type - the content type (e.g., "text", "tool_use", "thinking")
      Returns:
      this builder for chaining
    • text

      public AnthropicContent.Builder text(String text)
      Sets the text content.
      Parameters:
      text - the text content
      Returns:
      this builder for chaining
    • id

      Sets the unique identifier for tool use.
      Parameters:
      id - the tool use identifier
      Returns:
      this builder for chaining
    • name

      public AnthropicContent.Builder name(String name)
      Sets the tool name.
      Parameters:
      name - the tool name
      Returns:
      this builder for chaining
    • input

      public AnthropicContent.Builder input(Map<String,Object> input)
      Sets the tool input parameters.
      Parameters:
      input - the tool input parameters
      Returns:
      this builder for chaining
    • thinking

      public AnthropicContent.Builder thinking(String thinking)
      Sets the thinking content.
      Parameters:
      thinking - the thinking content
      Returns:
      this builder for chaining
    • signature

      public AnthropicContent.Builder signature(String signature)
      Sets the signature for thinking content.
      Parameters:
      signature - the thinking signature
      Returns:
      this builder for chaining
    • data

      public AnthropicContent.Builder data(String data)
      Sets the data for redacted thinking.
      Parameters:
      data - the redacted thinking data
      Returns:
      this builder for chaining
    • toolUseId

      public AnthropicContent.Builder toolUseId(String toolUseId)
      Sets the tool use ID for tool results.
      Parameters:
      toolUseId - the tool use ID
      Returns:
      this builder for chaining
    • content

      public AnthropicContent.Builder content(Object content)
      Sets the raw content for tool results.
      Parameters:
      content - the raw content
      Returns:
      this builder for chaining
    • build

      public AnthropicContent build()
      Builds the AnthropicContent instance.
      Returns:
      a new AnthropicContent instance