Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

newell-labs/ask-chat-gpt

Repository files navigation

Ask ChatGPT Reddit Bot

Experimental reddit bot that responds to reddit summons with response generated by OpenAI's text completion endpoint.

To use, simply make a comment that mentions the username /u/ask-chat-gpt. Everything after the mention will be used for the prompt.

ℹ️ Disclaimers:

  • This is not the same as ChatGPT, but once support is available in dependencies I might look to migrate
  • The bot may not always be available so replies may be delayed

Environments

There are three bots that can be mentioned in total, corresponding to different environments. Here are all three:

  • /u/ask-chat-gpt, which targets the latest stable release
  • /u/ask-chat-gpt-stage, which targets the release-* tag for the latest stable release
    • This will only differ from the first version when a new release is being tested
  • /u/ask-chat-gpt-dev, which targets the master tag
    • This can be unstable but will have the latest changes

Development

This is a pretty standard .NET 7 project, and can be built from command line if you have the .NET 7 SDK installed - dotnet build.

You can also use Docker, or an IDE like Visual Studio Community.

Setup the reddit bot info and OpenAI token using the SDK's secrets manager tool. Here is a JSON example of the required settings:

{
    "Reddit": {
        "AppId": "<appId>",
        "AppSecret": "<appSecret>",
        "RefreshToken": "<refreshToken>"
    },
    "OpenAIServiceOptions": {
        "ApiKey": "<apiKey>"
    }
}

When running under docker, the path to a JSON file that contains this config can be supplied using the DOTNET_CONFIGPATH environment variable.

About

[Archived - bot was banned by Reddit during API changes] Experimental reddit bot that builds replies using OpenAI's API

Topics

Resources

License

Stars

Watchers

Forks