Interface CodeInterpreterResult.Builder

  • Method Details

    • content

      The textual content of the execution result. This includes standard output from the code execution, such as print statements, console output, and text representations of results.

      Parameters:
      content - The textual content of the execution result. This includes standard output from the code execution, such as print statements, console output, and text representations of results.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • content

      The textual content of the execution result. This includes standard output from the code execution, such as print statements, console output, and text representations of results.

      Parameters:
      content - The textual content of the execution result. This includes standard output from the code execution, such as print statements, console output, and text representations of results.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • content

      The textual content of the execution result. This includes standard output from the code execution, such as print statements, console output, and text representations of results.

      This is a convenience method that creates an instance of the ContentBlock.Builder avoiding the need to create one manually via ContentBlock.builder() .

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to content(List<ContentBlock>).

      Parameters:
      content - a consumer that will call methods on ContentBlock.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • structuredContent

      CodeInterpreterResult.Builder structuredContent(ToolResultStructuredContent structuredContent)

      The structured content of the execution result. This includes additional metadata about the execution, such as execution time, memory usage, and structured representations of output data. The format depends on the specific code interpreter and execution context.

      Parameters:
      structuredContent - The structured content of the execution result. This includes additional metadata about the execution, such as execution time, memory usage, and structured representations of output data. The format depends on the specific code interpreter and execution context.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • structuredContent

      default CodeInterpreterResult.Builder structuredContent(Consumer<ToolResultStructuredContent.Builder> structuredContent)

      The structured content of the execution result. This includes additional metadata about the execution, such as execution time, memory usage, and structured representations of output data. The format depends on the specific code interpreter and execution context.

      This is a convenience method that creates an instance of the ToolResultStructuredContent.Builder avoiding the need to create one manually via ToolResultStructuredContent.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to structuredContent(ToolResultStructuredContent).

      Parameters:
      structuredContent - a consumer that will call methods on ToolResultStructuredContent.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • isError

      Indicates whether the result represents an error. If true, the content contains error messages or exception information. If false, the content contains successful execution results.

      Parameters:
      isError - Indicates whether the result represents an error. If true, the content contains error messages or exception information. If false, the content contains successful execution results.
      Returns:
      Returns a reference to this object so that method calls can be chained together.