Class SessionState<S>

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

public class SessionState<S> extends Object
SessionState represents the state of an agent session.
  • Constructor Details

    • SessionState

      public SessionState()
      Default constructor.
  • Method Details

    • builder

      public static <S> SessionState.Builder<S> builder()
      Creates a builder for SessionState.
      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
    • getMessages

      public List<Message> getMessages()
      Returns the session messages.
      Returns:
      the messages
    • setMessages

      public void setMessages(List<Message> messages)
      Sets the session messages.
      Parameters:
      messages - the messages
    • getCustom

      public S getCustom()
      Returns the custom state.
      Returns:
      the custom state
    • setCustom

      public void setCustom(S custom)
      Sets the custom state.
      Parameters:
      custom - the custom state
    • getArtifacts

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

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