History

Module to hold structures related to the history functionality.

class HistoryEntry(question='', response='', chat_name='', created_at='')[source]

Represents a single history item with query and response

Constructor of class.

Parameters:
  • question (Str) – The user question

  • response (Str) – The llm response

  • chat_name (Str) – The name of the chat associated with the question

  • created_at (Str) – When the record was created.

_abc_impl = <_abc._abc_data object>
property chat_name: str

Property for internal chat_name attribute.

Returns:

The value of chat_name

Return type:

Str

property created_at: str

Property for internal created_at attribute.

Returns:

The value of created_at

Return type:

Str

property question: str

Property for internal question attribute.

Returns:

The value of question

Return type:

Str

property response: str

Property for internal response attribute.

Returns:

The value of response

Return type:

Str

class HistoryList(histories=None)[source]

Represents history entries

Constructor of the class.

Parameters:

histories (Optional[List[HistoryEntry]], optional) – A list of HistoryEntry to hold.

_abc_impl = <_abc._abc_data object>
property histories: List[HistoryEntry]

Property for internal entries attribute.

Returns:

List of history items contained in the user history.

Return type:

List[HistoryEntry]