chatflock.base¶
Module Contents¶
- chatflock.base.TOutputSchema¶
- class chatflock.base.ChatParticipant(name)¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- Parameters:
name (str)
- on_new_chat_message(chat, message)¶
- Parameters:
chat (Chat)
message (ChatMessage)
- Return type:
None
- on_participant_joined_chat(chat, participant)¶
- Parameters:
chat (Chat)
participant (ChatParticipant)
- Return type:
None
- on_participant_left_chat(chat, participant)¶
- Parameters:
chat (Chat)
participant (ChatParticipant)
- Return type:
None
- class chatflock.base.ActiveChatParticipant(name, symbol='👤', messages_hidden=False)¶
Bases:
ChatParticipantHelper class that provides a standard way to create an ABC using inheritance.
- class chatflock.base.ChatMessage¶
Bases:
pydantic.BaseModel- timestamp: datetime.datetime¶
- class chatflock.base.ChatConductor¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstract select_next_speaker(chat)¶
- Parameters:
chat (Chat)
- Return type:
Optional[ActiveChatParticipant]
- initiate_dialog(chat, initial_message=None, from_participant=None, **kwargs)¶
- Parameters:
chat (Chat)
initial_message (Optional[str])
from_participant (Optional[ChatParticipant])
kwargs (Any)
- Return type:
- class chatflock.base.ChatDataBackingStore¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstract get_messages()¶
- Return type:
List[ChatMessage]
- abstract add_message(sender_name, content, timestamp=None)¶
- Parameters:
sender_name (str)
content (str)
timestamp (Optional[datetime.datetime])
- Return type:
- abstract clear_messages()¶
- Return type:
None
- abstract get_active_participants()¶
- Return type:
List[ActiveChatParticipant]
- abstract get_non_active_participants()¶
- Return type:
List[ChatParticipant]
- abstract get_active_participant_by_name(name)¶
- Parameters:
name (str)
- Return type:
Optional[ActiveChatParticipant]
- abstract get_non_active_participant_by_name(name)¶
- Parameters:
name (str)
- Return type:
Optional[ChatParticipant]
- abstract add_participant(participant)¶
- Parameters:
participant (ChatParticipant)
- Return type:
None
- abstract remove_participant(participant)¶
- Parameters:
participant (ChatParticipant)
- Return type:
None
- abstract has_active_participant_with_name(participant_name)¶
- class chatflock.base.ChatRenderer¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstract render_new_chat_message(chat, message)¶
- Parameters:
chat (Chat)
message (ChatMessage)
- Return type:
None
- class chatflock.base.GeneratedChatComposition¶
- participants: Sequence[ChatParticipant]¶
- class chatflock.base.ChatCompositionGenerator¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- class chatflock.base.Chat(backing_store, renderer, initial_participants=None, name=None, max_total_messages=None, hide_messages=False)¶
- Parameters:
backing_store (ChatDataBackingStore)
renderer (ChatRenderer)
initial_participants (Optional[Sequence[ChatParticipant]])
name (Optional[str])
max_total_messages (Optional[int])
hide_messages (bool)
- backing_store: ChatDataBackingStore¶
- renderer: ChatRenderer¶
- add_participant(participant)¶
- Parameters:
participant (ChatParticipant)
- Return type:
None
- remove_participant(participant)¶
- Parameters:
participant (ChatParticipant)
- Return type:
None
- get_messages()¶
- Return type:
List[ChatMessage]
- clear_messages()¶
- get_active_participants()¶
- Return type:
List[ActiveChatParticipant]
- get_non_active_participants()¶
- Return type:
List[ChatParticipant]
- get_active_participant_by_name(name)¶
- Parameters:
name (str)
- Return type:
Optional[ActiveChatParticipant]
- get_non_active_participant_by_name(name)¶
- Parameters:
name (str)
- Return type:
Optional[ChatParticipant]
- has_active_participant_with_name(participant_name)¶
- has_non_active_participant_with_name(participant_name)¶
- property active_participants_str¶