Class AnthropicContent

java.lang.Object
dev.langchain4j.model.anthropic.internal.api.AnthropicContent

public class AnthropicContent extends Object
Represents content in an Anthropic API message.

This class supports multiple content types:

  • text - Plain text content
  • tool_use - Tool/function call requests
  • thinking - Model's thinking/reasoning content
  • redacted_thinking - Redacted thinking content
  • *_tool_result - Results from server-side tool execution
  • Field Details

    • type

      public String type
      The type of content (e.g., "text", "tool_use", "thinking").
    • text

      public String text
      Text content when type is "text".
    • id

      public String id
      Unique identifier when type is "tool_use".
    • name

      public String name
      Tool name when type is "tool_use".
    • input

      public Map<String,Object> input
      Tool input parameters when type is "tool_use".
    • thinking

      public String thinking
      Thinking content when type is "thinking".
    • signature

      public String signature
      Signature for thinking content when type is "thinking".
    • data

      public String data
      Data when type is "redacted_thinking".
    • toolUseId

      public String toolUseId
      Tool use ID when type ends with "_tool_result".
    • content

      public Object content
      Raw content for tool results - structure varies by tool type.
  • Constructor Details

    • AnthropicContent

      public AnthropicContent()
  • Method Details