conversations package
Submodules
conversations.conversation module
This module contains the Conversation class
- class conversations.conversation.Conversation(*, conversation_topic: str, key: str, llm_model: BaseLLMModel, is_summarized: bool | None = False)[source]
Bases:
BaseModelThis class is used to store the information for a conversation
- class Config[source]
Bases:
objectThis class is used to configure the pydantic model
- arbitrary_types_allowed = True
- conversation_topic: str
- is_summarized: bool | None
- key: str
- llm_model: BaseLLMModel
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'conversation_topic': FieldInfo(annotation=str, required=True, description='The conversation topic'), 'is_summarized': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False, description='Whether the conversation is summarized or not'), 'key': FieldInfo(annotation=str, required=True, description='The key of the model'), 'llm_model': FieldInfo(annotation=BaseLLMModel, required=True, description='The model used in the conversation')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
conversations.group_conversation module
- class conversations.group_conversation.GroupConversation(*, conversation_topic: str | None = None, messages: list[GroupMessage] = None, group_agent: GroupAgent, final_artifact: str = None, done: bool = False)[source]
Bases:
BaseModelThis class is used to store the group conversation
- class Config[source]
Bases:
objectThis class is used to configure the pydantic model
- arbitrary_types_allowed = True
- add_message(message: GroupMessage) None[source]
Adds a message to the conversation
- Parameters:
message – The message to add
- conversation_topic: str | None
- done: bool
- final_artifact: str
- get_messages() list[GroupMessage][source]
Gets the messages
- Returns:
The messages
- group_agent: GroupAgent
- messages: list[GroupMessage]
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'conversation_topic': FieldInfo(annotation=Union[str, NoneType], required=False, description='The conversation topic'), 'done': FieldInfo(annotation=bool, required=False, default=False, alias_priority=2, validation_alias='Done', description='The done flag'), 'final_artifact': FieldInfo(annotation=str, required=False, description='The final artifact'), 'group_agent': FieldInfo(annotation=GroupAgent, required=True, description='The group agent'), 'messages': FieldInfo(annotation=list[GroupMessage], required=False, default_factory=list, description='The messages in the conversation')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.