dgi.ai_chat ​
AI-powered chat for DGI conversations
AI-powered chat for DGI conversations.
Uses the AI plugin to provide conversational responses about infrastructure automation.
Inputs:
- messages: List of {role, content} message objects (required). Roles: user, assistant, system.
- system_prompt: Optional system instruction override.
- model: Optional model ID override (default: plugin.default_model).
- temperature: Optional temperature 0.0-2.0 (default: 0.7).
- max_tokens: Optional max tokens (default: 1024).
Outputs (terminal state_data):
- response: str — assistant reply text
- role: str — always "assistant"
- finish_reason: str — stop | length | tool_calls
- model: str — model ID used
- usage: dict — token usage
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 |
|---|---|---|---|---|
messages | json | Yes | — | List of {role, content} message objects |
system_prompt | string | No | — | System instruction override |
model | string | No | — | Model ID override |
temperature | json | No | — | Temperature 0.0-2.0 |
max_tokens | integer | No | — | Max tokens to generate |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
messages | json | No | — | — |
system_prompt | string | No | — | — |
model | string | No | — | — |
temperature | json | No | — | — |
max_tokens | integer | No | — | — |
finish_reason | string | No | — | — |
response | string | No | — | — |
role | string | No | — | — |
usage | dict | 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.ai_chat",
"initial_data": {
"messages": "value"
}
}