Skip to content

IHistoryTransform

Namespace: LLama.Abstractions

Transform history to plain text and vice versa.

public interface IHistoryTransform

Methods

HistoryToText(ChatHistory)

Convert a ChatHistory instance to plain text.

string HistoryToText(ChatHistory history)

Parameters

history ChatHistory
The ChatHistory instance

Returns

String

TextToHistory(AuthorRole, String)

Converts plain text to a ChatHistory instance.

ChatHistory TextToHistory(AuthorRole role, string text)

Parameters

role AuthorRole
The role for the author.

text String
The chat history as plain text.

Returns

ChatHistory
The updated history.