Class SessionOptions<S>

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

public class SessionOptions<S> extends Object
SessionOptions provides configuration options for creating or loading sessions.
  • Constructor Details

    • SessionOptions

      public SessionOptions()
      Default constructor.
  • Method Details

    • getStore

      public SessionStore<S> getStore()
      Gets the session store.
      Returns:
      the session store
    • setStore

      public void setStore(SessionStore<S> store)
      Sets the session store.
      Parameters:
      store - the session store
    • getInitialState

      public S getInitialState()
      Gets the initial state.
      Returns:
      the initial state
    • setInitialState

      public void setInitialState(S initialState)
      Sets the initial state.
      Parameters:
      initialState - the initial state
    • getSessionId

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

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

      public static <S> SessionOptions.Builder<S> builder()
      Creates a builder for SessionOptions.
      Type Parameters:
      S - the state type
      Returns:
      a new builder