Update app.py
Browse files
app.py
CHANGED
|
@@ -61,6 +61,20 @@ function createGradioAnimation() {
|
|
| 61 |
}
|
| 62 |
"""
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
load_dotenv(verbose=True)
|
| 65 |
|
| 66 |
conn = mysql.connector.connect(
|
|
@@ -76,20 +90,6 @@ cursor = conn.cursor(dictionary=True)
|
|
| 76 |
|
| 77 |
get_api_keys()
|
| 78 |
|
| 79 |
-
def get_rounrobin():
|
| 80 |
-
select_one_data_query = "select api from agentic_apis_count order by counts ASC"
|
| 81 |
-
cursor.execute(select_one_data_query)
|
| 82 |
-
result = cursor.fetchall()
|
| 83 |
-
first_api = result[0]['api']
|
| 84 |
-
return first_api
|
| 85 |
-
|
| 86 |
-
# MySQLに接続
|
| 87 |
-
def get_api_keys():
|
| 88 |
-
token = get_rounrobin()
|
| 89 |
-
os.environ["GROQ_API_KEY"] = token
|
| 90 |
-
|
| 91 |
-
return token
|
| 92 |
-
|
| 93 |
# Configure Groq
|
| 94 |
config_list = [{
|
| 95 |
"model": "llama-3.3-70b-versatile",
|
|
|
|
| 61 |
}
|
| 62 |
"""
|
| 63 |
|
| 64 |
+
def get_rounrobin():
|
| 65 |
+
select_one_data_query = "select api from agentic_apis_count order by counts ASC"
|
| 66 |
+
cursor.execute(select_one_data_query)
|
| 67 |
+
result = cursor.fetchall()
|
| 68 |
+
first_api = result[0]['api']
|
| 69 |
+
return first_api
|
| 70 |
+
|
| 71 |
+
# MySQLに接続
|
| 72 |
+
def get_api_keys():
|
| 73 |
+
token = get_rounrobin()
|
| 74 |
+
os.environ["GROQ_API_KEY"] = token
|
| 75 |
+
|
| 76 |
+
return token
|
| 77 |
+
|
| 78 |
load_dotenv(verbose=True)
|
| 79 |
|
| 80 |
conn = mysql.connector.connect(
|
|
|
|
| 90 |
|
| 91 |
get_api_keys()
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
# Configure Groq
|
| 94 |
config_list = [{
|
| 95 |
"model": "llama-3.3-70b-versatile",
|