Enum Class AgentFinishReason

java.lang.Object
java.lang.Enum<AgentFinishReason>
com.google.genkit.ai.agent.AgentFinishReason
All Implemented Interfaces:
Serializable, Comparable<AgentFinishReason>, Constable

public enum AgentFinishReason extends Enum<AgentFinishReason>
AgentFinishReason indicates why an agent finished execution.
  • Enum Constant Details

    • STOP

      public static final AgentFinishReason STOP
      The agent finished normally due to a stop condition.
    • LENGTH

      public static final AgentFinishReason LENGTH
      The agent finished due to reaching token length limits.
    • BLOCKED

      public static final AgentFinishReason BLOCKED
      The agent was blocked from proceeding.
    • INTERRUPTED

      public static final AgentFinishReason INTERRUPTED
      The agent execution was interrupted.
    • OTHER

      public static final AgentFinishReason OTHER
      The agent finished for some other reason.
    • UNKNOWN

      public static final AgentFinishReason UNKNOWN
      The agent finish reason is unknown.
    • ABORTED

      public static final AgentFinishReason ABORTED
      The agent was aborted.
    • DETACHED

      public static final AgentFinishReason DETACHED
      The agent was detached.
    • FAILED

      public static final AgentFinishReason FAILED
      The agent failed.
  • Method Details

    • values

      public static AgentFinishReason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AgentFinishReason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Returns the string value of the agent finish reason.
      Returns:
      the agent finish reason string value
    • fromValue

      public static AgentFinishReason fromValue(String value)
      Creates an AgentFinishReason from a string value.
      Parameters:
      value - the string value
      Returns:
      the corresponding AgentFinishReason
      Throws:
      IllegalArgumentException - if the value doesn't match any AgentFinishReason
    • toString

      public String toString()
      Overrides:
      toString in class Enum<AgentFinishReason>