config_list_from_models

config_list_from_models(
    key_file_path: str | None = '.',
    openai_api_key_file: str | None = 'key_openai.txt',
    aoai_api_key_file: str | None = 'key_aoai.txt',
    aoai_api_base_file: str | None = 'base_aoai.txt',
    exclude: str | None = None,
    model_list: list[str] | None = None
) -> list[dict[str, typing.Any]]

Get a list of configs for API calls with models specified in the model list.

This function extends config_list_openai_aoai by allowing to clone its’ out for each of the models provided. Each configuration will have a ‘model’ key with the model name as its value. This is particularly useful when all endpoints have same set of models.

Parameters:
NameDescription
key_file_pathThe path to the key files.

Type: str | None

Default: ’.’
openai_api_key_fileThe file name of the OpenAI API key.

Type: str | None

Default: ‘key_openai.txt’
aoai_api_key_fileThe file name of the Azure OpenAI API key.

Type: str | None

Default: ‘key_aoai.txt’
aoai_api_base_fileThe file name of the Azure OpenAI API base.

Type: str | None

Default: ‘base_aoai.txt’
excludeThe API type to exclude, “openai” or “aoai”.

Type: str | None

Default: None
model_listThe list of model names to include in the configs.

Type: list[str] | None

Default: None
Returns:
TypeDescription
list[dict[str, typing.Any]]list: A list of configs for OpenAI API calls, each including model information.