Class CountTokensInput

    • Method Detail

      • invokeModel

        public final InvokeModelTokensRequest invokeModel()

        An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.

        Returns:
        An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.
      • converse

        public final ConverseTokensRequest converse()

        A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.

        Returns:
        A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)
      • fromInvokeModel

        public static CountTokensInput fromInvokeModel​(InvokeModelTokensRequest invokeModel)
        Create an instance of this class with invokeModel() initialized to the given value.

        An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.

        Parameters:
        invokeModel - An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.
      • fromInvokeModel

        public static CountTokensInput fromInvokeModel​(Consumer<InvokeModelTokensRequest.Builder> invokeModel)
        Create an instance of this class with invokeModel() initialized to the given value.

        An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.

        Parameters:
        invokeModel - An InvokeModel request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the InvokeModel operation.
      • fromConverse

        public static CountTokensInput fromConverse​(ConverseTokensRequest converse)
        Create an instance of this class with converse() initialized to the given value.

        A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.

        Parameters:
        converse - A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.
      • fromConverse

        public static CountTokensInput fromConverse​(Consumer<ConverseTokensRequest.Builder> converse)
        Create an instance of this class with converse() initialized to the given value.

        A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.

        Parameters:
        converse - A Converse request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the Converse operation.