MCPcopy Create free account

hub / github.com/DSGWJQ/Feagent / functions

Functions13,770 in github.com/DSGWJQ/Feagent

↓ 1,418 callersMethodcreate
(self, **kwargs: Any)
tests/unit/infrastructure/executors/test_llm_executor.py:150
↓ 1,368 callersMethodget
按名称获取工具
src/domain/services/tool_engine.py:174
↓ 1,113 callersMethodappend
追加消息到记忆中 Args: message: 要追加的聊天消息实体 Raises: DomainError: 当消息无效时 InfrastructureError: 当存储
src/domain/ports/memory_provider.py:31
↓ 785 callersMethodget
获取缓存的消息列表 Args: workflow_id: 工作流 ID Returns: - list[ChatMessage]: 缓存命中且有效 - None: 缓存未命中
src/domain/ports/memory_cache.py:31
↓ 648 callersMethodget
(self, workflow_id: str)
tests/unit/domain/ports/test_memory_cache.py:58
↓ 466 callersMethodappend
(self, message: ChatMessage)
tests/unit/domain/ports/test_memory_provider.py:59
↓ 338 callersMethodlog
记录日志
src/domain/services/management_modules.py:836
↓ 284 callersMethodget
获取缓存的消息列表 执行逻辑: 1. 检查缓存是否存在 2. 检查 TTL 是否过期 3. 检查有效性标记 4. 更新访问时间 + LRU 排序 5. 返回消息副本
src/infrastructure/memory/in_memory_cache.py:82
↓ 207 callersMethodinfo
记录 INFO 级别日志
src/domain/services/unified_log_collector.py:113
↓ 190 callersMethodsave
(self, message: ChatMessage)
tests/unit/domain/services/test_workflow_chat_service_enhanced.py:40
↓ 186 callersFunctionpatch
(url: string, data?: any, config?: any)
web/src/shared/utils/request.ts:137
↓ 165 callersMethodadd_node
添加节点 用于拖拽调整工作流时添加新节点 参数: node: 要添加的节点
src/domain/entities/workflow.py:171
↓ 159 callersMethoderror
记录 ERROR 级别日志
src/domain/services/unified_log_collector.py:121
↓ 139 callersMethodjson
(self)
tests/integration/test_workflow_engine_templating_http_stub.py:32
↓ 129 callersMethodpublish
发布事件 参数: event: 要发布的事件 执行流程: 1. 执行所有中间件(按顺序) 2. 如果中间件返回None,停止传播 3. 记录事件到日志 4. 分发给所有匹配类型
src/domain/services/event_bus.py:190
↓ 113 callersMethodconnect_nodes
连接两个节点 参数: source_id: 源节点ID target_id: 目标节点ID condition: 可选的条件表达式 返回: 创建的边
src/domain/agents/workflow_agent.py:1040
↓ 113 callersMethodload
加载工具目录 扫描配置目录,加载所有有效的工具配置
src/domain/services/tool_engine.py:331
↓ 111 callersMethodsubscribe
订阅特定类型的事件 参数: event_type: 要订阅的事件类型 handler: 异步处理器函数 设计说明: - 类型过滤:只有匹配类型的事件才会传递给处理器 - 多订阅者:同一
src/domain/services/event_bus.py:115
↓ 110 callersMethodcopy
复制上下文(深拷贝) 返回: 新的 ExecutionContext 实例(独立副本)
src/domain/value_objects/execution_context.py:193
↓ 100 callersMethodwarning
记录 WARNING 级别日志
src/domain/services/unified_log_collector.py:117
↓ 89 callersMethodexists
(self, _tool_id: str)
tests/integration/api/workflow_chat/test_chat_create_stream_api.py:67
↓ 89 callersMethodpublish
(self, event)
tests/unit/domain/services/test_context_injection.py:35
↓ 84 callersMethodexecute
执行 LLM 节点 配置参数: model: 模型名称(如 openai/gpt-4) temperature: 温度参数 maxTokens/max_tokens: 最大 token 数
src/infrastructure/executors/llm_executor.py:23
↓ 80 callersMethodevaluate
评估所有规则 遍历所有启用的规则,检查条件是否满足。 参数: context: 评估上下文(包含变量) 返回: 违规列表
src/domain/services/rule_engine.py:208
↓ 77 callersMethodadd
添加工具到索引
src/domain/services/tool_engine.py:164
↓ 76 callersMethodacquire_slot
获取执行槽位 参数: tool_name: 工具名称 caller_id: 调用者 ID caller_type: 调用者类型 bucket: 分桶(可选) ti
src/domain/services/tool_concurrency_controller.py:273
↓ 75 callersMethoddebug
记录 DEBUG 级别日志
src/domain/services/unified_log_collector.py:109
↓ 72 callersMethodadd_child
添加子节点(仅GENERIC类型) 参数: child: 子节点 异常: ValueError: 如果不是 GENERIC 类型,或创建循环,或超过深度限制
src/domain/services/node_registry.py:246
↓ 67 callersMethodconnect
连接客户端 参数: websocket: WebSocket连接对象 workflow_id: 工作流ID client_id: 客户端ID(可选) send_initial_state
src/infrastructure/websocket/canvas_sync.py:271
↓ 67 callersMethodjson
模拟 httpx.Response.json()
tests/unit/infrastructure/executors/test_http_executor.py:78
↓ 66 callersMethodrun
执行任务并返回结果文本
src/domain/ports/task_runner.py:25
↓ 64 callersMethodclose
(self)
tests/integration/test_agent_websocket_e2e.py:41
↓ 64 callersMethodupdate
更新工具(先移除再添加)
src/domain/services/tool_engine.py:195
↓ 62 callersMethodcreate
创建节点实例 参数: node_type: 节点类型 config: 节点配置 node_id: 可选,节点ID(不提供则自动生成) 返回: 节点实例
src/domain/services/node_registry.py:874
↓ 62 callersMethodcreate_node
根据决策创建节点 参数: decision: 决策字典,包含node_type、config、parent_id、collapsed、children 返回: 创建的节点
src/domain/agents/workflow_agent.py:772
↓ 61 callersMethodadd_child
添加子节点 只有 GENERIC 类型节点可以添加子节点。 子节点深度不能超过 MAX_NODE_DEFINITION_DEPTH。 参数: child: 要添加的子节点 异常: V
src/domain/agents/node_definition.py:250
↓ 61 callersMethodemit_thinking
发送思考步骤
src/domain/services/reliable_emitter.py:437
↓ 60 callersMethodget
获取定义
src/domain/services/unified_definition.py:270
↓ 60 callersMethodparse_and_validate
解析和验证工作流动作 参数: raw_content: LLM 返回的原始内容 context: 执行上下文 parse_attempt: 当前解析尝试次数(1-3) 返回:
src/application/services/workflow_action_parser.py:43
↓ 60 callersMethodupdate_token_usage
更新 token 使用情况 参数: prompt_tokens: 本轮使用的 prompt tokens completion_tokens: 本轮使用的 completion tokens
src/domain/entities/session_context.py:324
↓ 58 callersMethodrun_async
(self, user_input: str)
tests/integration/api/conversation/test_stream_uses_orchestrator.py:22
↓ 57 callersMethodrollback
(self)
src/infrastructure/database/transaction_manager.py:17
↓ 56 callersMethodexecute
执行数据转换节点 参数: node: 节点实体 inputs: 输入数据(来自前驱节点) context: 执行上下文 返回: 转换后的数据
src/infrastructure/executors/transform_executor.py:33
↓ 56 callersMethodset_variable
设置工作流变量 参数: name: 变量名 value: 变量值
src/domain/services/context_bridge.py:222
↓ 55 callersMethodadd_node
添加节点到工作流 支持三种调用方式: 1. add_node(node_definition) - 传入NodeDefinition对象 2. add_node(node) - 传入Node对象 3. add_node(node_id
src/domain/agents/workflow_agent.py:848
↓ 55 callersMethodexecute
执行循环 参数: config: 循环配置 inputs: 输入数据 返回: 循环执行结果
src/domain/services/advanced_executors.py:203
↓ 55 callersMethodmap
Map a planning event to one or more PlanningEvents. A single domain event may produce multiple PlanningEvents. For example, ReActStep
src/application/services/planning_event_mapper.py:128
↓ 53 callersMethodwrite
写入日志
src/domain/services/logging_metrics.py:284
↓ 51 callersMethodappend
追加消息到数据库 Args: message: 要保存的消息实体 Raises: DatabaseWriteError: 数据库写入失败时
src/infrastructure/memory/database_memory_store.py:53
↓ 50 callersMethodcommit
(self)
tests/integration/api/test_sse_disconnect_reconnect.py:417
↓ 50 callersMethodcreate
创建 Run 的工厂方法 Args: project_id: 项目 ID(workflow run) workflow_id: 工作流 ID(workflow run) agent_id: Agent ID(a
src/domain/entities/run.py:57
↓ 50 callersMethodstart
启动 Run (CREATED/PENDING → RUNNING) Raises: DomainError: 当前状态不是 CREATED/PENDING
src/domain/entities/run.py:169
↓ 49 callersMethodadd_message
添加消息到历史 参数: content: 消息内容 is_user: 是否来自用户
src/domain/services/workflow_chat_service_enhanced.py:386
↓ 49 callersMethodcommit
(self)
tests/integration/api/workflow_chat/test_chat_stream_react_api.py:506
↓ 49 callersMethodevaluate
评估请求 参数: request: 保存请求对象(需要有 target_path, content, user_level 等属性) 返回: RuleEvaluationResult 评估结果
src/domain/services/configurable_rule_engine.py:388
↓ 48 callersMethodregister
注册执行器 参数: node_type: 节点类型 executor: 执行器实例
src/domain/ports/node_executor.py:50
↓ 47 callersMethodcomplete
完成 Run (RUNNING → COMPLETED) Raises: DomainError: 当前状态不是 RUNNING
src/domain/entities/run.py:184
↓ 47 callersMethodinvoke
调用 LLM 参数: prompt: Prompt 模板 input_data: 输入数据 返回: LLM 生成的文本
tests/unit/domain/agents/test_sales_analysis_workflow_integration.py:94
↓ 46 callersMethodadd_rule
添加规则 (DEPRECATED - use _rule_engine_facade.add_decision_rule) 参数: rule: 要添加的规则
src/domain/agents/coordinator_agent.py:1884
↓ 46 callersMethodfrom_dict
从字典反序列化 参数: data: 节点数据字典 返回: Node 实例
src/domain/services/node_registry.py:397
↓ 45 callersMethodexecute
(self, node: Node, inputs: dict[str, Any], context: dict[str, Any])
tests/unit/application/services/test_prd060_scenario_baseline.py:58
↓ 45 callersMethodget_variable
获取工作流变量 参数: name: 变量名 default: 默认值 返回: 变量值,或默认值
src/domain/services/context_bridge.py:231
↓ 45 callersMethodpack
打包上下文 Args: task_description: 任务描述 constraints: 约束条件 relevant_knowledge: 相关知识 input_
src/domain/services/context_protocol.py:326
↓ 45 callersMethodregister_node
注册节点到服务 参数: node: 要注册的节点
src/domain/services/node_hierarchy_service.py:103
↓ 44 callersMethodget_by_id
(self, workflow_id: str)
tests/unit/application/services/test_prd060_scenario_baseline.py:33
↓ 44 callersMethodset_model_info
设置模型信息 参数: provider: LLM 提供商名称 model: 模型名称 context_limit: 上下文窗口大小
src/domain/entities/session_context.py:309
↓ 43 callersMethodcommit
(self)
src/infrastructure/database/transaction_manager.py:14
↓ 43 callersMethodregister_executor
注册工具执行器 参数: handler_name: 处理器名称(与工具配置中的 entry.handler 对应) executor: 执行器实例
src/domain/services/tool_engine.py:763
↓ 42 callersMethodhandle_decision
处理决策 参数: decision: 决策字典 返回: 处理结果
src/domain/agents/workflow_agent.py:2347
↓ 42 callersMethodvalidate_decision
验证决策 (DEPRECATED - use _rule_engine_facade.validate_decision) 按优先级顺序检查所有规则。 参数: decision: 决策字典 返回:
src/domain/agents/coordinator_agent.py:1909
↓ 41 callersMethodfrom_yaml
从 YAML 字符串或字典解析 NodeDefinition 参数: yaml_content: YAML 内容字符串或已解析的字典 depth: 当前嵌套深度(用于深度限制检查) 返回: N
src/domain/agents/node_definition.py:698
↓ 40 callersMethodflush
刷新缓冲区
src/domain/services/logging_metrics.py:224
↓ 40 callersMethodregister_session
注册会话 参数: session_id: 会话ID websocket: WebSocket 连接 user_id: 用户ID
src/domain/agents/agent_channel.py:142
↓ 40 callersMethodto_dict
(self)
src/domain/exceptions.py:140
↓ 39 callersMethodexists
检查 Task 是否存在 业务语义: - 快速检查 Task 是否存在 - 不需要加载完整实体(性能优化) 参数: task_id: Task ID 返回: True
src/domain/ports/task_repository.py:199
↓ 39 callersMethodget
(self, *, where: dict[str, object], include: list[str])
tests/unit/infrastructure/knowledge_base/test_chroma_retriever_service.py:102
↓ 39 callersMethodsuccess
是否成功
src/domain/services/execution_result.py:89
↓ 38 callersMethodadd_error
添加错误
src/domain/services/node_yaml_validator.py:85
↓ 38 callersMethodhandle_node_failure
处理节点失败(委托给 WorkflowFailureOrchestrator) 根据配置的策略处理节点执行失败: - RETRY: 重试执行节点 - SKIP: 跳过节点继续执行 - ABORT: 终止工作流 - RE
src/domain/agents/coordinator_agent.py:2467
↓ 38 callersMethodparse
解析日志消息
src/domain/services/logging_metrics.py:645
↓ 38 callersMethodpublish
Publish an event (async).
src/domain/agents/conversation_agent_protocols.py:43
↓ 37 callersMethodget
获取策略 参数: strategy_id: 策略ID 返回: 策略字典
src/domain/services/supervision/strategy_repo.py:55
↓ 37 callersMethodregister
手动注册工具 参数: tool: Tool 实例
src/domain/services/tool_engine.py:603
↓ 36 callersMethodstart_monitoring
启动工作流状态监控 Phase 35.5: 委托给 WorkflowStateMonitor Phase 35.5.1: 写回 base_state 以支持状态恢复
src/domain/agents/coordinator_agent.py:2284
↓ 35 callersMethoddelete
(self, *, ids: list[object])
tests/unit/infrastructure/knowledge_base/test_chroma_retriever_service.py:106
↓ 35 callersMethodregister_version
注册新版本 Args: module_name: 模块名称 version: 版本号 template: 模板内容 variables: 变量列表 changel
src/domain/services/prompt_version_manager.py:252
↓ 35 callersMethodtransition_to
状态转换(同步版本) 注意:同步版本无法await事件发布,仅适用于非关键路径。 在异步上下文中请使用transition_to_async以保证关键事件顺序。 参数: new_state: 目标状态 异常
src/domain/agents/conversation_agent_state.py:311
↓ 34 callersMethodadd_rule
添加规则 参数: rule: 要添加的规则 异常: DuplicateRuleError: 规则ID已存在
src/domain/services/enhanced_rule_repository.py:132
↓ 34 callersMethodcreate_from_github
从GitHub OAuth信息创建用户 工厂方法:封装创建逻辑,确保不变式 Args: github_id: GitHub用户ID github_username: GitHub用户名 ema
src/domain/entities/user.py:69
↓ 34 callersMethodcreate_python_node
创建 Python 节点定义 参数: name: 节点名称 code: Python 代码 description: 节点描述 input_schema: 输入 Schema
src/domain/agents/node_definition.py:1232
↓ 34 callersFunctionseedWorkflow
(options: SeedWorkflowOptions)
web/tests/e2e/fixtures/workflowFixtures.ts:79
↓ 34 callersMethodvalidate
验证规划完整性 检查: 1. 所有节点定义是否有效 2. 边引用的节点是否存在 3. 默认错误策略是否有效 返回: 错误列表,空列表表示验证通过
src/domain/agents/workflow_plan.py:93
↓ 33 callersMethodcompress
压缩上下文包 Args: package: 原始上下文包 Returns: 压缩后的上下文包
src/domain/services/context_protocol.py:611
↓ 33 callersMethodexecute
执行工具 参数: tool_name: 工具名称 params: 调用参数 context: 执行上下文 返回: ToolExecutionResult 执行结果
src/domain/services/tool_engine.py:819
↓ 33 callersMethodget
获取工作流上下文
src/domain/services/context/service.py:15
↓ 33 callersMethodrecord_resource_usage
记录资源使用 参数: workflow_id: 工作流ID node_id: 节点ID memory_mb: 内存使用 (MB) cpu_percent: CPU 使用率 (%)
src/domain/services/supervision/efficiency.py:35
↓ 33 callersMethodset_task_result
存储本地任务结果 参数: task_name: 任务名称 result: 任务结果
src/domain/agents/subtask_executor.py:255
↓ 32 callersMethodadd_middleware
添加中间件 参数: middleware: 异步中间件函数,接收Event,返回Event或None 中间件职责: - 验证:检查事件合法性(如协调者验证决策) - 转换:修改或增强事件数据
src/domain/services/event_bus.py:165
↓ 32 callersMethodfind_by_id
(self, _tool_id: str)
tests/integration/api/workflow_chat/test_chat_create_stream_api.py:70
↓ 32 callersMethodlog_prompt_usage
记录提示词使用
src/domain/services/prompt_stability_monitor.py:250
next →1–100 of 13,770, ranked by callers