Skip to content

Commit

Permalink
refactor: Modify model metadata file loading to prioritize resource file
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Nov 15, 2024
1 parent 0ce5a94 commit b254afa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aider/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,16 @@ def load_dotenv_files(git_root, dotenv_fname, encoding="utf-8"):


def register_litellm_models(git_root, model_metadata_fname, io, verbose=False):
model_metatdata_files = generate_search_path_list(
".aider.model.metadata.json", git_root, model_metadata_fname
)
model_metatdata_files = []

# Add the resource file path
resource_metadata = importlib_resources.files("aider.resources").joinpath("model-metadata.json")
model_metatdata_files.append(str(resource_metadata))

model_metatdata_files += generate_search_path_list(
".aider.model.metadata.json", git_root, model_metadata_fname
)

try:
model_metadata_files_loaded = models.register_litellm_models(model_metatdata_files)
if len(model_metadata_files_loaded) > 0 and verbose:
Expand Down

0 comments on commit b254afa

Please sign in to comment.