Interface ConverseTokensRequest.Builder

  • Method Details

    • messages

      An array of messages to count tokens for.

      Parameters:
      messages - An array of messages to count tokens for.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • messages

      ConverseTokensRequest.Builder messages(Message... messages)

      An array of messages to count tokens for.

      Parameters:
      messages - An array of messages to count tokens for.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • messages

      An array of messages to count tokens for.

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

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

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

      The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided.

      Parameters:
      system - The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • system

      The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided.

      Parameters:
      system - The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • system

      The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided.

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

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

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

      The toolConfig of Converse input request to count tokens for. Configuration information for the tools that the model can use when generating a response.

      Parameters:
      toolConfig - The toolConfig of Converse input request to count tokens for. Configuration information for the tools that the model can use when generating a response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • toolConfig

      The toolConfig of Converse input request to count tokens for. Configuration information for the tools that the model can use when generating a response.

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

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

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

      ConverseTokensRequest.Builder additionalModelRequestFields(Document additionalModelRequestFields)

      The additionalModelRequestFields of Converse input request to count tokens for. Use this field when you want to pass additional parameters that the model supports.

      Parameters:
      additionalModelRequestFields - The additionalModelRequestFields of Converse input request to count tokens for. Use this field when you want to pass additional parameters that the model supports.
      Returns:
      Returns a reference to this object so that method calls can be chained together.