feat(copilot): add copilot_mode field to LLM model configs API

- Add `copilot_mode` field to request examples in API documentation
- Update prompt loader to read `copilot_mode` from flattened config structure
- Support both "teaching" and "lab_assistant" modes for different assistant behaviors
This commit is contained in:
YueGuobin committed 2026-03-05 16:41:47 +08:00
1 parent a777c36a29
commit 08b5b44a50
2 files changed
+8 -4

No files matched your search

@@ -51,7 +51,7 @@ def load_system_prompt(llm_config: dict | None = None) -> str:
- "lab_assistant": Full lab assistant mode - diagnostics and configuration enabled
Args:
llm_config: LLM model configuration dictionary containing the config field
llm_config: LLM model configuration dictionary (flattened structure from get_user_llm_config_full)
Returns:
str: The system prompt string.
@@ -60,8 +60,9 @@ def load_system_prompt(llm_config: dict | None = None) -> str:
logger.info("No LLM config provided, using default TEACHING assistant prompt mode")
return SYSTEM_PROMPT
config = llm_config.get("config", {})
mode = config.get("copilot_mode", "teaching").lower()
# llm_config is a flattened dict with copilot_mode at the top level
# Example: {"provider": "...", "model": "...", "copilot_mode": "...", ...}
mode = llm_config.get("copilot_mode", "teaching").lower()
if mode == "lab_assistant":
logger.info("Using LAB_ASSISTANT prompt mode (diagnostics + configuration)")