Refactor settings store to rename proModel to proThinking and update related logic; enhance CSS for energy efficiency and reduced motion preferences; improve i18n translations for better clarity and consistency; modify proBlock utility functions for clearer instruction handling; streamline Vite configuration by removing unnecessary Univer.js dependencies.

This commit is contained in:
“ydy0615”
2026-05-31 16:38:10 +08:00
parent 3a1fd1c5d7
commit b82c6d392d
42 changed files with 3909 additions and 2509 deletions
+6 -2
View File
@@ -4,7 +4,9 @@ from pathlib import Path
# Ensure the project root is in sys.path so imports like `from backend import prompt` work
ROOT = Path(__file__).resolve().parents[2]
BACKEND_DIR = ROOT / "backend"
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(BACKEND_DIR))
from backend import prompt # type: ignore
@@ -120,22 +122,24 @@ def test_build_completion_prompts_with_userprefs():
language = "python"
currency = "USD"
timezone = "UTC+0"
system, user = prompt.build_completion_prompts(
system, user, prefill = prompt.build_completion_prompts(
prefix="hello", suffix="world", language_id="markdown",
preferences=UserPrefs(),
)
assert isinstance(system, str)
assert isinstance(user, str)
assert prefill == "hello"
assert "python" in user.lower() or "USD" in user
def test_build_completion_prompts_privacy_mode_location_empty():
system, user = prompt.build_completion_prompts(
system, user, prefill = prompt.build_completion_prompts(
prefix="hello", suffix="world", language_id="markdown",
location="",
)
assert isinstance(system, str)
assert isinstance(user, str)
assert prefill == "hello"
def test_build_prompt_backward_compatibility():