mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
feat: implement cog to fetch and process model data
This commit is contained in:
parent
d9c159fe7a
commit
51ba096916
1 changed files with 15 additions and 2 deletions
|
@ -39,8 +39,21 @@ Aider supports "infinite output" for models that support "prefill",
|
||||||
such as:
|
such as:
|
||||||
|
|
||||||
<!--[[[cog
|
<!--[[[cog
|
||||||
# TODO: list the models
|
import requests
|
||||||
cog.out(text)
|
import json
|
||||||
|
|
||||||
|
# Fetch the JSON data
|
||||||
|
url = "https://raw.githubusercontent.com/BerriAI/litellm/refs/heads/main/model_prices_and_context_window.json"
|
||||||
|
response = requests.get(url)
|
||||||
|
data = json.loads(response.text)
|
||||||
|
|
||||||
|
# Process the JSON to find models with supports_assistant_prefill=true
|
||||||
|
prefill_models = [model for model, info in data.items() if info.get('supports_assistant_prefill') == True]
|
||||||
|
|
||||||
|
# Generate the list of models
|
||||||
|
model_list = "\n".join(f"- {model}" for model in prefill_models)
|
||||||
|
|
||||||
|
cog.out(f"Models that support prefill:\n\n{model_list}")
|
||||||
]]]-->
|
]]]-->
|
||||||
|
|
||||||
<!--[[[end]]]-->
|
<!--[[[end]]]-->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue