Author: svcvit Version: 0.0.3
A powerful task-oriented dialogue agent that can collect information through structured conversations. It supports dynamic field validation, multi-field information extraction, and state management. The agent now includes two dialogue strategies: TOD (Task-Oriented Dialogue) for information collection and MTD (Multi-Turn Dialogue) for general conversations.
- Task-oriented dialogue management
- Dynamic field validation
- Multi-field information extraction
- Conversation state persistence
- Automatic answer validation
- Context-aware information collection
- Natural language interaction
- Multiple dialogue strategies support (TOD & MTD)
The agent supports two dialogue strategies:
-
TOD (Task-Oriented Dialogue)
- A dialogue strategy for structured information collection
- Suitable for form filling and information gathering scenarios
- Supports dynamic field validation and state management
-
MTD (Multi-Turn Dialogue)
- A strategy for general multi-turn conversations
- Supports context awareness
- Suitable for open-ended dialogue scenarios
-
information_schema (Required)
- Type: string (JSON)
- Description: Schema defining the fields to collect
- Example:
{ "fields": [ { "name": "destination", "question": "请问您想去哪里旅行?", "required": true }, { "name": "duration", "question": "您计划旅行多长时间?", "required": true }, { "name": "budget", "question": "您的预算大约是多少?", "required": true } ] }
-
query (Required)
- Type: string
- Description: User's input text
-
model (Required)
- Type: AgentModelConfig
- Description: LLM model configuration
- Example: Configuration for GPT or other LLM models
-
storage_key (Required)
- Type: string
- Description: Unique key for storing conversation state
- Example:
"conversation-123"
-
instruction (Required)
- Type: string
- Description: Dialogue instruction or system prompt
- Example:
你是一个专业的医生。 - 问用户有什么不适症状 - 问用户最近有没有吃药 - 问如果用户回答吃药了,询问吃的什么药,以及剂量。 - 最后询问用户有没有药物过敏。 - 最后询问用户有没有其他症状。
-
query (Required)
- Type: string
- Description: User's input text
-
model (Required)
- Type: AgentModelConfig
- Description: LLM model configuration
- Example: Configuration for GPT or other LLM models
-
storage_key (Required)
- Type: string
- Description: Unique key for storing conversation state
- Example:
"mtd-conversation-123"
- Added MTD (Multi-Turn Dialogue) strategy support
- Fixed data type validation bugs
- Added support for schema JSON without leading spaces (compatible with Dify official update)
- Added logging functionality
- Added token usage statistics
- Optimized code structure and performance
- Project initialization
- Implemented multi-turn dialogue
- Implemented conversation state storage
- Implemented intelligent Q&A content extraction