Skip to content

austenstone/openai-issue-labeler

Repository files navigation

OpenAI Issue Labeler 🤖

Warning The classification API is deprecated. Need to replace it with https://platform.openai.com/docs/guides/fine-tuning

This GitHub action labels issues using OpenAI's Classification API powered by GPT-3 models! We are using curie as our completion model and ada as the search model.

It uses your existing labels and past GitHub issues to train a model that can predict the labels of new issues. When someone opens a new issue this action will automatically label it.

Requirements

You will need to sign up for the OpenAI API and get an OpenAI API Key.

Add this OpenAI API Key as a secret called OPENAI_API_KEY. See Creating encrypted secrets for a repository.

Usage

Create a workflow (eg: .github/workflows/labeler.yml). See Creating a Workflow file.

Default Workflow

name: "OpenAI Issue Labeler"
on:
  issues:
    types: [opened, edited]

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
      - uses: austenstone/openai-issue-labeler@v2
        with:
          openai-api-key: "${{ secrets.OPENAI_API_KEY }}"

That's it. Your issues are now labeled by powerful AI models! 🧠

RobotDancingDanceGIF

Input Settings

Various inputs are defined in action.yml to let you configure the labeler. See the Classifications API reference for more information.

Name Description Default
openai‑api‑key The OpenAI API key secret N/A
token Token to use to authorize label changes. ${{ github.token }}
temperature Higher values mean the model will take more risks. 0
model ID of the engine to use for completion. You can select one of ada, babbage, curie, or davinci. curie
search‑model ID of the engine to use for Search. You can select one of ada, babbage, curie, or davinci. ada

How?

The model uses Labeled data to classify the new piece of data.

Inputs

  1. All repository labels
  2. Examples of past label usage
    • Label description and label
    • Issue title and label
    • Issue body and label
  3. A query to find a label for
    • New Issue title
    • New Issue body

Outputs

The label! It will be automatically added to your issue.

This workflow runs on this repo. Check out the issues and feel free to open a new one.

Example Issues