Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import anthropic
|
| 3 |
import requests
|
| 4 |
from api_usage import get_subscription, check_key_availability, check_key_ant_availability, check_key_gemini_availability, check_key_azure_availability, get_azure_status, get_azure_deploy, check_key_mistral_availability, check_mistral_quota, check_key_replicate_availability, check_key_aws_availability
|
| 5 |
|
|
@@ -60,13 +59,15 @@ def get_key_oai_info(key):
|
|
| 60 |
|
| 61 |
def get_key_ant_info(key):
|
| 62 |
# Return a dictionary containing key information
|
| 63 |
-
|
| 64 |
-
key_avai = check_key_ant_availability(ant)
|
| 65 |
info_dict = {#"account_name": "",
|
| 66 |
"key_type": "Anthropic Claude",
|
| 67 |
"key_availability": key_avai[0],
|
| 68 |
"status": key_avai[1],
|
| 69 |
-
"filter_response": key_avai[2]
|
|
|
|
|
|
|
|
|
|
| 70 |
return info_dict
|
| 71 |
|
| 72 |
def get_key_gemini_info(key):
|
|
@@ -156,6 +157,7 @@ def get_key_aws_info(key):
|
|
| 156 |
info_dict['admin'] = key_avai[3]
|
| 157 |
info_dict['quarantine'] = key_avai[4]
|
| 158 |
info_dict['iam_full_access'] = key_avai[5]
|
|
|
|
| 159 |
info_dict['claude_v2_enabled_region'] = key_avai[6]
|
| 160 |
info_dict['claude_sonnet_enabled_region'] = key_avai[7]
|
| 161 |
info_dict['cost_and_usage'] = key_avai[8]
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import requests
|
| 3 |
from api_usage import get_subscription, check_key_availability, check_key_ant_availability, check_key_gemini_availability, check_key_azure_availability, get_azure_status, get_azure_deploy, check_key_mistral_availability, check_mistral_quota, check_key_replicate_availability, check_key_aws_availability
|
| 4 |
|
|
|
|
| 59 |
|
| 60 |
def get_key_ant_info(key):
|
| 61 |
# Return a dictionary containing key information
|
| 62 |
+
key_avai = check_key_ant_availability(key)
|
|
|
|
| 63 |
info_dict = {#"account_name": "",
|
| 64 |
"key_type": "Anthropic Claude",
|
| 65 |
"key_availability": key_avai[0],
|
| 66 |
"status": key_avai[1],
|
| 67 |
+
"filter_response": key_avai[2],
|
| 68 |
+
"requests_per_minute": key_avai[3] + ("" if key_avai[3] == "" else f" ({key_avai[4]} left)"),
|
| 69 |
+
"tokens_per_minute": key_avai[5] + ("" if key_avai[5] == "" else f" ({key_avai[6]} left)"),
|
| 70 |
+
"tier": key_avai[7]}
|
| 71 |
return info_dict
|
| 72 |
|
| 73 |
def get_key_gemini_info(key):
|
|
|
|
| 157 |
info_dict['admin'] = key_avai[3]
|
| 158 |
info_dict['quarantine'] = key_avai[4]
|
| 159 |
info_dict['iam_full_access'] = key_avai[5]
|
| 160 |
+
info_dict['billing'] = key_avai[8]
|
| 161 |
info_dict['claude_v2_enabled_region'] = key_avai[6]
|
| 162 |
info_dict['claude_sonnet_enabled_region'] = key_avai[7]
|
| 163 |
info_dict['cost_and_usage'] = key_avai[8]
|