Compare commits
2 Commits
bbe8866cce
...
66da76bbcc
| Author | SHA1 | Date | |
|---|---|---|---|
| 66da76bbcc | |||
| 96e9419496 |
@@ -7,7 +7,7 @@ app:
|
||||
use_icon_as_answer_icon: false
|
||||
dependencies: []
|
||||
kind: app
|
||||
version: 0.4.0
|
||||
version: 0.5.0
|
||||
workflow:
|
||||
conversation_variables: []
|
||||
environment_variables: []
|
||||
@@ -136,7 +136,16 @@ workflow:
|
||||
required: true
|
||||
type: text-input
|
||||
variable: query
|
||||
height: 114
|
||||
- default: ''
|
||||
hint: ''
|
||||
label: dataset_apikey
|
||||
max_length: 100
|
||||
options: []
|
||||
placeholder: ''
|
||||
required: true
|
||||
type: text-input
|
||||
variable: dataset_apikey
|
||||
height: 161
|
||||
id: '1747125462435'
|
||||
position:
|
||||
x: 80
|
||||
@@ -250,7 +259,7 @@ workflow:
|
||||
}'
|
||||
type: json
|
||||
desc: ''
|
||||
headers: 'Authorization:Bearer dataset-DCyO89dHNWmsXMzJaWCCQOKo
|
||||
headers: 'Authorization:Bearer {{#1747125462435.dataset_apikey#}}
|
||||
|
||||
Content-Type:application/json'
|
||||
isInIteration: true
|
||||
@@ -260,7 +269,7 @@ workflow:
|
||||
params: ''
|
||||
retry_config:
|
||||
max_retries: 3
|
||||
retry_enabled: true
|
||||
retry_enabled: false
|
||||
retry_interval: 100
|
||||
selected: false
|
||||
ssl_verify: true
|
||||
@@ -272,7 +281,7 @@ workflow:
|
||||
type: http-request
|
||||
url: http://nginx:80/v1/datasets/{{#1747125586388.item#}}/retrieve
|
||||
variables: []
|
||||
height: 157
|
||||
height: 111
|
||||
id: '1747125795256'
|
||||
parentId: '1747125586388'
|
||||
position:
|
||||
@@ -351,7 +360,7 @@ workflow:
|
||||
type: custom
|
||||
width: 242
|
||||
viewport:
|
||||
x: 116.27083894320822
|
||||
y: 126.27330841264018
|
||||
x: -967.224047730792
|
||||
y: 147.70051636546336
|
||||
zoom: 0.8705505632961247
|
||||
rag_pipeline_variables: []
|
||||
|
||||
@@ -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