superdup95 commited on
Commit
c1a3d4c
1 Parent(s): 9d3366b

Update api_usage.py

Browse files
Files changed (1) hide show
  1. api_usage.py +2 -3
api_usage.py CHANGED
@@ -5,12 +5,13 @@ from dateutil.relativedelta import relativedelta
5
  import openai
6
 
7
  GPT_TYPES = ["gpt-3.5-turbo", "gpt-4", "gpt-4-32k"]
8
-
9
  rate_limit_per_model = {
10
  "gpt-3.5-turbo": 3500,
11
  "gpt-4": 200,
12
  "gpt-4-32k": 10 # No actual clue, rare enough
13
  }
 
 
14
 
15
  def get_headers(key):
16
  headers = {'Authorization': f'Bearer {key}'}
@@ -20,8 +21,6 @@ def get_subscription(key):
20
  queryUrl = 'https://api.openai.com/v1/chat/completions'
21
  headers = get_headers(key)
22
  #results = r.json()
23
- body_turbo = {"model": "gpt-3.5-turbo", "max_tokens": 1, "messages": [{'role':'user', 'content': ''}]}
24
- body_gpt4 = {"model": "gpt-4", "max_tokens": 1, "messages": [{'role':'user', 'content': ''}]}
25
  gpt4_avai = check_gpt4_availability()
26
 
27
  if check_key_availability():
 
5
  import openai
6
 
7
  GPT_TYPES = ["gpt-3.5-turbo", "gpt-4", "gpt-4-32k"]
 
8
  rate_limit_per_model = {
9
  "gpt-3.5-turbo": 3500,
10
  "gpt-4": 200,
11
  "gpt-4-32k": 10 # No actual clue, rare enough
12
  }
13
+ body_turbo = {"model": "gpt-3.5-turbo", "max_tokens": 1, "messages": [{'role':'user', 'content': ''}]}
14
+ body_gpt4 = {"model": "gpt-4", "max_tokens": 1, "messages": [{'role':'user', 'content': ''}]}
15
 
16
  def get_headers(key):
17
  headers = {'Authorization': f'Bearer {key}'}
 
21
  queryUrl = 'https://api.openai.com/v1/chat/completions'
22
  headers = get_headers(key)
23
  #results = r.json()
 
 
24
  gpt4_avai = check_gpt4_availability()
25
 
26
  if check_key_availability():