add

The add function from the History class is used to supplement the history. It adds a new block to the message history.

Properties:

  • role — the role from which the message is written:

    • system — AI behavior rules.

    • assistant — Cloude AI.

    • user — message from your side.

  • content — the text of the message.

Example usage:

from litegpt.lib import History

# Creating a history object and adding a new block
history = History()
history.add("system", "system options here!")
print(history)

Thus, the add function allows for easy addition of new elements to the history.

Last updated