mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
feat: add get_system_info method to Coder base class
This commit is contained in:
parent
b57468a963
commit
45855bd96c
2 changed files with 8 additions and 1 deletions
|
@ -919,6 +919,12 @@ class Coder:
|
||||||
|
|
||||||
return platform_text
|
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):
|
def fmt_system_prompt(self, prompt):
|
||||||
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
|
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
|
||||||
platform_text = self.get_platform_info()
|
platform_text = self.get_platform_info()
|
||||||
|
|
|
@ -628,7 +628,8 @@ class TestMain(TestCase):
|
||||||
output=DummyOutput(),
|
output=DummyOutput(),
|
||||||
return_coder=True,
|
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")
|
@patch("git.Repo.init")
|
||||||
def test_main_exit_with_git_command_not_found(self, mock_git_init):
|
def test_main_exit_with_git_command_not_found(self, mock_git_init):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue