enrobie.plugins.logger package#
Submodules#
enrobie.plugins.logger.history module#
- class enrobie.plugins.logger.history.SQLBase(**kwargs: Any)[source]#
Bases:
DeclarativeBaseSome additional class that SQLAlchemy requires to work.
- class enrobie.plugins.logger.history.LoggerHistoryTable(**kwargs)[source]#
Bases:
SQLBaseSchematic for the database operations using SQLAlchemy.
Note
Fields are not completely documented for this model.
- plugin#
- client#
- person#
- kind#
- author#
- anchor#
- message#
- create#
- class enrobie.plugins.logger.history.LoggerHistoryRecord[source]#
Bases:
BaseModelContain the information regarding the chatting history.
- Parameters:
record – Record from the SQLAlchemy query routine.
kwargs – Keyword arguments passed for downstream.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
Yes
min_length=1
Yes
min_length=1
Yes
min_length=20, max_length=32
Literal[‘privmsg’, ‘chanmsg’]Yes
min_length=1
Yes
No
Nonemin_length=1
Yes
min_length=1
- plugin: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Plugin name where originated', metadata=[MinLen(min_length=1)])]#
- client: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Client name where originated', metadata=[MinLen(min_length=1)])]#
- person: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Person that author is matched', metadata=[MinLen(min_length=1)])]#
- kind: Annotated[Literal['privmsg', 'chanmsg'], FieldInfo(annotation=NoneType, required=True, description='What kind of original message', metadata=[MinLen(min_length=1)])]#
- author: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Nickname of message author', metadata=[MinLen(min_length=1)])]#
- anchor: Annotated[str, FieldInfo(annotation=NoneType, required=False, default=None, description='Channel or private context', metadata=[MinLen(min_length=1)])]#
- class enrobie.plugins.logger.history.LoggerHistory(plugin: LoggerPlugin)[source]#
Bases:
objectStore the historical information for chat interactions.
- Parameters:
plugin – Plugin class instance for Chatting Robie.
- insert(*, client: str, person: str | None, kind: str, author: str, anchor: str, message: str) None[source]#
Insert the record into the historical chat interactions.
- process(mitem: RobieMessage) None[source]#
Insert the record into the historical chat interactions.
- Parameters:
mitem – Item containing information for operation.
- expunge(client: str, kind: str, anchor: str) None[source]#
Remove the expired historical chat interaction records.
- Parameters:
client – Unique identifier for the client object.
kind – What kind of Robie message we dealing with.
anchor – Unique identifier for the chat context.
- records(mitem: RobieMessage, limit: int | None = None) list[LoggerHistoryRecord][source]#
Return the historical records for the chat interactions.
- Parameters:
mitem – Item containing information for operation.
limit – Optionally restrict the records returned.
- Returns:
Historical records for the chat interactions.
- plaintext(limit: int | None = None, mitem: RobieMessage | None = None, *, client: str | None = None, person: str | None = None, kind: str | None = None, author: str | None = None, anchor: str | None = None) list[str][source]#
Return the historical records for the chat interactions.
Note
Additional keyword arguments ignored when mitem.
- Parameters:
limit – Optionally restrict the records returned.
mitem – Item containing information for operation.
- Returns:
Historical records for the chat interactions.
- search(limit: int | None = None, *, client: str | None = None, person: str | None = None, kind: str | None = None, author: str | None = None, anchor: str | None = None) list[LoggerHistoryRecord][source]#
Return the historical records for the chat interactions.
- Parameters:
limit – Optionally restrict the records returned.
- Returns:
Historical records for the chat interactions.
enrobie.plugins.logger.params module#
- class enrobie.plugins.logger.params.LoggerPluginParams[source]#
Bases:
RobiePluginParamsProcess and validate the Robie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
No
'sqlite:///:memory:'min_length=1
enableNo
FalseNo
100ge=1, le=10000
locateNo
Nonemin_length=1
No
Nonemin_length=4
No
factory
trustedNo
Nonemin_length=1
- database: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='sqlite:///:memory:', description='Database connection string', metadata=[MinLen(min_length=1)])]#
- histories: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=100, description='Number of messages per anchor', metadata=[Ge(ge=1), Le(le=10000)])]#
- clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
- output: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Optional path where logs append', metadata=[MinLen(min_length=4)])]#
- status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
enrobie.plugins.logger.plugin module#
- class enrobie.plugins.logger.plugin.LoggerPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#
Bases:
RobiePluginIntegrate with the Robie routine and perform operations.
Note
This plugin allows for interacting with an LLM model.
- classmethod schema() Type[LoggerPluginParams][source]#
Return the configuration parameters relevant for class.
- Returns:
Configuration parameters relevant for class.
- property params: LoggerPluginParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property history: LoggerHistory#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
Module contents#
- class enrobie.plugins.logger.LoggerPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#
Bases:
RobiePluginIntegrate with the Robie routine and perform operations.
Note
This plugin allows for interacting with an LLM model.
- classmethod schema() Type[LoggerPluginParams][source]#
Return the configuration parameters relevant for class.
- Returns:
Configuration parameters relevant for class.
- property params: LoggerPluginParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property history: LoggerHistory#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- class enrobie.plugins.logger.LoggerPluginParams[source]#
Bases:
RobiePluginParamsProcess and validate the Robie configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
No
'sqlite:///:memory:'min_length=1
enableNo
FalseNo
100ge=1, le=10000
locateNo
Nonemin_length=1
No
Nonemin_length=4
No
factory
trustedNo
Nonemin_length=1
- database: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='sqlite:///:memory:', description='Database connection string', metadata=[MinLen(min_length=1)])]#
- histories: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=100, description='Number of messages per anchor', metadata=[Ge(ge=1), Le(le=10000)])]#
- clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
- output: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Optional path where logs append', metadata=[MinLen(min_length=4)])]#
- status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#