Skip to content

PNGTuber-GPT 1.2#31

Open
rapidbnnuy wants to merge 13 commits intoRokWT:mainfrom
rapidbnnuy:main
Open

PNGTuber-GPT 1.2#31
rapidbnnuy wants to merge 13 commits intoRokWT:mainfrom
rapidbnnuy:main

Conversation

@rapidbnnuy
Copy link
Copy Markdown
Collaborator

PR: Update to omni-moderation-latest + Post-to-Chat Toggle + Response Output to Global Variable

Summary

This PR includes three related improvements for PNGTuber-GPT:

  1. Migration to OpenAI’s omni-moderation-latest with correct category mapping.
  2. A Streamer.bot-controlled toggle to suppress posting responses to Twitch chat, while still capturing output for downstream use.
  3. Responses are now stored in the GPTResponse Global Variable

1) Moderation: Switch to omni-moderation-latest

OpenAI deprecated text-moderation-latest on 2025-10-27. We now call omni-moderation-latest.

Changes

  • Update moderation endpoint: text-moderation-latestomni-moderation-latest.
  • Support new categories returned by Omni:
    • illicit
    • illicit/violent
  • Normalize settings → API categories in LoadModerationPreferences():
    • underscore keys (settings) → slash keys (API)
    • e.g., self_harm_instructions_allowedself-harm/instructions
  • Hard-coded auto-deny: sexual/minors (no user toggle).
  • Logs show excluded categories using API names.

Behavior

  • Backward compatible with existing settings file.
  • Flag-handling matches Omni’s response payload.
  • Verified with real responses (e.g., illicit flagged).

2) Post-to-Chat Toggle (Streamer.bot)

Adds a global switch to control whether GPT responses are posted to chat.

Changes

  • New Streamer.bot global: Post To Chat (true/false).
  • In AskGPT():
    • If Post To Chat is false: do not send response to chat.
    • We still perform TTS and proceed with internal handling.
    • We now store the full model output in global variable GPTResponse.
  • Also added response sanitation before emoji stripping:
    • Remove markdown-style citations ([text](https://...)).
    • Normalize curly quotes/apostrophes to ASCII.
    • Then (optionally) strip emojis per Strip Emojis From Response.

Testing

  • Confirmed illicit/illicit/violent flow and logging.
  • Verified excluded category mapping and pass/fail gating.
  • Validated:
    • Post To Chat = false → no chat posts.
    • GPTResponse contains the full, sanitized model output.
  • Long responses still chunk if posting is enabled.

Version

Increment internal version to v1.3 to reflect compatibility + behavior changes.


Notes for Maintainers

  • This a breaking change, and the extension should be uninstalled from Streamer bot and reimported. After setting all required variables under SaveSettings and Startup, deleted the settings.json file from the bot directory before triggering the SaveSettings trigger, and then the Startup Trigger. This will create a new settings.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant