dgi.prompt_generation ​
AI-powered prompt generation
AI-powered prompt generation for DGI conversations.
Generates user-facing prompts when the system needs more information to complete a workflow.
Inputs:
- intent: The recognized user intent (required)
- workflow_params: Parameters required by the workflow (required)
- provided_params: Parameters already provided by the user (required)
- conversation_context: Recent conversation messages (optional)
- model: Optional model ID override (default: plugin.default_model)
Outputs (terminal state_data):
- prompt_type: "choice" | "text" | "confirm"
- prompt_message: The question to ask the user
- prompt_fields: List of fields to collect
- default_values: Any default values
- prompt_config: Full prompt configuration for frontend
Plugin required: context.get_plugin("ai")
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-dgi |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
intent | string | Yes | — | Recognized user intent |
workflow_params | json | Yes | — | Parameters required by the workflow |
provided_params | json | Yes | — | Parameters already provided |
conversation_context | list | No | — | Recent conversation messages |
model | string | No | — | Model ID override |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
intent | string | No | — | — |
workflow_params | json | No | — | — |
provided_params | json | No | — | — |
conversation_context | list | No | — | — |
model | string | No | — | — |
default_values | dict | No | — | — |
needs_prompt | boolean | No | — | — |
prompt_config | dict | No | — | — |
prompt_fields | string | No | — | — |
prompt_message | string | No | — | — |
prompt_type | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "dgi.prompt_generation",
"initial_data": {
"intent": "value",
"workflow_params": "value",
"provided_params": "value"
}
}