Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -97,10 +97,10 @@ def get_available_models(api_key):
|
|
97 |
Args:
|
98 |
api_key (str): Your OpenAI API key.
|
99 |
"""
|
100 |
-
openai.api_key = api_key # Set the API key
|
101 |
|
102 |
try:
|
103 |
-
client = openai.OpenAI()
|
|
|
104 |
models = client.models.list()
|
105 |
|
106 |
print("Available models:")
|
|
|
97 |
Args:
|
98 |
api_key (str): Your OpenAI API key.
|
99 |
"""
|
|
|
100 |
|
101 |
try:
|
102 |
+
client = openai.OpenAI(api_key=api_key) # Instantiate OpenAI client with the API key
|
103 |
+
|
104 |
models = client.models.list()
|
105 |
|
106 |
print("Available models:")
|