feat: add QR login and browser-backed web tools

This commit is contained in:
Azimkin
2026-09-14 14:19:20 +02:00
parent 3a8c198caa
commit b68e715267
19 changed files with 2740 additions and 8 deletions

View File

@@ -45,6 +45,8 @@ class ConfigAiTests(unittest.TestCase):
{
"glm": {"api_key": "glm-key", "model": "glm-model"},
"deepseek": {"api_key": "ds-key", "model": "ds-model"},
"web_page_timeout_seconds": 20,
"web_page_max_chars": 12345,
}
)
@@ -52,6 +54,8 @@ class ConfigAiTests(unittest.TestCase):
self.assertEqual(config.glm.model, "glm-model")
self.assertEqual(config.deepseek.api_key, "ds-key")
self.assertEqual(config.deepseek.model, "ds-model")
self.assertEqual(config.web_page_timeout_seconds, 20)
self.assertEqual(config.web_page_max_chars, 12345)
def test_ai_provider_env_overrides(self) -> None:
env = {
@@ -59,6 +63,8 @@ class ConfigAiTests(unittest.TestCase):
"GLM_MODEL": "env-glm-model",
"DEEPSEEK_API_KEY": "env-ds",
"DEEPSEEK_MODEL": "env-ds-model",
"AI_WEB_PAGE_TIMEOUT_SECONDS": "30",
"AI_WEB_PAGE_MAX_CHARS": "54321",
}
with patch.dict("os.environ", env, clear=True):
config = _parse_ai_config({})
@@ -67,6 +73,8 @@ class ConfigAiTests(unittest.TestCase):
self.assertEqual(config.glm.model, "env-glm-model")
self.assertEqual(config.deepseek.api_key, "env-ds")
self.assertEqual(config.deepseek.model, "env-ds-model")
self.assertEqual(config.web_page_timeout_seconds, 30)
self.assertEqual(config.web_page_max_chars, 54321)
if __name__ == "__main__":