Name formats.models_in by what it returns, and read the catalog in one function
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
import json
|
||||
|
||||
from loop_claude.claude_code.formats import catalog
|
||||
from loop_claude.claude_code.formats import models_in
|
||||
|
||||
|
||||
def offered_models(folder):
|
||||
return catalog(read_catalog(folder))
|
||||
|
||||
|
||||
def read_catalog(folder):
|
||||
files = []
|
||||
for path in folder.glob("*.json"):
|
||||
try:
|
||||
with open(path, encoding="utf-8") as handle:
|
||||
yield json.load(handle)
|
||||
files.append(json.load(handle))
|
||||
except (OSError, ValueError):
|
||||
continue
|
||||
return models_in(files)
|
||||
|
||||
Reference in New Issue
Block a user