Files
life-echo/api/app/agents/chat/prompt_context.py
Kevin 2fded6fbd9 refactor(chat): AI-native prompts, remove interview heuristics
- Drop interview_reply_length and utterance_substance; always run stage LLM
  and memory retrieval when enabled; trim Settings fields and .env.example.
- Replace guided/opening prompts with compact fact blocks plus unified
  behavior guidance; slim background_voice and persona to tone hints.
- InterviewAgent uses fixed chat_interview max_tokens/chars/segments.

Also includes stacked work: profile followup/extract path, evaluation rubric
and judge schema updates, transcript SPLIT handling in execution service,
user export markdown split tests, and golden case fixture.
2026-04-06 22:23:46 +08:00

40 lines
1.4 KiB
Python

"""Bundled parameters for chat system prompts (InterviewAgent)."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Dict, List, Optional
@dataclass
class ChatPromptContext:
"""访谈轮次构建 `get_guided_conversation_prompt` 所需的字段集合。"""
current_stage: str
empty_slots: List[str]
filled_slots: Dict[str, str]
all_stages_coverage: Optional[Dict[str, Dict]] = None
detected_user_stage: str = ""
user_profile_context: str = ""
persona: str = "default"
memory_evidence_text: str = ""
background_voice: str = "default"
occupation: str = ""
def guided_system_prompt(self) -> str:
"""用户原话仅以对话历史 + HumanMessage 注入模型。"""
from app.agents.chat.prompts_conversation import get_guided_conversation_prompt
return get_guided_conversation_prompt(
current_stage=self.current_stage,
empty_slots=self.empty_slots,
filled_slots=self.filled_slots,
all_stages_coverage=self.all_stages_coverage,
detected_user_stage=self.detected_user_stage,
user_profile_context=self.user_profile_context,
persona=self.persona,
memory_evidence_text=self.memory_evidence_text,
background_voice=self.background_voice,
occupation=self.occupation,
)