Better handling for empty extra-openai-models.yaml file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 15
Description
I made a extra-openai-models.yaml file thinking I would work on getting Azure OpenAI working with llm Then I learned that that's not quite as straightforward as I thought, so I left the empty file there and moved on to other things.
later, I forgot that was there, and I tried to use llm with regular OpenAI and got this
…
File "/Users/germuska/.virtualenvs/data/lib/python3.8/site-packages/llm/default_plugins/openai_models.py", line 45, in register_models
for extra_model in extra_models:
TypeError: 'NoneType' object is not iterable
Deleting the empty extra-openai-models.yaml got me back to using llm but it seems like it would be easy enough to handle this error so logging, and maybe i'll even add a PR if that would be helpful
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading llm/default_plugins/openai_models.py at line 45 and reproduce the failure with an empty extra-openai-models.yaml file. Verify that using llm with regular OpenAI no longer raises the reported TypeError and that the empty file is handled appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100