API reference · Kjarni 0.2.7
Class ChatConversation
Namespace: Kjarni
Assembly: Kjarni.dll
Stateful conversation that maintains chat history automatically. The parent Chat must outlive this object.
public class ChatConversation : IDisposable
Inheritance
Implements
Properties
Length
Number of messages in history.
public int Length { get; }
Property Value
Methods
Clear(bool)
Clear conversation history.
public void Clear(bool keepSystem = true)
Parameters
keepSystem bool
Dispose()
Releases the conversation and its history. The object cannot be used afterwards.
public void Dispose()
Send(string)
Send a message and get the response. Both are added to history.
public string Send(string message)
Parameters
message string
Returns
Send(string, GenerationConfig)
Send with custom generation config.
public string Send(string message, GenerationConfig config)
Parameters
message string
config GenerationConfig
Returns
Stream(string, Func<string, bool>)
Stream a response. Message and full response are added to history.
public void Stream(string message, Func<string, bool> onToken)
Parameters
message string
Kjarni runs the same engine on every platform: