Class SessionData.Builder<S>

java.lang.Object
com.google.genkit.ai.session.SessionData.Builder<S>
Type Parameters:
S - the state type
Enclosing class:
SessionData<S>

public static class SessionData.Builder<S> extends Object
Builder for SessionData.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • id

      public SessionData.Builder<S> id(String id)
      Sets the session ID.
      Parameters:
      id - the session ID
      Returns:
      this builder
    • state

      public SessionData.Builder<S> state(S state)
      Sets the session state.
      Parameters:
      state - the session state
      Returns:
      this builder
    • threads

      public SessionData.Builder<S> threads(Map<String,List<Message>> threads)
      Sets the conversation threads.
      Parameters:
      threads - the threads map
      Returns:
      this builder
    • thread

      public SessionData.Builder<S> thread(String threadName, List<Message> messages)
      Adds a thread.
      Parameters:
      threadName - the thread name
      messages - the messages
      Returns:
      this builder
    • build

      public SessionData<S> build()
      Builds the SessionData.
      Returns:
      the built SessionData