Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/takedown bot #138

Merged
merged 25 commits into from
Dec 20, 2024
Merged

Feature/takedown bot #138

merged 25 commits into from
Dec 20, 2024

Conversation

nonumpa
Copy link
Member

@nonumpa nonumpa commented Nov 18, 2024

Feature

  • Use github app to create a takedown pull request, if gemini recognize a reply as second scam(二次詐騙) or sexual content.
  • Query replies before REVIEW_REPLY_BEFORE(format: { "seconds":0, "minutes":10, "hours":0, "days":0}).
  • Filtered out known users that existed in pervious pr by parsing the pr title.
  • List the ten more replies written by the suspicious user for the moderator to review and determine if they are a spammer.
  • Created a moderators team for bot to assign pr reviewers(future work).

Created PR

#141

We can directly copy the payload
takedown pr

Langfuse

  • ENV variable for langfuse to tag the generation content.
  • Do nothing if LANGFUSE_BASEURL is not specified.

Github action

  • Schedule run every ten minutes but also can be triggered manually
  • Environment: set master branch as production, others as staging
environment

Takedown bot setting

https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app

INSTALLATION_ID

截圖 2024-11-22 下午4 42 21

Authentication with octokit

Three parameters needed

  1. The ID of your GitHub app
  2. A private key for your GitHub app
  3. The ID of the installation that you want to authenticate as

See Using Octokit.js to authenticate with an installation ID for detail.

@nonumpa nonumpa force-pushed the feature/takedown-bot branch from 214443b to 2039684 Compare December 11, 2024 08:35
@nonumpa nonumpa requested review from MrOrz and bil4444 and removed request for MrOrz December 11, 2024 13:52
@nonumpa nonumpa merged commit d250c06 into master Dec 20, 2024
45 checks passed
@nonumpa nonumpa deleted the feature/takedown-bot branch December 24, 2024 06:16
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.

3 participants