Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete and Outdated Features in webapp-conversation Template Project #116

Open
yjc980121 opened this issue Nov 20, 2024 · 1 comment

Comments

@yjc980121
Copy link

Issue: Incomplete and Outdated Features in webapp-conversation Template Project

Summary:

The webapp-conversation template project appears to be missing several key features and is not fully synchronized with the latest version of the Dify API and SDK. Specifically, the following issues have been identified:

  1. Lack of Streaming Output: The current implementation does not support streaming output. Instead, it outputs all data at once during the onMessageEnd event. Although the ssePost function is present in the code, it does not seem to be functioning as expected.

  2. Missing Citations and Attributions: The template does not display the source of the documentation (current message and historical messages).

  3. No TTS (Text-to-Speech) Support: The template lacks support for TTS, which is a feature available in the latest Dify API.

Detailed Analysis:

Upon investigation, it was found that the ssePost function in the webapp-conversation template project only handles a limited set of events:

  • onData
  • onCompleted
  • onThought
  • onFile
  • onMessageEnd
  • onMessageReplace
  • onWorkflowStarted
  • onWorkflowFinished
  • onNodeStarted
  • onNodeFinished
  • onError

However, the latest version of the Dify API includes additional events that are not currently supported in the webapp-conversation template:

  • onIterationStart
  • onIterationNext
  • onIterationFinish
  • onParallelBranchStarted
  • onParallelBranchFinished
  • onTextChunk
  • onTTSChunk
  • onTTSEnd
  • onTextReplace
  • getAbortController

While some of these events may not be applicable to conversational applications, many of them are essential for fully utilizing the capabilities of the Dify API.

Additionally, the dify_client library (JavaScript SDK) used in the template project appears to be outdated and not synchronized with the latest Dify API.

Recommendations:

  1. Update the ssePost Function: Ensure that the ssePost function in the webapp-conversation template project supports all relevant events from the latest Dify API.

  2. Implement Streaming Output: Modify the implementation to support streaming output, allowing data to be sent incrementally rather than all at once.

  3. Add Citations and Attributions: Implement functionality to display the source of the documentation (current and historical messages).

  4. Include TTS Support: Add support for Text-to-Speech (TTS) using the onTTSChunk and onTTSEnd events.

  5. Synchronize with Latest SDK: Update the dify_client library to the latest version and ensure that all features are fully supported in the webapp-conversation template project.

Conclusion:

The webapp-conversation template project is currently missing several key features and is not aligned with the latest Dify API and SDK. To fully leverage the capabilities of Dify, it is essential to update the template project to support all relevant events and features, including streaming output, citations and attributions, and TTS.


Note: This issue is intended to highlight the discrepancies and suggest improvements. No immediate action is expected, but it is recommended to address these issues in future updates.

@remisharrock
Copy link

Thank your for this detailed issue, mine is less detailed but I had the same questions : #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants