package org.springblade.plugin.workflow.chat.service;

import io.github.imfangs.dify.client.DifyClient;
import io.github.imfangs.dify.client.model.chat.*;
import io.github.imfangs.dify.client.model.file.FileUploadResponse;
import org.springblade.core.tool.api.R;
import org.springblade.plugin.workflow.chat.pojo.vo.WfChatMessageVO;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

public interface IWfChatService {

	/**
	 * 发送消息
	 */
	SseEmitter chatMessage(WfChatMessageVO chatMessage);

	/**
	 * 停止响应
	 */
	void stopMessage(WfChatMessageVO chatMessage);

	/**
	 * 消息列表
	 */
	R<MessageListResponse> messages(WfChatMessageVO chatMessage);

	/**
	 * 下一步建议
	 */
	R<SuggestedQuestionsResponse> messageSuggested(WfChatMessageVO chatMessage);

	/**
	 * 会话列表
	 */
	R<ConversationListResponse> conversations(Long appsId, String lastId);

	/**
	 * 重命名会话
	 */
	R<Conversation> renameConversation(WfChatMessageVO chatMessage);

	/**
	 * 删除会话
	 */
	void deleteConversation(WfChatMessageVO chatMessage);

	/**
	 * 上传文件
	 */
	R<FileUploadResponse> upload(Long appId, MultipartFile file);

	/**
	 * 获取应用参数
	 */
	R<AppParametersResponse> parameters(WfChatMessageVO chatMessage);

	/**
	 * 获取应用基本信息
	 */
	R<AppInfoResponse> info(WfChatMessageVO chatMessageVO);

	/**
	 * 获取dify客户端
	 */
	DifyClient getDifyClient(Long appId);
}
