dify/api/constants
Yansong Zhang 96641a93f6 feat(api): add Agent V2 node and new Agent app type (Phase 1-3)
Introduce a new unified Agent V2 workflow node that combines LLM capabilities
with agent tool-calling loops, along with a new AppMode.AGENT for standalone
agent apps backed by single-node workflows.

Phase 1 — Agent Patterns:
- Add core/agent/patterns/ module (AgentPattern, FunctionCallStrategy,
  ReActStrategy, StrategyFactory) ported from feat/support-agent-sandbox
- Add ExecutionContext, AgentLog, AgentResult entities
- Add Tool.to_prompt_message_tool() for LLM-consumable tool conversion

Phase 2 — Agent V2 Workflow Node:
- Add core/workflow/nodes/agent_v2/ (AgentV2Node, AgentV2NodeData,
  AgentV2ToolManager, AgentV2EventAdapter)
- Register agent-v2 node type in DifyNodeFactory
- No-tools path: single LLM call (LLM Node equivalent)
- Tools path: FC/ReAct loop via StrategyFactory

Phase 3 — Agent App Type:
- Add AppMode.AGENT to model enum
- Add WorkflowGraphFactory for auto-generating start->agent_v2->answer graphs
- AppService.create_app() creates workflow draft for AGENT mode
- AppGenerateService.generate() routes AGENT to AdvancedChatAppGenerator
- Console API and DSL import/export support AGENT mode
- Default app template for AGENT mode

Old agent/agent-chat/LLM node paths are fully preserved.
38 unit tests all passing.

Made-with: Cursor
2026-04-08 12:31:23 +08:00
..
__init__.py chore: normalize frozenset literals and myscale typing (#34327) 2026-03-31 08:21:22 +00:00
languages.py feat: support nl-NL language (#32216) 2026-02-11 10:42:13 +08:00
mimetypes.py feat(api): Add image multimodal support for LLMNode (#17372) 2025-04-30 17:28:02 +08:00
model_template.py feat(api): add Agent V2 node and new Agent app type (Phase 1-3) 2026-04-08 12:31:23 +08:00
pipeline_templates.json fix: add missing pipeline_templates (#31528) 2026-03-01 17:33:04 +08:00
recommended_apps.json Fix variable typo (#8084) 2024-09-08 13:14:11 +08:00
tts_auto_play_timeout.py feat:add tts-streaming config and future (#5492) 2024-07-09 11:33:58 +08:00