Interface ToolResponse.Builder

All Superinterfaces:
MetaCarrier.Builder<ToolResponse.Builder>
Enclosing interface:
ToolResponse

public static interface ToolResponse.Builder extends MetaCarrier.Builder<ToolResponse.Builder>
Builder for creating tool responses
  • Method Details

    • addContent

      ToolResponse.Builder addContent(ContentBlock content)
      Add some unstructured content to the response
      Parameters:
      content - the unstructured content to add
      Returns:
      this builder
    • addTextContent

      ToolResponse.Builder addTextContent(String textContent)
      Create a text content block from a string and add it to the response
      Parameters:
      textContent - the text content to add
      Returns:
      this builder
    • setStructuredContent

      ToolResponse.Builder setStructuredContent(Object structuredContent)
      Sets the structured content of the response
      Parameters:
      structuredContent - the structured content
      Returns:
      this builder
    • setError

      ToolResponse.Builder setError(boolean isError)
      Sets whether or not the response represents an error
      Parameters:
      isError - true if the response represents an error, false otherwise
      Returns:
      this builder
    • build

      ToolResponse build()
      Builds the tool response
      Returns:
      the new tool response