syndisco.Actor

class Actor(model: BaseModel | None = None, persona: dict[str, str] | None = None, context: str = '', instructions: str = '', is_annotator: bool = False, name: str = '<Unnamed>')

Bases: object

An abstract class representing an actor which responds according to an underlying LLM instance.

final get_actor_name() str

Get the actor’s assigned name within the conversation.

Returns:

The name of the actor.

Return type:

str

final get_model_name() str

Get the actor’s assigned name within the conversation.

Returns:

The name of the actor.

Return type:

str

get_system_prompt() str

Get the system prompt provided to the agent. :return: The system prompt provided to the agent. :rtype: str

get_user_prompt(history: list[str] | None = None) str

Get the message prompt provided to the agent. Changes depending on whether the agent is an annotator or a user.

Parameters:

history (list[str] | None) – The history of previous messages. Each element in the list corresponds to one message, including relevant information (such as the name of the user who posted it). None if no discussion history exists.

Returns:

The message prompt provided to the agent.

Return type:

str

final speak(history: list[str] | None = None) str

Prompt the actor to speak, given a history of previous messages in the conversation (None if no history).

This method should not be modified. If you are subclassing Actor, modify the :meth:get_user_prompt and :meth:get_system_prompt methods instead.

Parameters:

history (list[str]) – A list of previous messages.

Returns:

The actor’s new message

Return type:

str