Compare commits
4 Commits
v1.0
...
999a21e2d9
| Author | SHA1 | Date | |
|---|---|---|---|
| 999a21e2d9 | |||
| 28797a83cc | |||
| 7591eb8cda | |||
| ef4528a441 |
@@ -1,5 +1,6 @@
|
|||||||
package tech.easyflow.ai.service.impl;
|
package tech.easyflow.ai.service.impl;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.idev.excel.EasyExcel;
|
import cn.idev.excel.EasyExcel;
|
||||||
import cn.idev.excel.ExcelWriter;
|
import cn.idev.excel.ExcelWriter;
|
||||||
import cn.idev.excel.FastExcel;
|
import cn.idev.excel.FastExcel;
|
||||||
@@ -8,7 +9,6 @@ import cn.idev.excel.metadata.data.ReadCellData;
|
|||||||
import cn.idev.excel.read.listener.ReadListener;
|
import cn.idev.excel.read.listener.ReadListener;
|
||||||
import cn.idev.excel.write.metadata.WriteSheet;
|
import cn.idev.excel.write.metadata.WriteSheet;
|
||||||
import cn.idev.excel.write.style.column.SimpleColumnWidthStyleStrategy;
|
import cn.idev.excel.write.style.column.SimpleColumnWidthStyleStrategy;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import com.easyagents.core.model.embedding.EmbeddingModel;
|
import com.easyagents.core.model.embedding.EmbeddingModel;
|
||||||
import com.easyagents.core.model.embedding.EmbeddingOptions;
|
import com.easyagents.core.model.embedding.EmbeddingOptions;
|
||||||
import com.easyagents.core.store.DocumentStore;
|
import com.easyagents.core.store.DocumentStore;
|
||||||
@@ -20,15 +20,15 @@ import com.mybatisflex.core.query.QueryWrapper;
|
|||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.nodes.Element;
|
import org.jsoup.nodes.Element;
|
||||||
import org.jsoup.select.Elements;
|
|
||||||
import org.jsoup.safety.Safelist;
|
import org.jsoup.safety.Safelist;
|
||||||
|
import org.jsoup.select.Elements;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.transaction.PlatformTransactionManager;
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
import org.springframework.transaction.TransactionDefinition;
|
import org.springframework.transaction.TransactionDefinition;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.support.TransactionTemplate;
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import tech.easyflow.ai.config.SearcherFactory;
|
import tech.easyflow.ai.config.SearcherFactory;
|
||||||
@@ -366,6 +366,15 @@ public class FaqItemServiceImpl extends ServiceImpl<FaqItemMapper, FaqItem> impl
|
|||||||
searcher.addDocument(doc);
|
searcher.addDocument(doc);
|
||||||
}
|
}
|
||||||
markCollectionEmbedded(collection, preparedStore.embeddingModel);
|
markCollectionEmbedded(collection, preparedStore.embeddingModel);
|
||||||
|
} catch (BusinessException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
LOG.error("FAQ vectorization failed. collectionId={}, faqId={}, isUpdate={}",
|
||||||
|
collection == null ? null : collection.getId(),
|
||||||
|
entity == null ? null : entity.getId(),
|
||||||
|
isUpdate,
|
||||||
|
e);
|
||||||
|
throw new BusinessException("FAQ向量化失败:请检查知识库绑定的向量模型、请求路径、维度或向量库配置");
|
||||||
} finally {
|
} finally {
|
||||||
DocumentStoreLifecycleSupport.closeQuietly(preparedStore.documentStore);
|
DocumentStoreLifecycleSupport.closeQuietly(preparedStore.documentStore);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,15 +13,6 @@
|
|||||||
/>
|
/>
|
||||||
<title><%= VITE_APP_TITLE %></title>
|
<title><%= VITE_APP_TITLE %></title>
|
||||||
<link rel="icon" href="/favicon.svg" />
|
<link rel="icon" href="/favicon.svg" />
|
||||||
<script>
|
|
||||||
var _hmt = _hmt || [];
|
|
||||||
(function () {
|
|
||||||
var hm = document.createElement('script');
|
|
||||||
hm.src = 'https://hm.baidu.com/hm.js?42639a1503843c26bc4d8b35185616d9';
|
|
||||||
var s = document.getElementsByTagName('script')[0];
|
|
||||||
s.parentNode.insertBefore(hm, s);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
import {
|
import './polyfills';
|
||||||
initPreferences,
|
|
||||||
preferences,
|
import {initPreferences, preferences, updatePreferences,} from '@easyflow/preferences';
|
||||||
updatePreferences,
|
|
||||||
} from '@easyflow/preferences';
|
|
||||||
import {unmountGlobalLoading} from '@easyflow/utils';
|
import {unmountGlobalLoading} from '@easyflow/utils';
|
||||||
|
|
||||||
import {
|
import {normalizeBrandAssetPreferences, overridesPreferences,} from './preferences';
|
||||||
normalizeBrandAssetPreferences,
|
|
||||||
overridesPreferences,
|
|
||||||
} from './preferences';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用初始化完成之后再进行页面加载渲染
|
* 应用初始化完成之后再进行页面加载渲染
|
||||||
|
|||||||
62
easyflow-ui-admin/app/src/polyfills.ts
Normal file
62
easyflow-ui-admin/app/src/polyfills.ts
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
const objectConstructor = Object as ObjectConstructor & {
|
||||||
|
hasOwn?: (object: unknown, property: PropertyKey) => boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (typeof objectConstructor.hasOwn !== 'function') {
|
||||||
|
Object.defineProperty(Object, 'hasOwn', {
|
||||||
|
configurable: true,
|
||||||
|
value(object: unknown, property: PropertyKey) {
|
||||||
|
if (object === null || object === undefined) {
|
||||||
|
throw new TypeError('Cannot convert undefined or null to object');
|
||||||
|
}
|
||||||
|
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
||||||
|
},
|
||||||
|
writable: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const arrayPrototype = Array.prototype as unknown[] & {
|
||||||
|
toReversed?: () => unknown[];
|
||||||
|
toSorted?: (compareFn?: (left: unknown, right: unknown) => number) => unknown[];
|
||||||
|
toSpliced?: (
|
||||||
|
start: number,
|
||||||
|
deleteCount?: number,
|
||||||
|
...items: unknown[]
|
||||||
|
) => unknown[];
|
||||||
|
};
|
||||||
|
|
||||||
|
if (typeof arrayPrototype.toReversed !== 'function') {
|
||||||
|
Object.defineProperty(Array.prototype, 'toReversed', {
|
||||||
|
configurable: true,
|
||||||
|
value() {
|
||||||
|
return Array.prototype.slice.call(this).reverse();
|
||||||
|
},
|
||||||
|
writable: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof arrayPrototype.toSorted !== 'function') {
|
||||||
|
Object.defineProperty(Array.prototype, 'toSorted', {
|
||||||
|
configurable: true,
|
||||||
|
value(compareFn?: (left: unknown, right: unknown) => number) {
|
||||||
|
return Array.prototype.slice.call(this).sort(compareFn);
|
||||||
|
},
|
||||||
|
writable: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof arrayPrototype.toSpliced !== 'function') {
|
||||||
|
Object.defineProperty(Array.prototype, 'toSpliced', {
|
||||||
|
configurable: true,
|
||||||
|
value(start: number, deleteCount?: number, ...items: unknown[]) {
|
||||||
|
const copy = Array.prototype.slice.call(this);
|
||||||
|
if (arguments.length === 1) {
|
||||||
|
copy.splice(start);
|
||||||
|
} else {
|
||||||
|
copy.splice(start, deleteCount as number, ...items);
|
||||||
|
}
|
||||||
|
return copy;
|
||||||
|
},
|
||||||
|
writable: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user