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.
-
-
Constructor Summary
Constructors Constructor Description ThinkingResponse(T result, List<ThinkingBlock> thinkingBlocks, Throwable exception)ThinkingResponse(T result, List<ThinkingBlock> thinkingBlocks)
-
Method Summary
Modifier and Type Method Description final TgetResult()The final converted result object. final List<ThinkingBlock>getThinkingBlocks()The thinking blocks extracted from the LLM response. final ThrowablegetException()Exception might occur even before LLM Operation with no result or thinking blocks final BooleanhasResult()Check if the conversion was successful. final BooleanhasThinking()Check if thinking blocks were found in the response. final StringgetThinkingContent()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"). -
-
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").
-
-
-
-