Package akka.javasdk.agent
Interface Agent.Effect.OnSuccessBuilder
- Enclosing interface:
Agent.Effect<T>
public static interface Agent.Effect.OnSuccessBuilder
-
Method Summary
Modifier and TypeMethodDescriptionMap the String response from the model into a different response type.Handle failures that occur during model processing.responseAs
(Class<T> responseType) Parse the response from the model into a structured response of a given responseType.Reply with the response from the model.Reply with the response from the model.
-
Method Details
-
thenReply
Agent.Effect<String> thenReply()Reply with the response from the model.- Returns:
- A message reply.
-
thenReply
Reply with the response from the model.- Parameters:
metadata
- The metadata for the message.- Returns:
- A message reply.
-
responseAs
Parse the response from the model into a structured response of a given responseType.- Parameters:
responseType
- The structured response type.
-
map
Map the String response from the model into a different response type. -
onFailure
Handle failures that occur during model processing. This method allows recovery from various types of exceptions including:ModelException
- General model processing failuresRateLimitException
- API rate limiting exceededModelTimeoutException
- Model request timeoutUnsupportedFeatureException
- Unsupported model featuresInternalServerException
- Internal service errorsJsonParsingException
- Response parsing failuresToolCallLimitReachedException
- Tool call limit exceededToolCallExecutionException
- Function tool execution errorsMcpToolCallExecutionException
- MCP tool execution errors
-