Skip to main content

Game Developer Community Feedback Agent CLI Tool

Project description

Game_Dev_Community_Feedback_Agent

Environment Setup

see requirements.txt for dependencies. You can set up a virtual environment and install the dependencies using:

pip install -r requirements.txt

Setup Instructions

  1. Reddit:
  2. Discord:
    • Create a Discord bot at https://discord.com/developers/applications
    • Get your bot token.
    • Ensure "MESSAGE CONTENT INTENT" is enabled in the bot settings.
    • Through OAuth2, generate invite links using scopes 'bot' and permissions 'View Channels', 'Read Message History', 'Send Messages'
    • Invite the bot to your server using the generated link.
  3. PostgreSQL:
    • Install PostgreSQL and create a database.
    • Add your database URL to the .env file.
    • schema.sql contains the database schema, which you can run to set up the database tables.
    • you can use dev_reset.sql to reset the database to a clean state.

Environment Variables

Before running the crawler, create a .env file in the project root with: REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret REDDIT_USER_AGENT=your_user_agent

DISCORD_BOT_TOKEN=your_discord_bot_token

DATABASE_URL=your_postgres_database_url

Data

This project stores crawled data in data/, which is ignored by Git. You can run the crawler to generate fresh data.

Resources

The project stores resources in the resources/ directory, including the keywords for safety tests and others

Intelligence Engine Pipeline

Data is processed through a pipeline that includes:

  • Language Detection
  • Translation
  • Sentiment Analysis
  • Priority Score Calculation
  • Embedding Generation

Safety check pipeline includes:

  • Toxicity Detection
  • Spam Detection
  • Scam Detection
  • Sentiment Crisis Detection
  • Trend Alerts Detection
  • Review Bombing Detection

CLI Usage

To install the CLI tool:

git clone https://github.com/QLhahaha/Game_Dev_Community_Feedback_Agent.git
cd Game_Dev_Community_Feedback_Agent
pip install -e .

Run the CLI tool with:

gdcfa

Below are the available commands and their usage: Note that the starting prompt gdcfa is not included in the command examples.

# Available commands:
# crawler <platform> [--options]
    platform: reddit | steam | discord
    --options for global:
        --write_to_database
        --analyze_immediately
    --options for reddit:
        --subreddits
        --post_id
        --post_url
        --max_posts
        --max_comments
        --post_sort
        --comment_sort
        --output
        --keywords
    --options for steam:
        --app_id
        --max_reviews
        --max_threads
        --fetch_review
        --fetch_discussion
        --discussion_sort
        --output
        --keywords
    --options for discord:
        --channels
        --max_messages
        --output
        --keywords


# scheduler
scheduler list // list all scheduled jobs
scheduler clear // clear all scheduled jobs
scheduler status // show status of the scheduler, currently is same as `scheduler list`

scheduler pause <job_id> // pause a specific job
scheduler resume <job_id> // resume a specific job
scheduler delete <job_id> // delete a specific job
scheduler run_now <job_id> // run a specific job immediately

scheduler add --path <path> // add jobs from a job_config json file
scheduler crawling --platform <platform> [--options]
    --subreddits <subreddits> // specify subreddits (comma-separated)
    --post_id <post_id> // specify a specific post ID
    --post_url <post_url> // specify a specific post URL
    --app_id <app_id> // specify Steam app ID
    --channels <channels> // specify Discord channels (comma-separated)
    --start_time <start_time> // specify start time for the job (optional)
    --end_time <end_time> // specify end time for the job (optional)
    --interval <interval> // specify interval for the job
    --daily_at <daily_at> // specify daily time for the job 
    --weekly // weekly run of the job
    --day // specify the day of the week for weekly jobs (optional)


# view
view platforms // view all platforms in the database
view tags // view all tags in the database
view games // view all games in the database

view sources // view all sources(post type) in the database

view tables <table_name> // view all tables or a specific table
view stats // view general stats of the database

view posts [--options] // view posts with optional filters
    --platform <platform> // filter by platforms
    --tags <tags> // filter by tags
    --authors <authors> // filter by authors
    --keywords <keywords> // filter by keywords
    --since <date> // filter posts since a date
    --until <date> // filter posts until a date
    --limit <number> // limit the number of posts displayed

view alerts [--options] // view alerts with optional filters
    --platforms <platforms> // filter by platforms
    --type <type> // filter by alert type
    --since <date> // filter alerts since a date
    --until <date> // filter alerts until a date
    --game <game> // filter by game
    --limit <number> // limit the number of alerts displayed


# search
search <keyword> [--options]
    --platform <platform> // filter by platform
    --limit <number> // limit the number of posts displayed

search_similar --post_id [options]
search_similar <texts> [--options]
    --limit <number> // limit the number of similar posts displayed
    --min_similarity <threshold> // similarity threshold

search_hybrid <keyword> [--options]
    --semantic_weight <weight> // weight for semantic search
    --limit <number> // limit the number of hybrid search results displayed



# database
database list_json // list all JSON files in the data directory
database insert_json --path <path> // insert data from a JSON file into the database
database export_json --tables <tables> --path <path> // export a table to a JSON file
database add --table <table_name> --values <name=value, ...> // add a row to table, e.g.:
    database add --table users --values name=Alice,age=30
database show --table <table_name> // show all rows in a table


# analyze
analyze language_detect [--options]
    --show-stats // show language detection stats

analyze translate [--options]
    --target-language <language_code> // specify target language for translation
    --show-before-after // show before and after translation stats
    --post_id <post_id> // specify post ID to translate
    --threshold <threshold> // specify similarity threshold for translation

analyze sentiment [--options]
    --unprocessed // analyze unprocessed posts
    --platform <platform> // specify platform for sentiment analysis
    --since <date> // specify start date for sentiment analysis
    --until <date> // specify end date for sentiment analysis
    --english_only // analyze only English posts
    --batch_size <size> // specify batch size for sentiment analysis
    --text <text> // specify text for sentiment analysis

analyze priority_score [--options]
    --unprocessed // analyze unprocessed posts
    --post_id <post_id> // specify post ID for priority score analysis
    --english_only // analyze only English posts
    --batch_size <size> // specify batch size for priority score analysis

analyze embedding [--options]
    --unprocessed // analyze unprocessed posts
    --post_id <post_id> // specify post ID for embedding analysis
    --english_only // analyze only English posts
    --batch_size <size> // specify batch size for embedding analysis

analyze process [--options]
    --unprocessed // analyze unprocessed posts
    --post_id <post_id> // specify post ID for embedding analysis
    --english_only // analyze only English posts
    --explain // explain the embedding process
    --lang_detect // enable language detection for embedding
    --translate // enable translation for embedding
    --sentiment // enable sentiment analysis for embedding
    --priority_score // enable priority score analysis for embedding
    --embedding // enable embedding for posts

# intelligence
intelligence show_coverage [--options]
    --platform <platform> // specify platform for coverage
    --since <date> // specify start date for coverage, format: YYYY-MM-DD
    --until <date> // specify end date for coverage, format: YYYY-MM-DD

intelligence process_uncovered [--options]
    --platforms <platform> // specify platforms for processing uncovered posts
    --since <date> // specify start date for processing, format: YYYY-MM-DD
    --until <date> // specify end date for processing, format: YYYY-MM-DD
    --lang_detection // enable language detection for processing
    --translation // enable translation for processing
    --sentiment // enable sentiment analysis for processing
    --priority // enable priority score analysis for processing
    --embedding // enable embedding for processing


# safety
safety detect_toxic [--options]
    --threshold <threshold> // specify toxicity threshold for detection
    --platform <platform> // specify platform for toxicity detection
    --since <date> // specify start date for toxicity detection
    --until <date> // specify end date for toxicity detection

safety detect_spam [--options]
    --auto_flag // automatically flag spam posts by tags

safety detect_scam [--options]
    --alert_high_risk // alert high-risk posts

safety detect_sentiment_crisis [--options]
    --timeframe <timeframe> // specify timeframe for sentiment crisis detection
    --minimum_posts <number> // specify minimum number of posts for detection
    --threshold <threshold> // specify sentiment threshold for detection

safety detect_trend_alerts [--options]
    --sentiment_drop <threshold> // specify sentiment drop threshold for trend alerts
    --volume_spike <threshold> // specify volume spike threshold for trend alerts
    --timeframe <timeframe> // specify timeframe for trend alerts
    --alert // alert detected negative trend

safety detect_review_bombing [--options]
    --ratio_threshold <threshold> // specify ratio threshold for review bombing detection
    --volume_threshold <threshold> // specify volume threshold for review bombing detection
    --timeframe <timeframe> // specify timeframe for review bombing detection
    --minimum_posts <number> // specify minimum number of posts for detection
    --platform <platform> // specify platform for review bombing detection

# alert
alert configure [--options]
    --toxic_threshold <threshold> // specify toxicity threshold for alerts
    --sentiment_crisis_threshold <threshold> // specify sentiment crisis threshold for alerts
    --sentiment_crisis_minimum_posts <number> // specify minimum number of posts for sentiment crisis alerts
    --sentiment_crisis_timeframe <timeframe> // specify timeframe for sentiment crisis alerts
    --sentiment_alert_drop <threshold> // specify sentiment drop threshold for alerts
    --sentiment_alert_volume_spike_threshold <threshold> // specify volume spike threshold for alerts
    --sentiment_alert_timeframe <timeframe> // specify timeframe for sentiment alerts
    --review_bombing_negative_ratio_threshold <threshold> // specify negative ratio threshold for review bombing alerts
    --review_bombing_volume_spike_threshold <threshold> // specify volume spike threshold for review bombing alerts
    --review_bombing_minimum_posts <number> // specify minimum number of posts for review bombing alerts
    --review_bombing_timeframe <timeframe> // specify timeframe for review bombing alerts

alert show_config // show current alert configuration

alert dry_run_test // run a dry run test for alerts that only output to console

alert check [--options]
    --live // check live alerts
    --platform <platform> // specify platform for checking alerts

alert history [--opions]
    --since <date> // specify start date for alert history
    --until <date> // specify end date for alert history
    --severity <severity> // specify severity level for alert history, choices are "info", "low", "medium", "high", "critical"

alert summary [--options]
    --show_recent // show recent alerts
    --count_by_type // count alerts by type

alert mark_reviewed <alert_ids> // mark alerts as reviewed


# report
report brief [--options]
    --since <date> // specify start date for report
    --daily // generate daily report
    --weekly // generate weekly report
    --platform <platform> // specify platform for report

report trends [--options]
    --since <date> // specify start date for trends report
    --daily // generate daily trends report
    --weekly // generate weekly trends report
    --platform <platform> // specify platform for trends report

report priority_alerts [--options]
    --threshold <threshold> // specify priority threshold for alerts
    --explain // explain the priority alerts

report cross_platform [--options]
    --since <date> // specify start date for cross-platform report
    --platforms <platforms> // specify platforms for cross-platform report

# config
config view // view current context
config show_providers // show available providers

config set_provider [type] [provider_name] // set a provider for a specific type
    type: translation | sentiment | embedding
    provider_name: "ollama", "openai"

config set_model [provider] [model_type] [model_name] // set a model for a specific provider
    provider: "ollama", "openai"
    model_type: translation | sentiment | embedding
    model_name: e.g. "llama-3.1", "gpt-4o"

Demo Link

Database and CLI Demo Intelligence Engine Demo Advanced Intelligence Operations & System Integration Demo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gamedev_feedback_agent-0.1.0a4.tar.gz (132.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gamedev_feedback_agent-0.1.0a4-py3-none-any.whl (98.6 kB view details)

Uploaded Python 3

File details

Details for the file gamedev_feedback_agent-0.1.0a4.tar.gz.

File metadata

  • Download URL: gamedev_feedback_agent-0.1.0a4.tar.gz
  • Upload date:
  • Size: 132.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for gamedev_feedback_agent-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 b050c4fa30f4c57b40a9130c25353d70eb8208ee1ef2a7fda5f0be7a89431c44
MD5 3a517d44abd503245fa544e5e77bd27a
BLAKE2b-256 b3cac49df51200a34616e01432a8ec4810fa66f0d869f23015e67916945b370e

See more details on using hashes here.

File details

Details for the file gamedev_feedback_agent-0.1.0a4-py3-none-any.whl.

File metadata

File hashes

Hashes for gamedev_feedback_agent-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 f944b430ed5204f1edea3f62ba711cd07ec0a36e5c0f76db41b30f122ab82886
MD5 62abc10c9113c0489be0c31afad7e062
BLAKE2b-256 30bdbd9e0e45a7d9876b21934874447a6dcc25e3d4ed2c60339d1a78b8ffcf49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page