Package dev.langchain4j.service
Class Result<T>
java.lang.Object
dev.langchain4j.service.Result<T>
- Type Parameters:
T
- The type of the content. Can be of any return type supported by AI Services, such as String, Enum, MyCustomPojo, etc.
Represents the result of an AI Service invocation.
It contains actual content (LLM response) and additional information associated with it,
such as
TokenUsage
and sources (Content
s retrieved during RAG).-
Constructor Summary
ConstructorsConstructorDescriptionResult
(T content, TokenUsage tokenUsage, List<Content> sources, FinishReason finishReason, List<ToolExecution> toolExecutions) -
Method Summary
-
Constructor Details
-
Result
public Result(T content, TokenUsage tokenUsage, List<Content> sources, FinishReason finishReason, List<ToolExecution> toolExecutions)
-
-
Method Details
-
content
-
tokenUsage
-
sources
-
finishReason
-
toolExecutions
-