feat: add get_system_info method to Coder base class

This commit is contained in:
Paul Gauthier (aider) 2024-09-05 12:59:12 -07:00
parent b57468a963
commit 45855bd96c
2 changed files with 8 additions and 1 deletions

View file

@ -919,6 +919,12 @@ class Coder:
return platform_text
def get_system_info(self):
system_info = self.get_platform_info()
if self.chat_language:
system_info += f"- Chat language: {self.chat_language}\n"
return system_info
def fmt_system_prompt(self, prompt):
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
platform_text = self.get_platform_info()

View file

@ -628,7 +628,8 @@ class TestMain(TestCase):
output=DummyOutput(),
return_coder=True,
)
self.assertIn("Spanish", coder.get_system_info())
system_info = coder.get_system_info()
self.assertIn("Chat language: Spanish", system_info)
@patch("git.Repo.init")
def test_main_exit_with_git_command_not_found(self, mock_git_init):