processor#

class besser.agent.core.processors.processor.Processor(agent, user_messages=False, agent_messages=False)[source]#

Bases: ABC

The processor abstract class.

A processor defines the processing a user or agent message goes through.

This class serves as a template to implement processors.

Parameters:
  • agent (Agent) – The agent the processor belongs to

  • user_messages (bool) – whether the processor should be applied to user messages

  • agent_messages (bool) – whether the processor should be applied to agent messages

agent#

The agent the processor belongs to

Type:

Agent

user_messages#

whether the processor should be applied to user messages

Type:

bool

agent_messages#

whether the processor should be applied to agent messages

Type:

bool

_abc_impl = <_abc._abc_data object>#
abstract process(session, message)[source]#

Abstract method to process a message.

Parameters:
  • session (Session) – the current session

  • message (Any) – the message to be processed

Returns:

the processed message

Return type:

Any