class
Llama::Session
- Llama::Session
- Reference
- Object
Overview
Stateful text facade. The canonical transcript is rebuilt before each turn; this conservative strategy keeps stop-truncated text and native KV state in agreement until incremental token reconciliation is introduced.
Included Modules
Defined in:
llama/session.crConstructors
Instance Method Summary
- #close : Nil
- #closed? : Bool
- #finalize
- #free : Nil
- #generate(prompt : String, options : GenerationOptions = GenerationOptions.new, &block : GenerationChunk -> ) : Generation
- #generate(prompt : String, options : GenerationOptions = GenerationOptions.new) : Generation
- #load(path : String) : Nil
- #reset : Nil
-
#restore(value : SessionSnapshot) : Nil
Restores canonical text only after every compatibility check succeeds.
- #save(path : String) : Nil
- #snapshot : SessionSnapshot
- #to_unsafe
- #used_tokens : Int32
Constructor Detail
Instance Method Detail
def generate(prompt : String, options : GenerationOptions = GenerationOptions.new, &block : GenerationChunk -> ) : Generation
#
def restore(value : SessionSnapshot) : Nil
#
Restores canonical text only after every compatibility check succeeds. The next generation rebuilds native KV state through checked decode.