Initial commit: add .gitignore and README
Some checks failed
Tests / test (3.10) (push) Has been cancelled
Tests / test (3.11) (push) Has been cancelled
Tests / test (3.12) (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / docker (push) Has been cancelled

This commit is contained in:
defiQUG
2026-02-09 21:51:42 -08:00
commit c052b07662
3146 changed files with 808305 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
from typing import Any
from collections import Counter
from fusionagi._logger import logger
def consensus_vote(answers: list, key=None):
if not answers:
return None
values = [a.get(key, a) if isinstance(a, dict) else a for a in answers] if key else list(answers)
return Counter(values).most_common(1)[0][0]
def arbitrate(proposals: list, arbitrator="coordinator"):
if not proposals:
return {}
logger.info("Arbitrate", extra={"arbitrator": arbitrator, "count": len(proposals)})
return proposals[0]