Skip to content

IHistoryTransform

Namespace: LLama.Abstractions

Transform history to plain text and vice versa.

1
public interface IHistoryTransform

Methods

HistoryToText(ChatHistory)

Convert a ChatHistory instance to plain text.

1
string HistoryToText(ChatHistory history)

Parameters

history ChatHistory
The ChatHistory instance

Returns

String

TextToHistory(AuthorRole, String)

Converts plain text to a ChatHistory instance.

1
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.

Clone()

Copy the transform.

1
IHistoryTransform Clone()

Returns

IHistoryTransform