Interface ToolExecutedEvent
- All Superinterfaces:
AiServiceEvent
- All Known Implementing Classes:
DefaultToolExecutedEvent
Invoked after the tool is executed.
It is important to note that this can be invoked multiple times within a single AI Service invocation.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface AiServiceEvent
AiServiceEvent.Builder<T> -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder instance for constructing aToolExecutedEvent.default Class<ToolExecutedEvent> Retrieves the class type of the event, representing the specific category of the AI Service invocation event.request()Gets theToolExecutionRequestthat initiated the tool execution.Returns the contents of the tool execution result.Returns the tool execution result as a plain text string.Creates a new builder instance initialized with the properties of thisAiServiceEvent.Methods inherited from interface AiServiceEvent
invocationContext
-
Method Details
-
request
ToolExecutionRequest request()Gets theToolExecutionRequestthat initiated the tool execution. -
resultText
String resultText()Returns the tool execution result as a plain text string. This is a convenience method for when the result is known to be a singleTextContent.- Returns:
- the text of the single
TextContentelement. - Throws:
IllegalStateException- if the result contains non-text or multiple content elements. UseresultContents()instead.
-
resultContents
Returns the contents of the tool execution result.- Returns:
- the list of
Contentelements, nevernull. - Since:
- 1.13.0
-
builder
Creates a new builder instance for constructing aToolExecutedEvent. -
eventClass
Description copied from interface:AiServiceEventRetrieves the class type of the event, representing the specific category of the AI Service invocation event.- Specified by:
eventClassin interfaceAiServiceEvent
-
toBuilder
Description copied from interface:AiServiceEventCreates a new builder instance initialized with the properties of thisAiServiceEvent. This allows modification of the existing properties and reconstruction of the event.- Specified by:
toBuilderin interfaceAiServiceEvent
-