fix
This commit is contained in:
parent
d3fb2d829a
commit
e6d2567de8
@ -54,7 +54,9 @@ public class LLMAppServiceImpl implements LLMAppService {
|
|||||||
@Override
|
@Override
|
||||||
public SseEmitter ask(String llmToken, String question, Map<String, Object> params) throws Exception {
|
public SseEmitter ask(String llmToken, String question, Map<String, Object> params) throws Exception {
|
||||||
SseEmitter emitter = new SseEmitter(300 * 1000L); // 超时时间设为5分钟
|
SseEmitter emitter = new SseEmitter(300 * 1000L); // 超时时间设为5分钟
|
||||||
List<WorkspaceAttachment> pinnedDocs = pinDocsByKeywords(llmToken, ConstantConfig.DEFAULT_SLUG_ID, extractKeywords(question), question);
|
List<String> keywords = extractKeywords(question);
|
||||||
|
log.info("正在回答问题: question: {}, keywords: {}", question, JSONUtil.toJsonStr(keywords));
|
||||||
|
List<WorkspaceAttachment> pinnedDocs = pinDocsByKeywords(llmToken, ConstantConfig.DEFAULT_SLUG_ID, keywords, question);
|
||||||
|
|
||||||
ThreadPoolUtil.execute(() -> {
|
ThreadPoolUtil.execute(() -> {
|
||||||
try {
|
try {
|
||||||
@ -72,6 +74,7 @@ public class LLMAppServiceImpl implements LLMAppService {
|
|||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// 问题结束后,需要unpin掉
|
// 问题结束后,需要unpin掉
|
||||||
|
log.info("问题已回答完成: question: {}, pinnedDocs: {}", question, JSONUtil.toJsonStr(pinnedDocs));
|
||||||
pinnedDocs.forEach(doc -> {
|
pinnedDocs.forEach(doc -> {
|
||||||
try {
|
try {
|
||||||
anythingLLMService.updatePin(llmToken, ConstantConfig.DEFAULT_SLUG_ID, doc.getDocpath(), false);
|
anythingLLMService.updatePin(llmToken, ConstantConfig.DEFAULT_SLUG_ID, doc.getDocpath(), false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user