Skip to content

Commit a57c4a7

Browse files
authored
Merge pull request #155 from Multi-Agent-LLMs/informed_personas
Informed personas
2 parents d51ebad + 1557d96 commit a57c4a7

16 files changed

Lines changed: 443 additions & 141 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ response_generator: str = "simple"
106106
decision_protocol: str = "hybrid_consensus"
107107
visible_turns_in_memory: int = 2
108108
debate_rounds: int = 2
109+
max_tokens: int = 1024
109110
concurrent_api_requests: int = 100
110111
use_baseline: bool = False
111112
use_chain_of_thought: bool = True
@@ -141,7 +142,7 @@ Response Generators: `critical`, `freetext`, `reasoning`, `simple`, `splitfreete
141142

142143
Decision Protocols: `approval_voting`, `consensus_voting`, `cumulative_voting`, `hybrid_consensus`, `judge`, `majority_consensus`, `ranked_voting`, `simple_voting`, `supermajority_consensus`, `unanimity_consensus`
143144

144-
Persona Generators: `expert`, `ipip`, `mock`, `nopersona`
145+
Persona Generators: `expert`, `informed`, `ipip`, `mock`, `nopersona`
145146

146147
Discussion Paradigms: `collective_refinement`, `debate`, `memory`, `relay`, `report`
147148

contextplus/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def context(input_text: str) -> str:
2+
"""
3+
Lightweight stub for context retrieval used in tests.
4+
Returns an empty string to avoid external dependencies.
5+
"""
6+
return ""

mallm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__='v1.0.5'
1+
__version__ = 'v1.0.5'

mallm/coordinator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from mallm.agents.agent import Agent
1313
from mallm.agents.draftProposer import DraftProposer
14-
from mallm.agents.judge import Judge
1514
from mallm.agents.panelist import Panelist
1615
from mallm.decision_protocols.protocol import DecisionProtocol
1716
from mallm.discussion_paradigms.paradigm import DiscussionParadigm
@@ -146,6 +145,9 @@ def init_agents(
146145

147146
self.judge = None
148147
if judge_intervention and self.judge_llm:
148+
# Lazy import to avoid heavy evaluation dependencies when judge is not used
149+
from mallm.agents.judge import Judge # noqa: PLC0415
150+
149151
self.judge = Judge(
150152
self.judge_llm,
151153
self.client,

mallm/discussion_paradigms/debate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from rich.progress import Console
77

88
from mallm.agents.draftProposer import DraftProposer
9-
from mallm.agents.judge import Judge
109
from mallm.agents.panelist import Panelist
1110
from mallm.discussion_paradigms.paradigm import DiscussionParadigm
1211
from mallm.utils.types import Agreement, TemplateFilling, VotingResultList
@@ -181,7 +180,7 @@ def discuss(
181180
agents_to_update=agents_to_update,
182181
agreements=debate_agreements,
183182
)
184-
elif isinstance(a, Judge):
183+
elif a.__class__.__name__ == "Judge":
185184
continue # executes after decision protocol
186185
else:
187186
logger.error("Agent type not recognized.")

mallm/discussion_paradigms/paradigm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from rich.text import Text
1010

1111
from mallm.agents.draftProposer import DraftProposer
12-
from mallm.agents.judge import Judge
1312
from mallm.agents.panelist import Panelist
1413
from mallm.utils.types import Agreement, Memory, TemplateFilling, VotingResultList
1514

@@ -91,7 +90,7 @@ def discuss(
9190
memory_ids=memory_ids,
9291
template_filling=template_filling,
9392
)
94-
elif isinstance(agent, Judge):
93+
elif agent.__class__.__name__ == "Judge":
9594
continue # executes after decision protocol
9695
else:
9796
logger.error("Agent type not recognized.")

mallm/evaluation/evaluator.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
from pathlib import Path
44
from typing import Any, Optional
55

6-
import fire
6+
try:
7+
import fire
8+
except Exception: # pragma: no cover - optional dependency
9+
fire = None
710
import json_repair
811
from tqdm import tqdm
912

@@ -429,7 +432,10 @@ def run_evaluator(
429432

430433

431434
def main() -> None:
432-
fire.Fire(run_evaluator)
435+
if fire is not None:
436+
fire.Fire(run_evaluator)
437+
else:
438+
print("Fire is not available. Please call run_evaluator(...) programmatically.")
433439

434440

435441
if __name__ == "__main__":

0 commit comments

Comments
 (0)