Class AiServiceInvocationSummaryEvent.AiServiceInvocationSummaryEventBuilder
java.lang.Object
dev.langchain4j.observability.api.event.AiServiceEvent.Builder<AiServiceInvocationSummaryEvent>
dev.langchain4j.observability.api.event.AiServiceInvocationSummaryEvent.AiServiceInvocationSummaryEventBuilder
- Enclosing interface:
AiServiceInvocationSummaryEvent
public static class AiServiceInvocationSummaryEvent.AiServiceInvocationSummaryEventBuilder
extends AiServiceEvent.Builder<AiServiceInvocationSummaryEvent>
Builder for
AiServiceInvocationSummaryEvent instances.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedCreates a builder initialized from an existingAiServiceInvocationSummaryEvent. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newAiServiceInvocationSummaryEvent.event(AiServiceEvent event) Appends a single event to the events previously added to this builder.events()Returns the events added to this builder.events(List<AiServiceEvent> events) Sets the events, replacing any events previously added to this builder.invocationContext(InvocationContext invocationContext) Sets the invocation context.Methods inherited from class AiServiceEvent.Builder
invocationContext
-
Constructor Details
-
AiServiceInvocationSummaryEventBuilder
protected AiServiceInvocationSummaryEventBuilder() -
AiServiceInvocationSummaryEventBuilder
Creates a builder initialized from an existingAiServiceInvocationSummaryEvent.- Parameters:
src- The event to copy the values from
-
-
Method Details
-
invocationContext
public AiServiceInvocationSummaryEvent.AiServiceInvocationSummaryEventBuilder invocationContext(InvocationContext invocationContext) Sets the invocation context.- Overrides:
invocationContextin classAiServiceEvent.Builder<AiServiceInvocationSummaryEvent>- Parameters:
invocationContext- The invocation context- Returns:
- This builder
-
events
public AiServiceInvocationSummaryEvent.AiServiceInvocationSummaryEventBuilder events(List<AiServiceEvent> events) Sets the events, replacing any events previously added to this builder.nullelements are ignored.- Parameters:
events- The events, in the order they were fired. Ifnull, all events are removed.- Returns:
- This builder
-
event
public AiServiceInvocationSummaryEvent.AiServiceInvocationSummaryEventBuilder event(AiServiceEvent event) Appends a single event to the events previously added to this builder.- Parameters:
event- The event to append. Ifnull, no action is taken.- Returns:
- This builder
-
events
Returns the events added to this builder.- Returns:
- An unmodifiable copy of the events added to this builder, in the order they were added
-
build
Builds a newAiServiceInvocationSummaryEvent.- Specified by:
buildin classAiServiceEvent.Builder<AiServiceInvocationSummaryEvent>- Returns:
- A new
AiServiceInvocationSummaryEvent
-