Skip to content

docs: document streaming SSE events for chat and chatflow APIs#793

Open
RiskeyL wants to merge 2 commits into
mainfrom
fix/send-chat-message-api
Open

docs: document streaming SSE events for chat and chatflow APIs#793
RiskeyL wants to merge 2 commits into
mainfrom
fix/send-chat-message-api

Conversation

@RiskeyL
Copy link
Copy Markdown
Contributor

@RiskeyL RiskeyL commented May 26, 2026

Summary

Issue #791 reported that the streaming API response structure is documented inconsistently between Agent and Chatflow. While investigating, the Chat/Agent streaming docs turned out to reference a ChunkChatEvent schema that does not exist, and the mode field was documented as always chat, which is wrong for Agent apps.

This PR reworks the streaming (text/event-stream) response documentation for the send-chat-message endpoint in both specs and aligns their structure.

Changes

  • Replace the dead ChunkChatEvent reference with a code-verified event catalog, grouped into Reply, Workflow and node, and Transport tables.
  • Document the SSE parsing rules, stream lifecycle, and per-outcome closing sequences (success, failure, pause), verified against the Dify backend.
  • Cover the Human Input pause and resume handoff, linking to the Submit Human Input Form and Stream Workflow Events endpoints.
  • Fix the ChatCompletionResponse.mode field: it returns agent-chat for Agent apps, not always chat.
  • Sync the Chinese and Japanese translations for all of the above.

Close #791

Copilot AI review requested due to automatic review settings May 26, 2026 06:18
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 26, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
dify-core-product 🟢 Ready View Preview May 26, 2026, 6:20 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OpenAPI specs’ text/event-stream documentation for the Send Chat Message endpoint to better describe SSE parsing, the stream lifecycle, and the concrete event catalog across Chat and Chatflow APIs, and syncs these updates to Chinese/Japanese translations. It also corrects the documented ChatCompletionResponse.mode value for Agent apps.

Changes:

  • Rewrites the streaming (text/event-stream) response descriptions for Chat and Chatflow to include parsing rules, lifecycle, and event tables (including Human Input pause/resume flow for Chatflow).
  • Updates ChatCompletionResponse.mode docs to reflect agent-chat for Agent apps (instead of always chat).
  • Syncs equivalent updates across en/, zh/, and ja/ OpenAPI JSON specs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
en/api-reference/openapi_chat.json Expands Chat SSE streaming documentation and updates mode description.
en/api-reference/openapi_chatflow.json Expands Chatflow SSE streaming documentation (workflow/node/human-input events).
zh/api-reference/openapi_chat.json Chinese sync of Chat SSE streaming documentation and mode description.
zh/api-reference/openapi_chatflow.json Chinese sync of Chatflow SSE streaming documentation (workflow/node/human-input events).
ja/api-reference/openapi_chat.json Japanese sync of Chat SSE streaming documentation and mode description.
ja/api-reference/openapi_chatflow.json Japanese sync of Chatflow SSE streaming documentation (workflow/node/human-input events).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread en/api-reference/openapi_chat.json
Comment thread en/api-reference/openapi_chat.json
Comment thread zh/api-reference/openapi_chat.json
Comment thread zh/api-reference/openapi_chat.json
Comment thread ja/api-reference/openapi_chat.json
Comment thread zh/api-reference/openapi_chatflow.json Outdated
Comment thread ja/api-reference/openapi_chatflow.json Outdated
Comment thread ja/api-reference/openapi_chatflow.json Outdated
Comment thread ja/api-reference/openapi_chatflow.json Outdated
Comment thread ja/api-reference/openapi_chatflow.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS]: Send Chat Message

2 participants