Compare commits
2 Commits
bbe8866cce
...
66da76bbcc
| Author | SHA1 | Date | |
|---|---|---|---|
| 66da76bbcc | |||
| 96e9419496 |
@@ -7,7 +7,7 @@ app:
|
|||||||
use_icon_as_answer_icon: false
|
use_icon_as_answer_icon: false
|
||||||
dependencies: []
|
dependencies: []
|
||||||
kind: app
|
kind: app
|
||||||
version: 0.4.0
|
version: 0.5.0
|
||||||
workflow:
|
workflow:
|
||||||
conversation_variables: []
|
conversation_variables: []
|
||||||
environment_variables: []
|
environment_variables: []
|
||||||
@@ -136,7 +136,16 @@ workflow:
|
|||||||
required: true
|
required: true
|
||||||
type: text-input
|
type: text-input
|
||||||
variable: query
|
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'
|
id: '1747125462435'
|
||||||
position:
|
position:
|
||||||
x: 80
|
x: 80
|
||||||
@@ -250,7 +259,7 @@ workflow:
|
|||||||
}'
|
}'
|
||||||
type: json
|
type: json
|
||||||
desc: ''
|
desc: ''
|
||||||
headers: 'Authorization:Bearer dataset-DCyO89dHNWmsXMzJaWCCQOKo
|
headers: 'Authorization:Bearer {{#1747125462435.dataset_apikey#}}
|
||||||
|
|
||||||
Content-Type:application/json'
|
Content-Type:application/json'
|
||||||
isInIteration: true
|
isInIteration: true
|
||||||
@@ -260,7 +269,7 @@ workflow:
|
|||||||
params: ''
|
params: ''
|
||||||
retry_config:
|
retry_config:
|
||||||
max_retries: 3
|
max_retries: 3
|
||||||
retry_enabled: true
|
retry_enabled: false
|
||||||
retry_interval: 100
|
retry_interval: 100
|
||||||
selected: false
|
selected: false
|
||||||
ssl_verify: true
|
ssl_verify: true
|
||||||
@@ -272,7 +281,7 @@ workflow:
|
|||||||
type: http-request
|
type: http-request
|
||||||
url: http://nginx:80/v1/datasets/{{#1747125586388.item#}}/retrieve
|
url: http://nginx:80/v1/datasets/{{#1747125586388.item#}}/retrieve
|
||||||
variables: []
|
variables: []
|
||||||
height: 157
|
height: 111
|
||||||
id: '1747125795256'
|
id: '1747125795256'
|
||||||
parentId: '1747125586388'
|
parentId: '1747125586388'
|
||||||
position:
|
position:
|
||||||
@@ -351,7 +360,7 @@ workflow:
|
|||||||
type: custom
|
type: custom
|
||||||
width: 242
|
width: 242
|
||||||
viewport:
|
viewport:
|
||||||
x: 116.27083894320822
|
x: -967.224047730792
|
||||||
y: 126.27330841264018
|
y: 147.70051636546336
|
||||||
zoom: 0.8705505632961247
|
zoom: 0.8705505632961247
|
||||||
rag_pipeline_variables: []
|
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.callback.StreamCallback;
|
||||||
import org.xyzh.ai.client.dto.ChatRequest;
|
import org.xyzh.ai.client.dto.ChatRequest;
|
||||||
import org.xyzh.ai.client.dto.ChatResponse;
|
import org.xyzh.ai.client.dto.ChatResponse;
|
||||||
|
import org.xyzh.ai.config.DifyConfig;
|
||||||
import org.xyzh.ai.exception.DifyException;
|
import org.xyzh.ai.exception.DifyException;
|
||||||
import org.xyzh.ai.mapper.AiAgentConfigMapper;
|
import org.xyzh.ai.mapper.AiAgentConfigMapper;
|
||||||
import org.xyzh.ai.mapper.AiConversationMapper;
|
import org.xyzh.ai.mapper.AiConversationMapper;
|
||||||
@@ -62,6 +63,9 @@ public class AiChatServiceImpl implements AiChatService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DifyApiClient difyApiClient;
|
private DifyApiClient difyApiClient;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DifyConfig difyConfig;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AiKnowledgeRedisService knowledgeRedisService;
|
private AiKnowledgeRedisService knowledgeRedisService;
|
||||||
|
|
||||||
@@ -278,6 +282,7 @@ public class AiChatServiceImpl implements AiChatService {
|
|||||||
Map<String, Object> inputs = new HashMap<>();
|
Map<String, Object> inputs = new HashMap<>();
|
||||||
inputs.put("connectInternet", agent.getConnectInternet());
|
inputs.put("connectInternet", agent.getConnectInternet());
|
||||||
inputs.put("datasets", JSON.toJSONString(knowledgeIds));
|
inputs.put("datasets", JSON.toJSONString(knowledgeIds));
|
||||||
|
inputs.put("dataset_apikey", difyConfig.getKnowledgeApiKey());
|
||||||
chatRequest.setInputs(inputs);
|
chatRequest.setInputs(inputs);
|
||||||
chatRequest.setFiles(filesData);
|
chatRequest.setFiles(filesData);
|
||||||
// 6. 调用Dify流式对话
|
// 6. 调用Dify流式对话
|
||||||
|
|||||||
Reference in New Issue
Block a user