feat(agent): support dedicated model for query understanding step

Quick-answer (RAG) agents can now configure a separate chat model for
the query-understanding stage (rewrite + intent classification),
decoupling it from the main conversation model so users can route the
lightweight rewrite call to a cheaper / faster model.

- Add CustomAgentConfig.QueryUnderstandModelID and plumb it through
  PipelineRequest and ChatManage.Clone.
- query_understand plugin prefers QueryUnderstandModelID on the
  text-only path; falls back to ChatModelID if the configured model
  cannot be resolved (with a warn log). Multimodal path is unchanged
  to keep vision-capable model selection intact.
- AgentEditorModal exposes a ModelSelector under the existing Query
  Rewrite block; empty means reuse the main chat model.
- Add i18n strings (queryUnderstandModel / placeholder / desc) for
  zh-CN, en-US, ko-KR, ru-RU.
- Extend Go SDK AgentConfig with the new field.
This commit is contained in:
wizardchen
2026-05-12 20:05:31 +08:00
committed by lyingbug
parent 1f60d19f1b
commit 64b20a2d87
10 changed files with 63 additions and 2 deletions
+3
View File
@@ -1440,6 +1440,8 @@ export default {
placeholderCurrentWeek: "현재 주(예: 월요일)",
enableQueryExpansion: "쿼리 확장",
enableRewrite: "질문 재작성",
queryUnderstandModel: "질문 이해 모델",
queryUnderstandModelPlaceholder: "비워 두면 기본 대화 모델을 사용합니다",
rewritePromptSystem: "시스템 프롬프트 다시 작성",
rewritePromptSystemPlaceholder: "시스템 기본 프롬프트를 사용하려면 비워 두세요.",
rewritePromptUser: "사용자 프롬프트 다시 작성",
@@ -3863,6 +3865,7 @@ export default {
multiTurn: '활성화하면 대화 기록 컨텍스트가 유지됩니다',
historyRounds: '컨텍스트로 유지할 최근 대화 라운드 수',
rewrite: '다중 턴 대화에서 사용자 질문을 자동으로 재작성하여 지시대명사 해소 및 생략 보완',
queryUnderstandModel: '질문 이해(재작성과 의도 분류)에 사용할 모델입니다. 비워 두면 기본 대화 모델을 사용합니다.',
rewriteSystemPrompt: '질문 재작성용 시스템 프롬프트 (비워두면 기본값 사용)',
rewriteUserPrompt: '질문 재작성용 사용자 프롬프트 템플릿 (비워두면 기본값 사용)',
selectTools: 'Agent가 사용할 수 있는 도구를 선택하세요',