Namespace: LLama
The state of a chat session in-memory.
public class SessionState : System.IEquatable`1[[LLama.SessionState, LLamaSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
Inheritance Object → SessionState
Implements IEquatable<SessionState>
Saved executor state for the session in JSON format.
public ExecutorBaseState ExecutorState { get; set; }
Saved context state (KV cache) for the session.
public State ContextState { get; set; }
The input transform pipeline used in this session.
public ITextTransform[] InputTransformPipeline { get; set; }
The output transform used in this session.
public ITextStreamTransform OutputTransform { get; set; }
The history transform used in this session.
public IHistoryTransform HistoryTransform { get; set; }
The the chat history messages for this session.
public Message[] History { get; set; }
Create a new session state.
public SessionState(State contextState, ExecutorBaseState executorState, ChatHistory history, List<ITextTransform> inputTransformPipeline, ITextStreamTransform outputTransform, IHistoryTransform historyTransform)
contextState State
executorState ExecutorBaseState
history ChatHistory
inputTransformPipeline List<ITextTransform>
outputTransform ITextStreamTransform
historyTransform IHistoryTransform
Save the session state to folder.
public void Save(string path)
path String
Load the session state from folder.
public static SessionState Load(string path)
path String
ArgumentException
Throws when session state is incorrect
public string ToString()
protected bool PrintMembers(StringBuilder builder)
builder StringBuilder
public int GetHashCode()
public bool Equals(object obj)
obj Object
public bool Equals(SessionState other)
other SessionState
public SessionState <Clone>$()