Interface ContextManager

All Known Implementing Classes:
SimpleContextManager

public interface ContextManager
Manages conversation context and state for AI agents. Handles session data, conversation history, and contextual information.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToHistory(String sessionId, com.google.gson.JsonObject message)
    Add a message to the conversation history.
    void
    clearContext(String sessionId)
    Clear context data for a session.
    getContext(String sessionId, String key)
    Retrieve context data for a session.
    com.google.gson.JsonObject
    getHistory(String sessionId)
    Get the conversation history for a session.
    com.google.gson.JsonObject
    Get all context data for a session as a JSON object.
    void
    setContext(String sessionId, String key, Object value)
    Store context data for a session.
  • Method Details

    • setContext

      void setContext(String sessionId, String key, Object value)
      Store context data for a session.
      Parameters:
      sessionId - The session identifier
      key - The context key
      value - The context value
    • getContext

      Object getContext(String sessionId, String key)
      Retrieve context data for a session.
      Parameters:
      sessionId - The session identifier
      key - The context key
      Returns:
      The context value, or null if not found
    • getSessionContext

      com.google.gson.JsonObject getSessionContext(String sessionId)
      Get all context data for a session as a JSON object.
      Parameters:
      sessionId - The session identifier
      Returns:
      All context data for the session
    • clearContext

      void clearContext(String sessionId)
      Clear context data for a session.
      Parameters:
      sessionId - The session identifier
    • addToHistory

      void addToHistory(String sessionId, com.google.gson.JsonObject message)
      Add a message to the conversation history.
      Parameters:
      sessionId - The session identifier
      message - The message to add to history
    • getHistory

      com.google.gson.JsonObject getHistory(String sessionId)
      Get the conversation history for a session.
      Parameters:
      sessionId - The session identifier
      Returns:
      The conversation history