automated_api/src/modules/know/config.ts
lixin 0afa56d652 build(automated): 更新项目依赖并调整配置
- 更新项目名称为 automated
- 更新多个依赖包版本,包括 @cool-midway、@midwayjs、@langchain 等
- 更新作者信息为 lixin&liqiannan
- 更新 TypeScript 版本至 5.5.4
- 添加 newman、prettier 等新依赖
- 优化 package.json 结构和格式
2025-01-09 17:58:04 +08:00

44 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ModuleConfig } from '@cool-midway/core';
import { UnstructuredLoaderOptions } from '@langchain/community/document_loaders/fs/unstructured';
import { StoreTypes } from './store';
/**
* 模块配置
*/
export default () => {
return {
// 模块名称
name: '知识库',
// 模块描述
description: '知识库,检索,向量存储等',
// 中间件,只对本模块有效
middlewares: [],
// 中间件,全局有效
globalMiddlewares: [],
// 模块加载顺序默认为0值越大越优先加载
order: 0,
// 向量数据存储默认为faiss
store: 'chroma' as StoreTypes,
// chroma 配置
chroma: {
// 服务地址
url: 'http://120.48.5.80/:8000',
// 距离计算方式 可选 l2、cosine、ip
distance: 'l2',
// 重试次数,向量化失败时重试
retry: 10,
// 重试间隔单位ms
retryInterval: 1000,
},
// 集合前缀
prefix: 'COOL_',
// Unstructured 配置,用于处理非结构化数据
unstructured: {
// 服务地址,可以使用云服务,也可以自己部署
apiUrl: 'https://api.unstructured.io/general/v0/general',
// api key, 如果是自己部署的服务,可以不填
apiKey: 'xxx',
} as UnstructuredLoaderOptions,
} as ModuleConfig;
};