Class AgentOutput<S>

java.lang.Object
com.google.genkit.ai.agent.AgentOutput<S>
Type Parameters:
S - the type of custom state

public class AgentOutput<S> extends Object
AgentOutput represents the output of an agent turn.
  • Constructor Details

    • AgentOutput

      public AgentOutput()
      Default constructor.
  • Method Details

    • builder

      public static <S> AgentOutput.Builder<S> builder()
      Creates a builder for AgentOutput.
      Type Parameters:
      S - the type of custom state
      Returns:
      a new builder
    • getSessionId

      public String getSessionId()
      Returns the session ID.
      Returns:
      the session ID
    • setSessionId

      public void setSessionId(String sessionId)
      Sets the session ID.
      Parameters:
      sessionId - the session ID
    • getSnapshotId

      public String getSnapshotId()
      Returns the snapshot ID.
      Returns:
      the snapshot ID
    • setSnapshotId

      public void setSnapshotId(String snapshotId)
      Sets the snapshot ID.
      Parameters:
      snapshotId - the snapshot ID
    • getState

      public SessionState<S> getState()
      Returns the session state.
      Returns:
      the state
    • setState

      public void setState(SessionState<S> state)
      Sets the session state.
      Parameters:
      state - the state
    • getMessage

      public Message getMessage()
      Returns the output message.
      Returns:
      the message
    • setMessage

      public void setMessage(Message message)
      Sets the output message.
      Parameters:
      message - the message
    • getArtifacts

      public List<Artifact> getArtifacts()
      Returns the output artifacts.
      Returns:
      the artifacts
    • setArtifacts

      public void setArtifacts(List<Artifact> artifacts)
      Sets the output artifacts.
      Parameters:
      artifacts - the artifacts
    • getFinishReason

      public AgentFinishReason getFinishReason()
      Returns the finish reason.
      Returns:
      the finish reason
    • setFinishReason

      public void setFinishReason(AgentFinishReason finishReason)
      Sets the finish reason.
      Parameters:
      finishReason - the finish reason
    • getError

      public RuntimeError getError()
      Returns the runtime error, if any.
      Returns:
      the error, or null if no error
    • setError

      public void setError(RuntimeError error)
      Sets the runtime error.
      Parameters:
      error - the error