LLMMessage#

class council.llm.LLMMessage(role: LLMMessageRole, content: str, name: str | None = None)[source]#

Bases: object

Represents chat messages. Used in the payload

Parameters:
  • role (LLMMessageRole) – the role/persona the message is coming from. Could be either user, system or assistant

  • content (str) – the message content

__init__(role: LLMMessageRole, content: str, name: str | None = None)[source]#

Initialize a new instance

static assistant_message(content: str, name: str | None = None) LLMMessage[source]#

Create a new assistant message

Parameters:
  • content (str) – the message content

  • name (str) – name of the author of this message

property content: str#

Retrieve the content of this instance

static from_chat_message(chat_message: ChatMessage) LLMMessage | None[source]#

Convert ChatMessage into LLMMessage

is_of_role(role: LLMMessageRole) bool[source]#

Check the role of this instance

property name: str | None#

Retrieve the name authoring the content of this instance

property role: LLMMessageRole#

Retrieve the role of this instance

static system_message(content: str, name: str | None = None) LLMMessage[source]#

Create a new system message

Parameters:
  • content (str) – the message content

  • name (str) – name of the author of this message

static user_message(content: str, name: str | None = None) LLMMessage[source]#

Create a new user message

Parameters:
  • content (str) – the message content

  • name (str) – name of the author of this message