Class ThinkingResponse

  • All Implemented Interfaces:

    
    public final class ThinkingResponse<T extends Object>
    
                        

    Response from LLM operations that includes both the converted result and thinking blocks.

    This class provides access to both the final structured result and the reasoning process that led to that result, enabling analysis of LLM decision-making.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final T getResult() The final converted result object.
      final List<ThinkingBlock> getThinkingBlocks() The thinking blocks extracted from the LLM response.
      final Throwable getException() Exception might occur even before LLM Operation with no result or thinking blocks
      final Boolean hasResult() Check if the conversion was successful.
      final Boolean hasThinking() Check if thinking blocks were found in the response.
      final String getThinkingContent() Get all thinking content as a single concatenated string.
      final List<ThinkingBlock> getThinkingByType(ThinkingTagType tagType) Get thinking blocks of a specific type.
      final List<ThinkingBlock> getThinkingByTag(String tagValue) Get thinking blocks by tag value (e.g., "think", "analysis").
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThinkingResponse

        ThinkingResponse(T result, List<ThinkingBlock> thinkingBlocks, Throwable exception)
      • ThinkingResponse

        ThinkingResponse(T result, List<ThinkingBlock> thinkingBlocks)
    • Method Detail

      • getResult

         final T getResult()

        The final converted result object.

        This contains the structured output after parsing and converting the cleaned LLM response (with thinking blocks removed).

      • getThinkingBlocks

         final List<ThinkingBlock> getThinkingBlocks()

        The thinking blocks extracted from the LLM response.

        Contains all reasoning, analysis, and thought processes that the LLM expressed before producing the final result. Each block includes metadata about the thinking pattern used.

      • getException

         final Throwable getException()

        Exception might occur even before LLM Operation with no result or thinking blocks

      • hasThinking

         final Boolean hasThinking()

        Check if thinking blocks were found in the response.

      • getThinkingContent

         final String getThinkingContent()

        Get all thinking content as a single concatenated string. Useful for logging or display purposes.

      • getThinkingByType

         final List<ThinkingBlock> getThinkingByType(ThinkingTagType tagType)

        Get thinking blocks of a specific type.

      • getThinkingByTag

         final List<ThinkingBlock> getThinkingByTag(String tagValue)

        Get thinking blocks by tag value (e.g., "think", "analysis").