通用 LLMClient.chat(messages)
任意模块传入 role: system + user 即构成 system 提示;例如 relay/settings.py 中风控为单条 user。飞鸽主路径封装在 chat_feige_* / chat_stream。
分章浏览。完整说明见 首页。
LLMClient.chat(messages)任意模块传入 role: system + user 即构成 system 提示;例如 relay/settings.py 中风控为单条 user。飞鸽主路径封装在 chat_feige_* / chat_stream。
app/routers/matches.py · _assemble_chat_system_final为主对话注入「当前日期时间」一句(通常在组装末尾追加),便于模型对齐日历与时态;具体文案见源码格式化函数。
【当前时间】{YYYY-MM-DD HH:mm:ss}({时区名,如 Asia/Shanghai})。今天是{date}(周×)。以今天为基准:明天=…,后天=…,大后天=…。用户说「明天/后天/大后天」时,若你要写出具体月日,必须与上列日期一致,禁止把「后天」写成其它号。若无法对齐,只复述「后天」等相对说法或向用户确认,勿编造错误公历日期。供你判断:与上文的对话间隔、约定是否到期或食言、评价用户真诚度是否随时间改善(挽回需长期稳定表现,非一时热情)。
(实现:app/llm_time.py · format_now_for_llm_system,时区来自环境变量 APP_TIMEZONE,默认 Asia/Shanghai。)
scripts/smoke_*.py 仅用于本地验证,不在生产路径内。
下列方法均有文档字符串;含「飞鸽」命名的为主对话或合并 user 轮专用封装。非 chat_feige_* / 通用 chat 包装者多与「单独请求」条目对应(各章常以橙黄卡片标出)。
chat / chat_stream — 通用入口(支持 system 块、Anthropic cache 前缀) chat_feige_user_turn — 单轮用户正文 chat_feige_combined_* — 品行 JSON + 正文合并格式、工具轮 summarize_relay_similarity_angles_from_profiles / pick_best_relay_rag_record_rank need_match_exclude_users_for_candidate_blacklists need_match_blacklist_semantic_hit_row_indices classify_relay_invite_reply_audience classify_relay_short_ack_peer_or_wrapup classify_relay_assistant_promise_wrapup_other classify_relay_turn_mes_type summarize_relay_content classify_relay_invite_first_reply classify_labeling_gate detect_help_topic_preference_signal extract_help_topic_setting classify_await_help_topics_confirmation_reply classify_peer_now_place_requirement classify_need_segment_should_close classify_active_user_aborts_topic classify_labeling_confirmation_reply classify_await_relay_confirmation_reply pick_relevant_need_id_for_message pick_recent_binding_candidate_for_message classify_turn_mes_type generate_rag_query_associations(needs_desc → rag_query_associations → 多路 RAG 检索) summarize_chat_session_topic(L0 切会话 → chat_summaries) extract_recurring_topics_from_chat_summaries_for_l1(chat_summaries → L1) extract_recurring_topics_from_l1_summaries_for_l2(L1 → L2) extract_frequent_topics_from_l1(L1 → 重要记忆) evaluate_user_from_l1 (遗留未调用:summarize_l0_to_l1、summarize_l1_to_l2) extract_user_needs_from_turn extract_user_profile_from_turn normalize_profile_salary_level_to_storage / apply_salary_tool_normalization_to_profile_payload evaluate_user_from_l1 / evaluate_user_from_messages infer_user_merchant_preference_score infer_merchant_communication_attitude_snippet_only infer_merchant_communication_preference_and_attitude_snippet _structure_merchant_kb_rag_summary_lines / structure_merchant_kb_plaintext_for_rag / structure_merchant_kb_both_formats_for_rag for_merchant_kb_structure(类方法,切换商家 DeepSeek 客户端)
文档目录:docs/llm-call-catalog/