File size: 1,101 Bytes
0ba81ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os

# OPENAI

OPENAI_API_BASE_URL = "https://api.openai.com/v1"
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
TEXT_MODEL_ENGINE = 'gpt-4-0125-preview'

# GITHUB
GITHUB_AUTH_KEY = os.getenv("GITHUB_AUTH_KEY")

# REGEX
REPO_NAME_EXTRACTION_PATTERN = r"https://github.com/([^/]+)/([^/]+)$"

# SCHEMA
JSON_SCHEMA_FOR_GPT = {
  "type": "object",
  "properties": {
    "issues": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "issue_title": {
              "type": "string"
            },
            "rating": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "description"
              ]
            }
          },
          "required": [
            "issue_title",
            "rating"
          ]
        }
      ]
    }
  },
  "required": [
    "issues"
  ]
}