类 StreamEventDispatcher

java.lang.Object
io.github.imfangs.dify.client.impl.StreamEventDispatcher

public class StreamEventDispatcher extends Object
流式事件分发器 负责将事件分发到对应的回调方法
  • 构造器详细资料

    • StreamEventDispatcher

      public StreamEventDispatcher()
  • 方法详细资料

    • dispatchChatFlowEvent

      public static void dispatchChatFlowEvent(ChatflowStreamCallback callback, String data, String eventType)
      分发工作流编排对话事件到对应的回调方法
      参数:
      callback - 回调接口
      data - 事件对象
      eventType - 事件类型
    • dispatchChatEvent

      public static void dispatchChatEvent(ChatStreamCallback callback, String data, String eventType)
      分发聊天事件到对应的回调方法
      参数:
      callback - 回调接口
      data - 原始JSON数据
      eventType - 事件类型
    • dispatchCompletionEvent

      public static void dispatchCompletionEvent(CompletionStreamCallback callback, String data)
      分发文本生成事件到对应的回调方法
      参数:
      callback - 回调接口
      data - 原始JSON数据
    • dispatchWorkflowEvent

      public static void dispatchWorkflowEvent(WorkflowStreamCallback callback, String data)
      分发工作流事件到对应的回调方法
      参数:
      callback - 回调接口
      data - 原始JSON数据