Skip to content

Add Debate Partner community ability#241

Merged
Rizwan-095 merged 3 commits intoopenhome-dev:devfrom
hassan1731996:add-debate-partner
Apr 6, 2026
Merged

Add Debate Partner community ability#241
Rizwan-095 merged 3 commits intoopenhome-dev:devfrom
hassan1731996:add-debate-partner

Conversation

@hassan1731996
Copy link
Copy Markdown
Contributor

What This Ability Does

A voice-controlled debate partner that takes the opposing side on any topic you choose. Users engage in a structured 3-round debate with real-time scoring, adaptive difficulty levels, multi-voice delivery, and constructive feedback to sharpen their argumentation skills.

Core Features:

  • 3-Round Debate Structure: Opening Statements -> Rebuttals -> Closing Arguments (user leads each round)
  • Adaptive Difficulty: Easy (beginner-friendly), Medium (fair challenge), Hard (expert-level rhetoric)
  • Multi-Voice Delivery: Opponent speaks in distinct British voice for clarity; moderator uses default agent voice
  • Real-Time Scoring: Each round scored on Logic, Evidence, Persuasiveness, and Rebuttal Quality (1-10 each)
  • Persistent Statistics: Tracks lifetime win/loss/draw record across sessions
  • Flexible Topic Selection: Custom topics or random suggestions from curated list
  • Graceful Exit: Stop at any point without session restart

Checklist

  • Files in community/debate-partner/
  • Extends MatchingCapability with #{{register capability}} tag
  • resume_normal_flow() called on every exit path (try/finally)
  • No print() statements (uses editor_logging_handler)
  • No hardcoded API keys or external dependencies
  • Error handling on all LLM calls with JSON parsing fallbacks
  • Multi-voice TTS via text_to_speech(text, voice_id) for opponent voice
  • Persistent file storage for debate stats (delete-then-write pattern)
  • Exit word detection on every user_response() call
  • All AI/Claude references removed - neutral terminology throughout
  • README with setup, trigger words, features, and example conversation

Setup Required

No external API keys or services needed. Uses OpenHome's built-in LLM and TTS infrastructure.

Trigger Words: debate, let's debate, start a debate, debate me, argue with me, challenge me

Technical Details

  • Hotword Matching: Case-insensitive substring matching on trigger words
  • Debate Flow: Setup (topic -> sides -> difficulty) -> 3 Rounds -> Verdict -> Replay loop
  • LLM Integration: text_to_text_response() for opponent arguments and scoring (no await)
  • Voice Selection: Opponent uses onwK4e9ZLuTAKqWW03F9 (British Male, Deep)
  • State Management: In-memory debate state + file-based stats persistence
  • Edge Cases: Empty responses re-prompt once; short responses default to 'I pass'; LLM errors use fallback values

Testing

End-to-end flow tested in live editor:

  • Hotword triggers ability correctly
  • Topic selection (custom + random 'surprise me')
  • Side selection (A/B with ambiguous default)
  • Difficulty levels (easy, medium, hard)
  • All 3 rounds complete with opponent in distinct voice
  • Round scores calculated and announced
  • Final verdict with stats persistence
  • 'Play again' loop works without re-trigger
  • Exit at any point gracefully
  • No console errors or missing method calls

@hassan1731996 hassan1731996 requested a review from a team as a code owner April 5, 2026 15:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

✅ Community PR Path Check — Passed

All changed files are inside the community/ folder. Looks good!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

🔀 Branch Merge Check

PR direction: add-debate-partnerdev

Passedadd-debate-partnerdev is a valid merge direction

@github-actions github-actions bot added the community-ability Community-contributed ability label Apr 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

🔍 Lint Results

__init__.py — Empty as expected

Files linted: community/debate-partner/main.py

✅ Flake8 — Passed

✅ All checks passed!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

✅ Ability Validation Passed

📋 Validating: community/debate-partner
  ✅ All checks passed!

Copy link
Copy Markdown

@abubakarabbasi abubakarabbasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the community.
We will proceed with adopting this ability for a 30-day evaluation period to monitor performance, identify any bugs, and implement any necessary fixes or optimizations. If the ability proves stable and meets our quality standards during this period, we will move forward with publishing it to the marketplace, ensuring full credit is given to the original author for their work and contribution.
We truly appreciate your effort and encourage you to continue developing and submitting new abilities. Contributions like yours help strengthen the ecosystem, and we look forward to seeing more of your work.

@Rizwan-095 Rizwan-095 merged commit 10d51f4 into openhome-dev:dev Apr 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants