修改
This commit is contained in:
@@ -12,6 +12,7 @@ import org.xyzh.ai.client.DifyApiClient;
|
||||
import org.xyzh.ai.client.callback.StreamCallback;
|
||||
import org.xyzh.ai.client.dto.ChatRequest;
|
||||
import org.xyzh.ai.client.dto.ChatResponse;
|
||||
import org.xyzh.ai.config.DifyConfig;
|
||||
import org.xyzh.ai.exception.DifyException;
|
||||
import org.xyzh.ai.mapper.AiAgentConfigMapper;
|
||||
import org.xyzh.ai.mapper.AiConversationMapper;
|
||||
@@ -62,6 +63,9 @@ public class AiChatServiceImpl implements AiChatService {
|
||||
@Autowired
|
||||
private DifyApiClient difyApiClient;
|
||||
|
||||
@Autowired
|
||||
private DifyConfig difyConfig;
|
||||
|
||||
@Autowired
|
||||
private AiKnowledgeRedisService knowledgeRedisService;
|
||||
|
||||
@@ -278,6 +282,7 @@ public class AiChatServiceImpl implements AiChatService {
|
||||
Map<String, Object> inputs = new HashMap<>();
|
||||
inputs.put("connectInternet", agent.getConnectInternet());
|
||||
inputs.put("datasets", JSON.toJSONString(knowledgeIds));
|
||||
inputs.put("dataset_apikey", difyConfig.getKnowledgeApiKey());
|
||||
chatRequest.setInputs(inputs);
|
||||
chatRequest.setFiles(filesData);
|
||||
// 6. 调用Dify流式对话
|
||||
|
||||
Reference in New Issue
Block a user