Class AnthropicServerToolResult

java.lang.Object
dev.langchain4j.model.anthropic.AnthropicServerToolResult

@Experimental public class AnthropicServerToolResult extends Object
Represents a result from an Anthropic server-executed tool (e.g., web_search, code_execution).

Content is stored as raw Object to be flexible and survive API changes. Users can cast to Map<String, Object> or List<Map<String, Object>> as needed.

Since:
1.10.0
  • Constructor Details

  • Method Details

    • type

      public String type()
      The type of server tool result (e.g., "web_search_tool_result", "code_execution_tool_result").
    • toolUseId

      public String toolUseId()
      The ID linking this result to the corresponding server_tool_use block.
    • content

      public Object content()
      The raw content from the API response. For web_search: typically a List<Map<String, Object>> with search results. For code_execution: typically a Map<String, Object> with stdout, stderr, return_code, etc.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static AnthropicServerToolResult.Builder builder()