MCPcopy
hub / github.com/Aider-AI/aider / test_system_prompt_prefix

Method test_system_prompt_prefix

tests/basic/test_coder.py:1060–1077  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1058 self.assertTrue(len(exc.valid_formats) > 0)
1059
1060 def test_system_prompt_prefix(self):
1061 # Test that system_prompt_prefix is properly set and used
1062 io = InputOutput(yes=True)
1063 test_prefix = "Test prefix. "
1064
1065 # Create a model with system_prompt_prefix
1066 model = Model("gpt-3.5-turbo")
1067 model.system_prompt_prefix = test_prefix
1068
1069 coder = Coder.create(model, None, io=io)
1070
1071 # Get the formatted messages
1072 chunks = coder.format_messages()
1073 messages = chunks.all_messages()
1074
1075 # Check if the system message contains our prefix
1076 system_message = next(msg for msg in messages if msg["role"] == "system")
1077 self.assertTrue(system_message["content"].startswith(test_prefix))
1078
1079 def test_coder_create_with_new_file_oserror(self):
1080 with GitTemporaryDirectory():

Callers

nothing calls this directly

Calls 5

InputOutputClass · 0.90
ModelClass · 0.90
createMethod · 0.80
format_messagesMethod · 0.80
all_messagesMethod · 0.80

Tested by

no test coverage detected