Interface ChatGenerationMetadata.Builder
- All Known Implementing Classes:
DefaultChatGenerationMetadataBuilder
- Enclosing interface:
- ChatGenerationMetadata
public static interface ChatGenerationMetadata.Builder
- Since:
- 1.0.0
- Author:
- Christian Tzolov
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the Generation metadata.contentFilter(String contentFilter) Add content filter to the Generation result.contentFilters(Set<String> contentFilters) Add content filters to the Generation result.finishReason(@Nullable String finishReason) Set the reason this generation finished, as the provider names it.default ChatGenerationMetadata.BuilderfinishReasonCategory(@Nullable FinishReasonCategory finishReasonCategory) Set the normalized category of the finish reason.Add metadata to the Generation result.Add metadata to the Generation result.
-
Method Details
-
finishReason
Set the reason this generation finished, as the provider names it. SeefinishReasonCategory(FinishReasonCategory)for its normalized category. -
finishReasonCategory
default ChatGenerationMetadata.Builder finishReasonCategory(@Nullable FinishReasonCategory finishReasonCategory) Set the normalized category of the finish reason. A chat model sets it next tofinishReason(String), as it knows what the names of its provider mean. When it is not set, the category is derived from the raw finish reason withFinishReasonCategory.categorize(String).- Parameters:
finishReasonCategory- the category, ornullto derive it- Returns:
- this builder
- Since:
- 2.1.0
-
metadata
Add metadata to the Generation result. -
metadata
Add metadata to the Generation result. -
contentFilter
Add content filter to the Generation result. -
contentFilters
Add content filters to the Generation result. -
build
ChatGenerationMetadata build()Build the Generation metadata.
-