Skip to contents

Selects the next participant speaker based on their LLM-rated "desire to talk". The moderator's turns are primarily handled by the `FocusGroup`'s phase/script logic. This flow is mainly for choosing which participant responds to the moderator.

Super class

FocusGroup::ConversationFlow -> DesireBasedFlow

Public fields

last_desire_scores

Named numeric vector. Stores the most recent desire scores.

last_scoring_mode

Character. How the most recent desire scores were obtained: "broadcast_shared_config" (one config for all), "broadcast_grouped_config" (agents grouped by differing configs), or "per_agent".

min_desire_threshold

Numeric. Minimum desire score for a participant to be considered.

Methods

Inherited methods


Method new()

Initialize DesireBasedFlow.

Usage

DesireBasedFlow$new(agents, moderator_id, min_desire_threshold = 3)

Arguments

agents

A named list of `FGAgent` objects.

moderator_id

Character. The ID of the moderator agent.

min_desire_threshold

Numeric. Minimum desire score to be eligible.


Method select_next_speaker()

Selects the next participant based on desire to talk.

Usage

DesireBasedFlow$select_next_speaker(focus_group)

Arguments

focus_group

The `FocusGroup` object, providing context like current question, history.

Returns

The selected `FGAgent`. When no participant clears the desire threshold the highest-scoring participant is chosen, so this returns `NULL` only when there are no participants.


Method get_last_desire_scores()

Get the last calculated desire scores for participants.

Usage

DesireBasedFlow$get_last_desire_scores()

Returns

A named numeric vector of desire scores.


Method clone()

The objects of this class are cloneable with this method.

Usage

DesireBasedFlow$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.