Enasis Network Chatting Robie#

Documentation Welcome#

Welcome to the project documentation. Below you will find the most common functions and classes within the library, but you may click your way further into the project from there. You can also view the source code.

Robie#

class enrobie.robie.Robie(config: RobieConfig)[source]#

Bases: object

Interact with chat networks and integrate using plugins.

Parameters:

config – Primary class instance for configuration.

property config: RobieConfig#

Return the Config instance containing the configuration.

Returns:

Config instance containing the configuration.

property logger: RobieLogger#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property jinja2: RobieJinja2#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property childs: RobieChilds#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: RobieParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property console: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property debug: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

printer(source: RobiePrint, color: int = 6) None[source]#

Print the contents for the object within Robie instance.

Parameters:
  • source – Content which will be shown after header.

  • color – Override the color used for box character.

register(name: str, *, client: Type[RobieClient] | None = None, plugin: Type[RobiePlugin] | None = None) None[source]#

Register the plugin with the internal operation routine.

Parameters:
  • name – Name of the object within the Robie config.

  • client – Class definition for the instantiation.

  • plugin – Class definition for the instantiation.

register_locate() None[source]#

Register the plugin with the internal operation routine.

person(client: RobieClient, check: str) RobiePerson | None[source]#

Return the heaviest weighted match using provided check.

Parameters:
  • client – Client class instance for Chatting Robie.

  • check – Value to be searched within the haystack.

Returns:

Heaviest weighted match using provided check.

j2parse(value: Any, statics: dict[str, Any] | None = None, literal: bool = True) Any[source]#

Return the provided input using the Jinja2 environment.

Parameters:
  • value – Input that will be processed and returned.

  • statics – Additional values available for parsing.

  • literal – Determine if Python objects are evaled.

Returns:

Provided input using the Jinja2 environment.

class enrobie.robie.RobieConfig(sargs: dict[str, Any] | None = None, files: str | Path | list[str | Path] | list[str] | list[Path] | tuple[str | Path, ...] | set[str] | None = None, cargs: dict[str, Any] | None = None)[source]#

Bases: Config

Contain the configurations from the arguments and files.

Parameters:
  • sargs – Additional arguments on the command line.

  • files – Complete or relative path to config files.

  • cargs – Configuration arguments in dictionary form, which will override contents from the config files.

property inserts: dict[Literal['clients', 'plugins'], dict[str, Any]]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: RobieParams#

Return the Pydantic model containing the configuration.

Warning

This method completely overrides the parent but is based on that code, would be unfortunate if upstream changes meant this breaks or breaks something else.

Returns:

Pydantic model containing the configuration.

merge_params() None[source]#

Update the Pydantic model containing the configuration.

property config: dict[str, Any]#

Return the configuration dumped from the Pydantic model.

Warning

This method completely overrides the parent but is based on that code, would be unfortunate if upstream changes meant this breaks or breaks something else.

Returns:

Configuration dumped from the Pydantic model.

register(name: str, *, client: Type[RobieClientParams] | None = None, plugin: Type[RobiePluginParams] | None = None, source: dict[str, Any] | None = None, merge: bool = True) None[source]#

Register the plugin parameters for parameter processing.

Parameters:
  • name – Name of the object within the Robie config.

  • client – Class definition for the instantiation.

  • plugin – Class definition for the instantiation.

  • source – Source for the parameters instantiation.

  • merge – Reprocess all parameters including added.

register_locate() None[source]#

Register the plugin parameters for parameter processing.

class enrobie.robie.RobieService(robie: Robie)[source]#

Bases: object

Multi-threaded service for processing the desired state.

Parameters:

robie – Primary class instance for Chatting Robie.

property robie: Robie#

Return the Robie instance to which the instance belongs.

Returns:

Robie instance to which the instance belongs.

property params: RobieServiceParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property clients: RobieClients#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property plugins: RobiePlugins#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property running: list[str]#

Return the list of threads which are determined running.

Returns:

List of threads which are determined running.

property zombies: list[str]#

Return the list of threads which are determined zombies.

Returns:

List of threads which are determined zombies.

property congest: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

property enqueue: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

start() None[source]#

Start the various threads within the Robie class object.

operate() None[source]#

Perform the operation related to Robie service members.

operate_clients() None[source]#

Perform the operation related to Robie service members.

operate_plugins() None[source]#

Perform the operation related to Robie service members.

operate_healths() None[source]#

Perform the operation related to Robie service members.

check_zombies() bool[source]#

Return the boolean indicating while threads are zombies.

Returns:

Boolean indicating while threads are zombies.

check_congest() bool[source]#

Return the boolean indicating when queues are congested.

Returns:

Boolean indicating when queues are congested.

soft(*args: Any, **kwargs: Any) None[source]#

Stop the various threads within the Robie class object.

Parameters:
  • kwargs – Keyword arguments ignored by the method.

  • args – Positional arguments ignored by the method.

stop(*args: Any, **kwargs: Any) None[source]#

Stop the various threads within the Robie class object.

Parameters:
  • kwargs – Keyword arguments ignored by the method.

  • args – Positional arguments ignored by the method.

limit(clients: list[str] | None = None, plugins: list[str] | None = None) None[source]#

Remove the threads from members if not already started.

Parameters:
  • clients – Names of the clients that are permitted.

  • plugins – Names of the plugins that are permitted.

Robie Parameters#

class enrobie.robie.params.RobieParams[source]#

Bases: Params

Process and validate the core configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

dict[str, RobieClientParams] | None

No

None

min_length=1

console

bool

No

False

database

str

No

'sqlite:///:memory:'

min_length=1

debug

bool

No

False

enconfig

ConfigParams | None

No

None

encrypts

CryptsParams | None

No

None

enlogger

LoggerParams | None

No

None

persons

dict[str, RobiePersonParams] | None

No

None

min_length=1

plugins

dict[str, RobiePluginParams] | None

No

None

min_length=1

printer

RobiePrinterParams

No

factory

service

RobieServiceParams

No

factory

database: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='sqlite:///:memory:', description='Database connection string', metadata=[MinLen(min_length=1)])]#
console: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Output console information; parameter is parsed by and used in low-level config')]#
debug: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Enable logging level debug; parameter is parsed by and used in low-level config')]#
printer: Annotated[RobiePrinterParams, FieldInfo(annotation=NoneType, required=False, default_factory=RobiePrinterParams, description='Print messages to console')]#
service: Annotated[RobieServiceParams, FieldInfo(annotation=NoneType, required=False, default_factory=RobieServiceParams, description='Parameters for Robie Service')]#
clients: Annotated[dict[str, RobieClientParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Robie clients', metadata=[MinLen(min_length=1)])]#
plugins: Annotated[dict[str, RobiePluginParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Robie plugins', metadata=[MinLen(min_length=1)])]#
persons: Annotated[dict[str, RobiePersonParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Parameters for Robie persons', metadata=[MinLen(min_length=1)])]#
class enrobie.robie.params.RobiePrinterParams[source]#

Bases: RobieParamsModel

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

command

bool

No

False

message

bool

No

False

message: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the messages to console')]#
command: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=False, description='Print the commands to console')]#
class enrobie.robie.params.RobiePluginParams[source]#

Bases: RobieChildParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

enable

bool

No

False

locate

str | None

No

None

min_length=1

trusted

list[str] | None

No

None

min_length=1

locate: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='For which plugin are parameters', examples=['enrobie.plugins.AinswerPlugin', 'enrobie.plugins.AutoJoinPlugin', 'enrobie.plugins.AutoNickPlugin', 'enrobie.plugins.StatusPlugin'], metadata=[MinLen(min_length=1)])]#
trusted: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Users are trusted by the plugin', metadata=[MinLen(min_length=1)])]#
class enrobie.robie.params.RobieClientParams[source]#

Bases: RobieChildParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

enable

bool

No

False

locate

str | None

No

None

min_length=1

locate: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='For which client are parameters', examples=['enrobie.clients.DSCClient', 'enrobie.clients.IRCClient', 'enrobie.clients.MTMClient'], metadata=[MinLen(min_length=1)])]#
class enrobie.robie.params.RobiePersonParams[source]#

Bases: RobieChildParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

about

str | None

No

None

min_length=1

enable

bool

No

False

first

str | None

No

None

min_length=1

last

str | None

No

None

min_length=1

matches

list[RobiePersonMatchParams]

Yes

weight

int

No

50

ge=1, le=100

first: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Additional optional information', metadata=[MinLen(min_length=1)])]#
last: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Additional optional information', metadata=[MinLen(min_length=1)])]#
about: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Additional optional information', metadata=[MinLen(min_length=1)])]#
matches: Annotated[list[RobiePersonMatchParams], FieldInfo(annotation=NoneType, required=True, description='How the user will be identified')]#
weight: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=50, description='Determine order of precedence', metadata=[Ge(ge=1), Le(le=100)])]#
class enrobie.robie.params.RobieServiceParams[source]#

Bases: RobieParamsModel

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

respite

RobieServiceRespiteParams

No

factory

respite: Annotated[RobieServiceRespiteParams, FieldInfo(annotation=NoneType, required=False, default_factory=RobieServiceRespiteParams, description='When operates are performed')]#

Robie Children#

class enrobie.robie.childs.RobieChild(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: object

Parent object for child objects within the project base.

Parameters:
  • robie – Primary class instance for Chatting Robie.

  • name – Name of the object within the Robie config.

  • params – Parameters used to instantiate the class.

validate() None[source]#

Perform advanced validation on the parameters provided.

property robie: Robie#

Return the Robie instance to which the instance belongs.

Returns:

Robie instance to which the instance belongs.

property enable: bool#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property name: str#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kind: RobieKinds#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: RobieChildParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

class enrobie.robie.childs.RobieChilds(robie: Robie)[source]#

Bases: object

Contain the object instances for related Robie children.

Parameters:

robie – Primary class instance for Chatting Robie.

build_objects() None[source]#

Construct instances using the configuration parameters.

validate() None[source]#

Perform advanced validation on the parameters provided.

property clients: dict[str, RobieClient]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property plugins: dict[str, RobiePlugin]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property persons: dict[str, RobiePerson]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

register(name: str, *, client: Type[RobieClient] | None = None, plugin: Type[RobiePlugin] | None = None) None[source]#

Register the plugin with the internal operation routine.

Parameters:
  • name – Name of the object within the Robie config.

  • client – Class definition for the instantiation.

  • plugin – Class definition for the instantiation.

class enrobie.robie.childs.RobieClient(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobieChild

Establish and maintain connection with the chat service.

property family: str#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property kind: Literal['client']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property channels: ClientChannels#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

classmethod schema() Type[RobieClientParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: RobieClientParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property thread: RobieClientThread | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property dumped: dict[str, Any]#

Return the facts about the attributes from the instance.

Returns:

Facts about the attributes from the instance.

operate() None[source]#

Perform the operation related to Robie service threads.

Note

Deviates from enhomie in children have operations, and are more isolated from internal core routines.

get_message() RobieMessage[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

put_message(mqueue: RobieQueue[RobieMessage]) None[source]#

Insert the new item containing information for operation.

Parameters:

mqueue – Queue instance where the item is received.

get_command() RobieCommand[source]#

Return the new item containing information for operation.

Returns:

New item containing information for operation.

put_command(cqueue: RobieQueue[RobieCommand]) None[source]#

Insert the new item containing information for operation.

Parameters:

cqueue – Queue instance where the item is received.

compose(target: str, content: str) RobieCommand[source]#

Compose the message and transmit using the chat client.

Parameters:
  • target – Where the composed message will be sent.

  • content – Content that will be source of message.

class enrobie.robie.childs.RobiePlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobieChild

Integrate with the Robie routine and perform operations.

property kind: Literal['plugin']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

classmethod schema() Type[RobiePluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: RobiePluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property thread: RobiePluginThread | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

Note

Deviates from enhomie in children have operations, and are more isolated from internal core routines.

trusted(check: str | RobiePerson | RobieMessage) bool[source]#

Return the boolean indicating whether person is trusted.

Parameters:

check – Validate the person is trusted by plugin.

Returns:

Boolean indicating whether person is trusted.

notrust(check: str | RobiePerson | RobieMessage) bool[source]#

Return the boolean indicating whether person is trusted.

Parameters:

check – Validate the person is trusted by plugin.

Returns:

Boolean indicating whether person is trusted.

class enrobie.robie.childs.RobiePerson(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobieChild

Contain the properties regarding the actual user person.

validate() None[source]#

Perform advanced validation on the parameters provided.

property kind: Literal['person']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: RobiePersonParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property first: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property last: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property about: str | None#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property weight: int#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

match(client: RobieClient, check: str) bool[source]#

Return the boolean indicating whether check is a match.

Parameters:
  • client – Client class instance for Chatting Robie.

  • check – Value to be searched within the haystack.

Returns:

Boolean indicating whether check is a match.

Robie Add-ons#

class enrobie.robie.addons.RobieLogger(robie: Robie)[source]#

Bases: object

Methods for extending use of underlying logging library.

Parameters:

robie – Primary class instance for Chatting Robie.

start() None[source]#

Initialize the Python logging library using parameters.

stop() None[source]#

Deinitialize the Python logging library using parameters.

log(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log().

Parameters:

kwargs – Keyword arguments for populating message.

log_c(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_c().

Parameters:

kwargs – Keyword arguments for populating message.

log_d(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_d().

Parameters:

kwargs – Keyword arguments for populating message.

log_e(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_e().

Parameters:

kwargs – Keyword arguments for populating message.

log_i(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_i().

Parameters:

kwargs – Keyword arguments for populating message.

log_w(**kwargs: Any) None[source]#

Pass the provided keyword arguments into logger object.

Note

Uses method encommon.config.Logger.log_w().

Parameters:

kwargs – Keyword arguments for populating message.

class enrobie.robie.addons.RobieJinja2(robie: Robie)[source]#

Bases: Jinja2

Parse the provided input and intelligently return value.

Parameters:

robie – Primary class instance for Chatting Robie.

class enrobie.robie.addons.RobieQueue(robie: Robie, size: int = 10000)[source]#

Bases: Generic[RobieQueueItemType]

Queue object that will allow to handle full conditions.

Parameters:
  • robie – Primary class instance for Chatting Robie.

  • size – Maximum size for the created queue object.

property empty: bool#

Return the boolean indicating whether the queue is full.

Returns:

Boolean indicating whether the queue is full.

property qsize: int#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

put(item: RobieQueueItemType) None[source]#

Store the provided item within the queue class instance.

Parameters:

item – Item containing information for operation.

get() RobieQueueItemType[source]#

Return the next item within the queue in blocking mode.

Returns:

Next item within the queue in blocking mode.

class enrobie.robie.addons.RobieQueueItem[source]#

Bases: object

Contain information for sharing using the Python queue.

time: Time#

Robie Members#

class enrobie.robie.members.RobieMember(service: RobieService)[source]#

Bases: object

Common methods and routines for Chatting Robie members.

Parameters:

robie – Primary class instance for Chatting Robie.

build_threads() None[source]#

Construct instances using the configuration parameters.

Note

Deviates from enhomie in build happens downstream, because all of the enhomie members are origin based where enrobie children do not have consistent base.

limit(names: list[str]) None[source]#

Remove the thread from member when not already started.

Note

Deviates from enhomie in build happens downstream, because all of the enhomie members are origin based where enrobie children do not have consistent base.

Parameters:

names – Names of the children that are permitted.

property robie: Robie#

Return the Robie instance to which the instance belongs.

Returns:

Robie instance to which the instance belongs.

property service: RobieService#

Return the Robie instance to which the instance belongs.

Returns:

Robie instance to which the instance belongs.

property threads: dict[str, RobieThread]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property mqueue: RobieQueue[RobieMessage]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property cqueue: RobieQueue[RobieCommand]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property vacate: Event#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property cancel: Event#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property running: list[str]#

Return the list of threads which are determined running.

Returns:

List of threads which are determined running.

property zombies: list[str]#

Return the list of threads which are determined zombies.

Returns:

List of threads which are determined zombies.

property congest: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

property enqueue: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

start() None[source]#

Start the various threads within the Robie class object.

operate() None[source]#

Perform the operation related to Robie service members.

soft() None[source]#

Stop the various threads within the Robie class object.

stop() None[source]#

Stop the various threads within the Robie class object.

class enrobie.robie.members.RobieClients(service: RobieService)[source]#

Bases: RobieMember

Common methods and routines for Chatting Robie members.

property childs: dict[str, RobieClient]#

Return the value for the attribute from class instance.

Note

Deviates from enhomie in build happens downstream, because all of the enhomie members are origin based where enrobie children do not have consistent base.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service members.

build_threads() None[source]#

Construct instances using the configuration parameters.

Note

Deviates from enhomie in build happens downstream, because all of the enhomie members are origin based where enrobie children do not have consistent base.

class enrobie.robie.members.RobiePlugins(service: RobieService)[source]#

Bases: RobieMember

Common methods and routines for Chatting Robie members.

property childs: dict[str, RobiePlugin]#

Return the value for the attribute from class instance.

Note

Deviates from enhomie in build happens downstream, because all of the enhomie members are origin based where enrobie children do not have consistent base.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service members.

build_threads() None[source]#

Construct instances using the configuration parameters.

Note

Deviates from enhomie in build happens downstream, because all of the enhomie members are origin based where enrobie children do not have consistent base.

Robie Threads#

class enrobie.robie.threads.RobieThread(member: RobieMember, child: RobieOperate)[source]#

Bases: Thread

Common methods and routines for Chatting Robie threads.

Parameters:
  • member – Child class instance for Chatting Robie.

  • child – Child class instance for Chatting Robie.

property robie: Robie#

Return the Robie instance to which the instance belongs.

Returns:

Robie instance to which the instance belongs.

property service: RobieService#

Return the Robie instance to which the instance belongs.

Returns:

Robie instance to which the instance belongs.

property member: RobieMember#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property child: RobieOperate#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property mqueue: RobieQueue[RobieMessage]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property cqueue: RobieQueue[RobieCommand]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

expired(item: RobieMessage | RobieCommand) bool[source]#

Return the boolean indicating whether the item expired.

Parameters:

item – Item containing information for operation.

Returns:

Boolean indicating whether the item expired.

property congest: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

property enqueue: list[tuple[str, int]]#

Return the list of congested threads and members queues.

Returns:

List of congested threads and members queues.

run() None[source]#

Perform whatever operation is associated with the class.

operate() None[source]#

Perform the operation related to Robie service threads.

stop() None[source]#

Wait for the thread object to complete routine and exit.

class enrobie.robie.threads.RobieClientThread(member: RobieMember, child: RobieOperate)[source]#

Bases: RobieThread

Common methods and routines for Chatting Robie threads.

property member: RobieClients#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property child: RobieClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property client: RobieClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

class enrobie.robie.threads.RobiePluginThread(member: RobieMember, child: RobieOperate)[source]#

Bases: RobieThread

Common methods and routines for Chatting Robie threads.

property member: RobiePlugins#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property child: RobiePlugin#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property plugin: RobiePlugin#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

Robie Plugins#

class enrobie.plugins.AutoJoinPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin maintains joined for configured channels.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[AutoJoinPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: AutoJoinPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

operate() None[source]#

Perform the operation related to Robie service threads.

class enrobie.plugins.AutoJoinPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

channels

list[AutoJoinPluginChannelParams]

Yes

min_length=1

enable

bool

No

False

interval

int

No

5

ge=5, le=300

locate

str | None

No

None

min_length=1

status

StatusPluginIconParams

No

factory

trusted

list[str] | None

No

None

min_length=1

channels: Annotated[list[AutoJoinPluginChannelParams], FieldInfo(annotation=NoneType, required=True, description='Which channels to maintain join', metadata=[MinLen(min_length=1)])]#
interval: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=5, description='Interval when channels are joined', metadata=[Ge(ge=5), Le(le=300)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.plugins.AutoNickPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin maintains configured nickname on server.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[AutoNickPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: AutoNickPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

operate() None[source]#

Perform the operation related to Robie service threads.

class enrobie.plugins.AutoNickPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

enable

bool

No

False

interval

int

No

5

ge=5, le=300

locate

str | None

No

None

min_length=1

services

list[AutoNickPluginServiceParams] | None

No

None

status

StatusPluginIconParams

No

factory

trusted

list[str] | None

No

None

min_length=1

clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
interval: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=5, description='Interval when nick is validated', metadata=[Ge(ge=5), Le(le=300)])]#
services: Annotated[list[AutoNickPluginServiceParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='How to identify with services')]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.plugins.AinswerPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for interacting with an LLM model.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[AinswerPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: AinswerPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property models: AinswerModels#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property toolset: AinswerToolset#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property question: AinswerQuestion#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property history: AinswerHistory#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property memory: AinswerMemory#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property agent: Agent[AinswerDepends, str]#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

ainswer(mitem: RobieMessage, prompt: str, respond: Type[AinswerResponse]) str[source]#

Submit the question to the LLM and return the response.

Parameters:
  • mitem – Item containing information for operation.

  • prompt – Additional prompt insert before question.

  • respond – Model to describe the expected response.

Returns:

Response adhering to provided specifications.

printer(source: dict[str, Any], color: int = 6) None[source]#

Print the contents for the object within Robie instance.

Parameters:
  • source – Content which will be shown after header.

  • color – Override the color used for box character.

class enrobie.plugins.AinswerPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

ainswer

AinswerPluginAinswerParams

Yes

clients

list[str]

Yes

min_length=1

database

str

No

'sqlite:///:memory:'

min_length=1

enable

bool

No

False

histories

int

No

10

ge=1, le=1000

locate

str | None

No

None

min_length=1

logger

str | None

No

None

min_length=1

memories

int

No

10

ge=1, le=1000

plugins

list[str] | None

No

None

min_length=1

prompt

AinswerPluginPromptParams

No

factory

status

StatusPluginIconParams

No

factory

trusted

list[str] | None

No

None

min_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=10, description='Number of messages per anchor', metadata=[Ge(ge=1), Le(le=1000)])]#
memories: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=10, description='Number of messages per person', metadata=[Ge(ge=1), Le(le=1000)])]#
clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
ainswer: Annotated[AinswerPluginAinswerParams, FieldInfo(annotation=NoneType, required=True, description='Parameters for the AI platforms')]#
prompt: Annotated[AinswerPluginPromptParams, FieldInfo(annotation=NoneType, required=False, default_factory=AinswerPluginPromptParams, description='Override the agent system prompt')]#
plugins: Annotated[list[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='List of plugins to load tools', metadata=[MinLen(min_length=1)])]#
logger: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Logger for including recents', metadata=[MinLen(min_length=1)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.plugins.HomiePlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for connecting to Homie Automate.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[HomiePluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: HomiePluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property persist: HomiePersist#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

ainswer() list[Callable[[...], Any]][source]#

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

class enrobie.plugins.HomiePluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

command

HomiePluginCommandParams

No

factory

enable

bool

No

False

locate

str | None

No

None

min_length=1

password

str | None

No

None

min_length=1

restful

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

status

StatusPluginIconParams

No

factory

timeout

int

No

30

ge=1, le=300

trusted

list[str] | None

No

None

min_length=1

username

str | None

No

None

min_length=1

command: Annotated[HomiePluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=HomiePluginCommandParams, description='Command name per chat platform')]#
restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])]#
username: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.plugins.NagiosPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for connecting to Nagios Console.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[NagiosPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: NagiosPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property current: NagiosCurrent#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

ainswer() list[Callable[[...], Any]][source]#

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

class enrobie.plugins.NagiosPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

command

NagiosPluginCommandParams

No

factory

enable

bool

No

False

locate

str | None

No

None

min_length=1

password

str | None

No

None

min_length=1

restful

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

status

StatusPluginIconParams

No

factory

timeout

int

No

30

ge=1, le=300

trusted

list[str] | None

No

None

min_length=1

username

str | None

No

None

min_length=1

command: Annotated[NagiosPluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=NagiosPluginCommandParams, description='Command name per chat platform')]#
restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])]#
username: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.plugins.LoggerPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for interacting with an LLM model.

validate() None[source]#

Perform advanced validation on the parameters provided.

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.

operate() None[source]#

Perform the operation related to Robie service threads.

class enrobie.plugins.LoggerPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

database

str

No

'sqlite:///:memory:'

min_length=1

enable

bool

No

False

histories

int

No

100

ge=1, le=10000

locate

str | None

No

None

min_length=1

output

str | None

No

None

min_length=4

status

StatusPluginIconParams

No

factory

trusted

list[str] | None

No

None

min_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')]#
class enrobie.plugins.StatusPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin responds to inquiries about Robie status.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[StatusPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: StatusPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property status: StatusPluginItems#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

report() None[source]#

Perform the operation related to Robie service threads.

update(unique: str, group: str, title: str, icon: StatusPluginIconParams, state: Literal['pending', 'normal', 'failure', 'unknown']) None[source]#

Update or insert the status of the Robie child instance.

Parameters:
  • unique – Unique identifier to use for the status.

  • group – Name for the group the status is membered.

  • title – Friendly name of the related unique entry.

  • icon – Optional icon object if supported platform.

  • state – One of several possible value for status.

class enrobie.plugins.StatusPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

command

StatusPluginCommandParams

No

factory

enable

bool

No

False

icons

StatusPluginIconsParams

No

factory

locate

str | None

No

None

min_length=1

reports

list[StatusPluginReportParams] | None

No

None

min_length=1

trusted

list[str] | None

No

None

min_length=1

reports: Annotated[list[StatusPluginReportParams] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Where to send status updates', metadata=[MinLen(min_length=1)])]#
command: Annotated[StatusPluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginCommandParams, description='Command name per chat platform')]#
icons: Annotated[StatusPluginIconsParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconsParams, description='Icon used per the chat platform')]#
class enrobie.plugins.StatusPluginIconParams[source]#

Bases: RobieParamsModel

Contain information for constructing the chat messages.

Fields#

Field

Type

Required

Default

Constraints

dsc

str | None

No

None

min_length=1

irc

str | None

No

None

min_length=1

mtm

str | None

No

None

min_length=1

irc: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon used for the chat platform', metadata=[MinLen(min_length=1)])]#
dsc: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon used for the chat platform', metadata=[MinLen(min_length=1)])]#
mtm: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Icon used for the chat platform', metadata=[MinLen(min_length=1)])]#
class enrobie.plugins.StatusPluginItem(time: Time, unique: str, group: str, title: str, icon: StatusPluginIconParams, state: Literal['pending', 'normal', 'failure', 'unknown'])[source]#

Bases: object

Contain the relevant status information for the entry.

time: Time#
unique: str#
group: str#
title: str#
icon: StatusPluginIconParams#
state: Literal['pending', 'normal', 'failure', 'unknown']#

Robie Clients#

class enrobie.clients.IRCClient(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobieClient

Establish and maintain connection with the chat service.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[IRCClientParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: IRCClientParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property family: Literal['irc']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property channels: ClientChannels#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property publish: ClientPublish#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property client: Client#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

get_message(event: ClientEvent | None = None) IRCMessage[source]#

Return the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:

event – Raw event received from the network peer.

Returns:

New item containing information for operation.

put_message(mqueue: RobieQueue[RobieMessage], event: ClientEvent | None = None) None[source]#

Insert the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • mqueue – Queue instance where the item is received.

  • event – Raw event received from the network peer.

get_command(event: str | None = None) IRCCommand[source]#

Return the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:

event – Raw event to be sent to the network peer.

Returns:

New item containing information for operation.

put_command(cqueue: RobieQueue[RobieCommand], event: str | None = None) None[source]#

Insert the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • cqueue – Queue instance where the item is received.

  • event – Raw event to be sent to the network peer.

compose(target: str, content: str) RobieCommand[source]#

Compose the message and transmit using the chat client.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • target – Where the composed message will be sent.

  • content – Content that will be source of message.

class enrobie.clients.IRCClientParams[source]#

Bases: RobieClientParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

client

ClientParams

Yes

delay

int

No

15

ge=1, le=300

enable

bool

No

False

locate

str | None

No

None

min_length=1

status

StatusPluginIconParams

No

factory

client: Annotated[ClientParams, FieldInfo(annotation=NoneType, required=True, description='Parameters for the base client')]#
delay: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=15, description='Period to wait for reconnect', metadata=[Ge(ge=1), Le(le=300)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.clients.DSCClient(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobieClient

Establish and maintain connection with the chat service.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[DSCClientParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: DSCClientParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property family: Literal['discord']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property channels: ClientChannels#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property publish: ClientPublish#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property client: Client#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

get_message(event: ClientEvent | None = None) DSCMessage[source]#

Return the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:

event – Raw event received from the network peer.

Returns:

New item containing information for operation.

put_message(mqueue: RobieQueue[RobieMessage], event: ClientEvent | None = None) None[source]#

Insert the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • mqueue – Queue instance where the item is received.

  • event – Raw event received from the network peer.

get_command(method: Literal['delete', 'get', 'post', 'patch', 'put'] | None = None, path: str | None = None, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None) DSCCommand[source]#

Return the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Returns:

New item containing information for operation.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • json – Optional JSON payload included in request.

put_command(cqueue: RobieQueue[RobieCommand], method: Literal['delete', 'get', 'post', 'patch', 'put'] | None = None, path: str | None = None, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None) None[source]#

Insert the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • cqueue – Queue instance where the item is received.

  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • json – Optional JSON payload included in request.

compose(target: str, content: str) RobieCommand[source]#

Compose the message and transmit using the chat client.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • target – Where the composed message will be sent.

  • content – Content that will be source of message.

class enrobie.clients.DSCClientParams[source]#

Bases: RobieClientParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

client

ClientParams

Yes

delay

int

No

15

ge=1, le=300

enable

bool

No

False

intents

int

No

4609

ge=0, le=65535

locate

str | None

No

None

min_length=1

status

StatusPluginIconParams

No

factory

client: Annotated[ClientParams, FieldInfo(annotation=NoneType, required=True, description='Parameters for the base client')]#
intents: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=4609, description='Timeout connecting to server', metadata=[Ge(ge=0), Le(le=65535)])]#
delay: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=15, description='Period to wait for reconnect', metadata=[Ge(ge=1), Le(le=300)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
class enrobie.clients.MTMClient(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobieClient

Establish and maintain connection with the chat service.

validate() None[source]#

Perform advanced validation on the parameters provided.

classmethod schema() Type[MTMClientParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: MTMClientParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

property family: Literal['mattermost']#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property channels: ClientChannels#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property publish: ClientPublish#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property client: Client#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

get_message(event: ClientEvent | None = None) MTMMessage[source]#

Return the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:

event – Raw event received from the network peer.

Returns:

New item containing information for operation.

put_message(mqueue: RobieQueue[RobieMessage], event: ClientEvent | None = None) None[source]#

Insert the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • mqueue – Queue instance where the item is received.

  • event – Raw event received from the network peer.

get_command(method: Literal['delete', 'get', 'post', 'patch', 'put'] | None = None, path: str | None = None, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None) MTMCommand[source]#

Return the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Returns:

New item containing information for operation.

Parameters:
  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • json – Optional JSON payload included in request.

put_command(cqueue: RobieQueue[RobieCommand], method: Literal['delete', 'get', 'post', 'patch', 'put'] | None = None, path: str | None = None, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None) None[source]#

Insert the new item containing information for operation.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • cqueue – Queue instance where the item is received.

  • method – Method for operation with the API server.

  • path – Path for the location to upstream endpoint.

  • params – Optional parameters included in request.

  • json – Optional JSON payload included in request.

compose(target: str, content: str) RobieCommand[source]#

Compose the message and transmit using the chat client.

Note

Though parameters are marked optional, that is not necessarily the case; for typing purposes one cannot introduce required parameters outside of the parent.

Parameters:
  • target – Where the composed message will be sent.

  • content – Content that will be source of message.

class enrobie.clients.MTMClientParams[source]#

Bases: RobieClientParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

client

ClientParams

Yes

delay

int

No

15

ge=1, le=300

enable

bool

No

False

locate

str | None

No

None

min_length=1

status

StatusPluginIconParams

No

factory

client: Annotated[ClientParams, FieldInfo(annotation=NoneType, required=True, description='Parameters for the base client')]#
delay: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=15, description='Period to wait for reconnect', metadata=[Ge(ge=1), Le(le=300)])]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#

Robie Examples#

ainswer.yml#
---



plugins:


  #############
  ## Ainswer ##
  #############
  ainswer:
    enable: true
    locate: enrobie.plugins.AinswerPlugin

    database: >-
      {{ config.params.database }}

    histories: 10
    memories: 10

    clients:
      - dscbot
      - ircbot
      - mtmbot

    plugins:
      - enhomie
      - nagios

    logger: logger

    prompt:
      system: >-
        You are Bender from Futurama.
      client:
        dsc: >-
          Your nickname is {{ whoami }}.
          Use some markdown and emojis.
        irc: >-
          Your nickname is {{ whoami }}.
          Keep it short and use colors.
        mtm: >-
          Your nickname is {{ whoami }}.
          Use some markdown and emojis.

    ainswer:
      origin: openai
      model: gpt-4o
      secret: somekey
      sleep: [0, 0]  # For testing

    status:
      dsc: ':robot:'
      irc: 🤖
      mtm: ':robot:'
autojoin.yml#
---



plugins:


  ##############
  ## AutoJoin ##
  ##############
  autojoin:
    enable: true
    locate: enrobie.plugins.AutoJoinPlugin

    channels:

      - client: ircbot
        channel: mocked

    status:
      dsc: ':wrench:'
      irc: 🔧
      mtm: ':wrench:'
autonick.yml#
---



plugins:


  ##############
  ## AutoNick ##
  ##############
  autonick:
    enable: true
    locate: enrobie.plugins.AutoNickPlugin

    clients: ircbot

    services:

      - client: ircbot
        password: password

    status:
      dsc: ':wrench:'
      irc: 🔧
      mtm: ':wrench:'
clients.yml#
---



clients:


  #############
  ## DSC Bot ##
  #############
  dscbot:
    enable: true
    locate: enrobie.clients.DSCClient

    status:
      dsc: ':speech_balloon:'
      irc: 💬
      mtm: ':speech_balloon:'

    client:
      token: mocked


  #############
  ## IRC Bot ##
  #############
  ircbot:
    enable: true
    locate: enrobie.clients.IRCClient

    status:
      dsc: ':speech_balloon:'
      irc: 💬
      mtm: ':speech_balloon:'

    client:
      server: mocked
      nickname: ircbot
      username: ircbot
      realname: ircbot


  #############
  ## MTM Bot ##
  #############
  mtmbot:
    enable: true
    locate: enrobie.clients.MTMClient

    status:
      dsc: ':speech_balloon:'
      irc: 💬
      mtm: ':speech_balloon:'

    client:
      server: mocked
      token: mocked
      teamid: mocked
enhomie.yml#
---



plugins:


  ####################
  ## Homie Automate ##
  ####################
  enhomie:
    enable: true
    locate: enrobie.plugins.HomiePlugin

    restful: http://mocked:8420
    username: username
    password: password

    clients:
      - dscbot
      - ircbot
      - mtmbot

    status:
      dsc: ':bulb:'
      irc: 💡
      mtm: ':bulb:'
logger.yml#
---



plugins:


  ############
  ## Logger ##
  ############
  logger:
    enable: true
    locate: enrobie.plugins.LoggerPlugin

    database: >-
      {{ config.params.database }}

    histories: 10

    clients:
      - dscbot
      - ircbot
      - mtmbot

    status:
      dsc: ':wood:'
      irc: 🪵
      mtm: ':wood:'
nagios.yml#
---



plugins:


  ####################
  ## Nagios Console ##
  ####################
  nagios:
    enable: true
    locate: enrobie.plugins.NagiosPlugin

    restful: http://mocked/nagios
    username: username
    password: password

    clients:
      - dscbot
      - ircbot
      - mtmbot

    status:
      dsc: ':mag:'
      irc: 🔍
      mtm: ':mag:'
persons.yml#
---



persons:


  #######################
  ## Hubert Farnsworth ##
  #######################
  hubert:
    enable: true
    first: Hubert
    last: Farnsworth
    about: Chief Executive Officer of Planet Express.
    matches:
      - client: dscbot
        match: '823039201390230492'
      - client: ircbot
        match:
          - hubert!hubert@localhost
          - hubert!hubert@science.*
      - client: mtmbot
        match: kjf9al2klaiietalkw


  ######################
  ## Bender Rodríguez ##
  ######################
  bender:
    enable: true
    first: Bender
    last: Rodríguez
    about: Robo delivery assistant at Planet Express.
    matches:
      - client: dscbot
        match: '823902304920392013'
      - client: ircbot
        match:
          - bender!bender@localhost
          - bender!bender@bending.*
      - client: mtmbot
        match: iietalkwkjf9al2kla
status.yml#
---



plugins:


  ############
  ## Status ##
  ############
  status:
    enable: true
    locate: enrobie.plugins.StatusPlugin

    icons:

      pending:
        dsc: ':hourglass:'
        irc: 
        mtm: ':hourglass:'

      normal:
        dsc: ':green_circle:'
        irc: 🟢
        mtm: ':large_green_circle:'

      failure:
        dsc: ':red_circle:'
        irc: 🔴
        mtm: ':red_circle:'

      unknown:
        dsc: ':white_circle:'
        irc: 
        mtm: ':white_circle:'

    reports:

      - client: dscbot
        target: mocked
        delay: 0  # For testing

      - client: ircbot
        target: mocked
        delay: 0  # For testing

      - client: mtmbot
        target: mocked
        delay: 0  # For testing