MCPcopy Create free account

hub / github.com/congde/emotional_chat / functions

Functions1,867 in github.com/congde/emotional_chat

↓ 1 callersMethodget_user_memories_list
获取用户记忆列表(用于管理界面) Args: user_id: 用户ID memory_type: 记忆类型过滤 limit: 返回数量
backend/services/memory_service.py:200
↓ 1 callersFunctionget_user_mood_trend
获取近N天情绪变化曲线,判断是否需干预 Args: user_id: 用户ID days: 查询天数,默认7天 Returns: { "trend": List[Dict],
backend/agent/tools/agent_tools.py:60
↓ 1 callersMethodget_user_profile
获取用户画像 Args: user_id: 用户ID Returns: 用户画像对象
backend/services/context_service.py:165
↓ 1 callersMethodget_user_sessions
获取用户的所有会话
backend/database.py:464
↓ 1 callersMethodget_value
(self)
backend/core/utils/dependency_injection.py:216
↓ 1 callersMethodget_vector_config
获取向量数据库配置
backend/config/performance_config.py:130
↓ 1 callersMethodgrep_search
使用grep搜索文件内容 Args: pattern: 搜索模式(正则表达式) file_pattern: 文件模式 directory: 搜索目录
backend/services/context_retrieval_optimizer.py:48
↓ 1 callersFunctionhandleSelectSkill
(skill)
frontend/src/components/SkillsPanel.js:683
↓ 1 callersFunctionhandleSend
()
frontend/src/components/MultimodalInput.js:265
↓ 1 callersMethodhealth_check
健康检查
backend/core/interfaces.py:276
↓ 1 callersFunctionhistory
查看迁移历史
db_manager.py:162
↓ 1 callersFunctioninit
初始化数据库(创建所有表)
db_manager.py:86
↓ 1 callersFunctioninit_database
初始化数据库
quick_start.py:74
↓ 1 callersFunctioninit_guards
初始化全局 toggles 引用。应用启动时调用一次。
backend/runtime/config/guards.py:46
↓ 1 callersFunctioninit_rag_knowledge
初始化RAG知识库
quick_start.py:110
↓ 1 callersFunctionintegrate_personalization_to_chat_service
如何将个性化配置集成到现有ChatService的示例代码 在 backend/services/chat_service.py 的 _chat_with_memory 方法中添加:
backend/services/chat_service_integration_example.py:138
↓ 1 callersFunctionis_allowed_file
(filename)
backend/main.py:122
↓ 1 callersMethodis_applicable
判断此 Skill 是否适用于当前上下文 默认总是适用,子类可覆盖实现条件判断。
backend/runtime/skills/base.py:128
↓ 1 callersMethodis_development
是否为开发环境
backend/core/config.py:250
↓ 1 callersMethodis_production
是否为生产环境
backend/core/config.py:254
↓ 1 callersMethodis_running
(self)
backend/runtime/session/fsm.py:136
↓ 1 callersMethodis_safe_input
安全检查(使用完整的验证机制) Returns: (is_valid, filtered_response)
backend/modules/llm/core/llm_core.py:204
↓ 1 callersMethodis_testing
是否为测试环境
backend/core/config.py:258
↓ 1 callersMethodlist_entries
列出所有条目(可按前缀过滤)
backend/agent/memory_store.py:145
↓ 1 callersMethodlist_experiments
列出所有实验
backend/ab_testing/ab_test_manager.py:251
↓ 1 callersMethodlist_modules
列出所有模块及其状态
backend/runtime/config/toggles.py:141
↓ 1 callersMethodlist_plugins
列出所有已注册的插件名称
backend/plugins/plugin_manager.py:42
↓ 1 callersMethodlist_tools
返回所有可用工具的描述列表
backend/runtime/protocols/tool_executor.py:43
↓ 1 callersFunctionloadConfig
()
frontend/src/components/PersonalizationPanel.js:375
↓ 1 callersFunctionloadRoleTemplates
()
frontend/src/components/PersonalizationPanel.js:366
↓ 1 callersFunctionloadSkills
()
frontend/src/components/SkillsPanel.js:636
↓ 1 callersMethodload_events
从日志文件加载事件数据 Args: log_file_path: 日志文件路径(可选,如果未提供则使用初始化时的路径) Returns: DataFrame包含所有事
backend/ab_testing/analyzer.py:36
↓ 1 callersMethodload_from_file
从文件系统加载上下文 Args: file_path: 文件路径 Returns: 完整的上下文数据
backend/services/context_rot_solver.py:526
↓ 1 callersMethodload_from_pdf
从PDF文件加载知识 Args: pdf_path: PDF文件路径
backend/modules/rag/core/knowledge_base.py:719
↓ 1 callersMethodload_pdf_documents
加载单个PDF文档 Args: pdf_path: PDF文件路径 Returns: 文档列表
backend/modules/rag/core/knowledge_base.py:77
↓ 1 callersMethodlog_rating
记录用户评分 Args: user_id: 用户ID experiment_id: 实验ID session_id: 会话ID rating: 评分(1
backend/ab_testing/ab_test_manager.py:216
↓ 1 callersMethodlog_response
记录响应事件 Args: user_id: 用户ID experiment_id: 实验ID session_id: 会话ID user_message
backend/ab_testing/ab_test_manager.py:174
↓ 1 callersMethodlog_response_received
记录收到响应
backend/ab_testing/event_logger.py:157
↓ 1 callersMethodlog_user_rating
记录用户评分
backend/ab_testing/event_logger.py:187
↓ 1 callersFunctionmain
主函数
db_manager.py:197
↓ 1 callersFunctionmain
主函数
quick_start.py:181
↓ 1 callersFunctionmain
主函数
simple_backend.py:208
↓ 1 callersFunctionmain
主演示函数
demo_agent.py:18
↓ 1 callersFunctionmain
初始化知识库
init_rag_knowledge.py:17
↓ 1 callersFunctionmain
()
backend/modules/agent/core/agent/reflector.py:685
↓ 1 callersFunctionmain
()
backend/modules/agent/core/agent/agent_core.py:796
↓ 1 callersFunctionmain
()
backend/modules/agent/core/agent/tool_caller.py:700
↓ 1 callersFunctionmain
主函数
backend/scripts/ab_test_demo.py:134
↓ 1 callersFunctionmain
()
backend/scripts/ab_test_analysis.py:22
↓ 1 callersFunctionmain
()
backend/agent/reflector.py:685
↓ 1 callersFunctionmain
()
backend/agent/agent_core.py:796
↓ 1 callersFunctionmain
()
backend/agent/tool_caller.py:787
↓ 1 callersFunctionmain
运行所有示例
examples/intent_recognition_demo.py:204
↓ 1 callersFunctionmain
主函数
examples/performance_optimization_example.py:241
↓ 1 callersFunctionmain
主函数
examples/response_generation_example.py:331
↓ 1 callersMethodmark_important_turn
判断对话轮次是否重要 Args: message: 消息对象 criteria: 判断标准 Returns: 是否重要
backend/services/enhanced_memory_manager.py:140
↓ 1 callersFunctionmask_sensitive_data
遮蔽敏感数据
backend/core/utils/helpers.py:248
↓ 1 callersFunctionmerge_emotion_baseline
合并情绪基线数据
backend/agent/activity_distiller.py:111
↓ 1 callersFunctionmerge_emotion_response_patterns
合并情绪响应模式到 L4
backend/agent/activity_distiller.py:160
↓ 1 callersFunctionmerge_recent_topics
合并新话题到已有列表,去重并排序。 Returns: canonical JSON (sort_keys, separators) 保证幂等 sha256。
backend/agent/activity_distiller.py:71
↓ 1 callersFunctionnormalize_text
标准化文本
backend/core/utils/helpers.py:264
↓ 1 callersMethodoffload_to_file
将上下文卸载到文件系统 Args: context: 完整上下文 identifier: 标识符(如session_id) Returns:
backend/services/context_rot_solver.py:484
↓ 1 callersMethodon_activate
Skill 被激活时调用 — 可用于初始化资源
backend/runtime/skills/base.py:136
↓ 1 callersMethodon_post_llm_call
在每次 LLM 响应接收后被调用。 适用于日志记录、成本计量和分析。 这里抛出的错误会被捕获并记为 WARN — 不会中断 agent 循环。
backend/runtime/hooks/base.py:82
↓ 1 callersMethodon_pre_llm_call
在每次 LLM API 调用之前被调用。 Returns ------- dict | None 如果返回包含 ``"context"`` 键的 dict,值会被追加到 当前轮次的最后
backend/runtime/hooks/base.py:68
↓ 1 callersMethodon_session_end
会话结束时被调用(在最后一个 turn 之后)
backend/runtime/hooks/base.py:95
↓ 1 callersMethodon_session_start
会话开始时被调用(在第一个 turn 之前)
backend/runtime/hooks/base.py:91
↓ 1 callersMethodon_tool_use_failure
工具执行抛出未处理异常时被调用。 Returns ------- dict | None 可以返回一个 dict 来替代错误结果,格式: {"output": "...", "erro
backend/runtime/hooks/base.py:101
↓ 1 callersMethodparseURL
(data)
frontend/src/services/ChatAPI.js:124
↓ 1 callersMethodparse_dialogue
解析对话文本,提取轮次 Args: text: 对话文本 Returns: 轮次列表,每个轮次包含speaker和text
backend/modules/rag/core/chunking_strategies.py:338
↓ 1 callersFunctionparse_duration
解析持续时间字符串为秒数
backend/core/utils/helpers.py:220
↓ 1 callersFunctionparse_timestamp
解析时间戳
backend/core/utils/helpers.py:302
↓ 1 callersFunctionparse_url_content
解析URL内容
backend/main.py:148
↓ 1 callersFunctionparse_url_content
解析URL内容
backend/routers/chat.py:66
↓ 1 callersMethodplan_with_mcp
使用MCP协议进行规划(新接口) Args: mcp_message: 输入的MCP消息(通常来自Agent Core) Returns: 输出的MCP消息(
backend/modules/agent/core/agent/planner.py:449
↓ 1 callersMethodplan_with_mcp
使用MCP协议进行规划(新接口) Args: mcp_message: 输入的MCP消息(通常来自Agent Core) Returns: 输出的MCP消息(
backend/agent/planner.py:449
↓ 1 callersMethodplay_audio
播放音频 Args: user_id: 用户ID audio_id: 音频ID Returns: 播放信息
backend/agent/tools/audio_player.py:212
↓ 1 callersMethodpreprocess
完整的预处理流程 Args: text: 原始输入文本 user_id: 用户ID(用于重复检测) Returns: 处理结果字典,包
backend/modules/intent/core/enhanced_input_processor.py:117
↓ 1 callersFunctionpretty_print_json
美化JSON输出
backend/core/utils/formatters.py:411
↓ 1 callersMethodprocess
处理用户输入 — Runtime 版 对外接口与旧版完全兼容,内部使用 ConversationRuntime.process_turn()
backend/agent/agent_core_v2.py:261
↓ 1 callersMethodprocess_and_store_memories
处理对话并存储记忆 Args: session_id: 会话ID user_id: 用户ID user_message: 用户消息 bot_respon
backend/services/memory_service.py:23
↓ 1 callersMethodprocess_audio
处理音频文件 Args: audio_file_path: 音频文件路径 Returns: 包含文本、情感、语音特征等信息的字典
backend/modules/multimodal/core/multimodal_processor.py:36
↓ 1 callersMethodprocess_image
处理图像文件 Args: image_file_path: 图像文件路径 Returns: 包含场景、情感、文字等信息的字典
backend/modules/multimodal/core/multimodal_processor.py:83
↓ 1 callersMethodprocess_message
处理用户消息(Agent模式) Args: user_id: 用户ID message: 用户消息 conversation_id: 对话ID
backend/modules/agent/services/agent_service.py:29
↓ 1 callersMethodprocess_message
处理用户消息(Agent模式) Args: user_id: 用户ID message: 用户消息 conversation_id: 对话ID
backend/services/agent_service.py:29
↓ 1 callersMethodprocess_message_with_sentiment
处理消息并进行情感分析 这是完整的集成流程示例 Args: user_message: 用户消息 user_id: 用户ID session_
backend/services/sentiment_integration_example.py:44
↓ 1 callersMethodprocess_text
处理文本输入 Args: text: 输入文本 context: 上下文信息 Returns: 包含情感分析等信息的字典
backend/modules/multimodal/core/multimodal_processor.py:135
↓ 1 callersMethodprocess_turn
处理一轮对话 — 替代原 AgentCore.process() ReAct loop: 1. 构建 SkillContext 2. 执行 Skill 链 (emotion → memory → planning → too
backend/runtime/conversation/_turn.py:41
↓ 1 callersMethodread_file_lines
按行范围读取文件(适用于大文件) Args: file_path: 文件路径 start_line: 起始行号(从1开始) end_line: 结束行号(None表示到文件末尾
backend/services/context_retrieval_optimizer.py:87
↓ 1 callersMethodreduce_context
缩减上下文 - 先压缩,再摘要 Args: context: 完整上下文 preserve_recent_turns: 保留最近N轮完整对话 Returns:
backend/services/context_rot_solver.py:380
↓ 1 callersMethodregister
注册插件
backend/plugins/plugin_manager.py:19
↓ 1 callersMethodregister_instance
注册服务实例
backend/core/factories.py:228
↓ 1 callersMethodregister_many
批量注册插件
backend/plugins/plugin_manager.py:27
↓ 1 callersMethodregister_singleton
注册单例服务
backend/core/utils/dependency_injection.py:64
↓ 1 callersMethodregister_transient
注册瞬时服务
backend/core/utils/dependency_injection.py:73
↓ 1 callersFunctionreset
重置数据库(危险操作!)
db_manager.py:171
↓ 1 callersMethodretrieve_memories
检索相关记忆 Args: user_id: 用户ID query: 查询文本 n_results: 返回数量 days_limit: 时间限制(天数)
backend/services/memory_service.py:93
↓ 1 callersFunctionrun_migrations_offline
在'离线'模式下运行迁移。 这将配置上下文仅使用URL,而不是Engine, 尽管在这里也可以接受一个Engine。 通过跳过Engine创建,我们甚至不需要DBAPI可用。 这里调用context.execute()会将给定的字符串输出到脚本输出
alembic/env.py:44
↓ 1 callersFunctionrun_migrations_online
在'在线'模式下运行迁移。 在这种情况下,我们需要创建一个Engine 并将连接与上下文关联。
alembic/env.py:67
↓ 1 callersFunctionsample_action_correct
正确的动作采样方法:使用Categorical分布按概率采样 Args: action_probs: 动作概率分布,形状为 [num_actions] 或 [batch_size, num_actions] Returns:
examples/action_sampling_example.py:13
← previousnext →801–900 of 1,867, ranked by callers