You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieve a list of available model IDs from OpenAI's API filtered by model type.
60
+
Retrieve a filtered list of available model IDs from OpenAI's API or environment variables, based on the specified model type.
55
61
56
62
Args:
57
-
model_type (Literal["gpts", "embeddings"]): The type of models to retrieve.
63
+
model_type (Literal["gpts", "embeddings"]): The type of models to retrieve, such as 'gpts' or 'embeddings'.
58
64
api_key (str, optional): The API key for authenticating with OpenAI. Defaults to an empty string.
59
65
60
66
Returns:
61
-
List[str]: A list of available model IDs filtered by the specified model type.
62
-
Returns an empty list if an authentication error or any other exception occurs.
67
+
List[str]: A filtered list of available model IDs matching the specified model type. The list is derived either from the environment variable `AVAILABLE_MODEL_IDS` if set, or from a call to OpenAI's API.
68
+
If an authentication error or any other exception occurs during the API call, an empty list is returned.
0 commit comments