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).-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionResult
(T content, TokenUsage tokenUsage, List<Content> sources, FinishReason finishReason, List<ToolExecution> toolExecutions) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Result.ResultBuilder
<T> builder()
content()
sources()
-
Constructor Details
-
Result
public Result(T content, TokenUsage tokenUsage, List<Content> sources, FinishReason finishReason, List<ToolExecution> toolExecutions)
-
-
Method Details
-
builder
-
content
-
tokenUsage
-
sources
-
finishReason
-
toolExecutions
-