feat(i18n): inject language instruction into LLM system prompts

This commit is contained in:
ghostubborn
2026-04-01 15:24:12 +08:00
parent 22bf50f877
commit 8f6110df0f
3 changed files with 14 additions and 5 deletions

View File

@@ -6,6 +6,7 @@
import json
from typing import Dict, Any, List, Optional
from ..utils.llm_client import LLMClient
from ..utils.locale import get_language_instruction
# 本体生成的系统提示词
@@ -188,8 +189,9 @@ class OntologyGenerator:
additional_context
)
system_prompt = f"{ONTOLOGY_SYSTEM_PROMPT}\n\n{get_language_instruction()}"
messages = [
{"role": "system", "content": ONTOLOGY_SYSTEM_PROMPT},
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_message}
]