mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
test: Update model settings test to check extra parameters
This commit is contained in:
parent
11f10e586a
commit
34aff6c786
1 changed files with 9 additions and 18 deletions
|
@ -92,7 +92,7 @@ class TestModels(unittest.TestCase):
|
||||||
any("bogus-model" in msg for msg in warning_messages)
|
any("bogus-model" in msg for msg in warning_messages)
|
||||||
) # Check that one of the warnings mentions the bogus model
|
) # Check that one of the warnings mentions the bogus model
|
||||||
|
|
||||||
def test_default_and_override_settings(self):
|
def test_aider_extra_model_settings(self):
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -100,13 +100,11 @@ class TestModels(unittest.TestCase):
|
||||||
# Create temporary YAML file with test settings
|
# Create temporary YAML file with test settings
|
||||||
test_settings = [
|
test_settings = [
|
||||||
{
|
{
|
||||||
"name": "aider/default",
|
"name": "aider/extra",
|
||||||
"edit_format": "fake",
|
"extra_params" : {
|
||||||
"use_repo_map": True,
|
"extra_headers" : { "Foo" : "bar" },
|
||||||
},
|
"some_param" : "some value",
|
||||||
{
|
}
|
||||||
"name": "aider/override",
|
|
||||||
"use_temperature": False,
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -118,20 +116,13 @@ class TestModels(unittest.TestCase):
|
||||||
register_models([tmp.name])
|
register_models([tmp.name])
|
||||||
|
|
||||||
# Test that defaults are applied when no exact match
|
# Test that defaults are applied when no exact match
|
||||||
model = Model("unknown-model")
|
model = Model("claude-3-5-sonnet-20240620")
|
||||||
self.assertEqual(model.edit_format, "fake")
|
# TODO: make sure Foo:bar and existing anthropic-beta headers are both here; check some_param; check max_tokens=8192 still there
|
||||||
self.assertTrue(model.use_repo_map)
|
|
||||||
self.assertFalse(model.use_temperature) # Override should win
|
|
||||||
|
|
||||||
# Test that exact match overrides defaults but not overrides
|
# Test that exact match overrides defaults but not overrides
|
||||||
model = Model("gpt-4")
|
model = Model("gpt-4")
|
||||||
self.assertNotEqual(model.edit_format, "fake") # Model setting should win over default
|
# TODO: make sure Foo:bar header is there; check some_param
|
||||||
self.assertFalse(model.use_temperature) # Override should still win
|
|
||||||
|
|
||||||
# Clean up by removing test settings
|
|
||||||
MODEL_SETTINGS[:] = [
|
|
||||||
ms for ms in MODEL_SETTINGS if ms.name not in ("aider/default", "aider/override")
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue