package org.dromara.talk.service;

import org.dromara.talk.domain.vo.TalkAgentVo;

import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

public interface IDifyService {

   /**
    * 流式调用Dify工作流（按句子分段）
    */
   void callWorkflowStream(String userMessage, String agentGender, List<Map<String, String>> ttsVcnList,
                          TalkAgentVo agentConfig, Long userId, String conversationId, String customerPhone, Integer type,
                          Consumer<String> onTextChunk,
                          SentenceCallback onSentence);

   @FunctionalInterface
   interface SentenceCallback {
       void onSentence(String sentence, String conversationId, boolean isComplete);
   }
}
