user_adaptation_processor#

class besser.agent.core.processors.user_adaptation_processor.UserAdaptationProcessor(agent, llm_name, context=None)[source]#

Bases: Processor

The UserAdaptationProcessor takes into account the user’s profile and adapts the agent’s responses to fit the profile. The goal is to increase the user experience.

This processor leverages LLMs to adapt the messages given a user profile. For static profiles, an adaptation will be done once. If the profile changes, then an adapation will be triggered again.

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

  • llm_name (str) – the name of the LLM to use.

  • context (str) – additional context to improve the adaptation. should include information about the agent itself

  • accomplish (and the task it should) –

agent#

The agent the processor belongs to

Type:

Agent

_llm_name#

the name of the LLM to use.

Type:

str

_context#

additional context to improve the adaptation. should include information about the agent itself

Type:

str

and the task it should accomplish
_user_model#

dictionary containing the user models

Type:

dict

_abc_impl = <_abc._abc_data object>#
add_user_model(session, user_model)[source]#

Method to store the user model internally.

The user model shall be stored internally.

Parameters:
  • session (Session) – the current session

  • user_model (dict) – the user model of a given user

process(session, message)[source]#

Method to process a message and adapt its content based on a given user model.

The stored user model will be fetched and sent as part of the context.

Parameters:
  • session (Session) – the current session

  • message (str) – the message to be processed

Returns:

the processed message

Return type:

str