Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移除 MongoDB 作为向量数据库的方式 #347

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions packages/vector-store-service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export interface Config extends ChatLunaPlugin.Config {
milvusUrl: string
milvusUsername: string
milvusPassword: string

mongodbUrl: string
mongodbDbName: string
mongodbCollectionName: string
}

export const Config: Schema<Config> = Schema.intersect([
Expand All @@ -39,8 +35,7 @@ export const Config: Schema<Config> = Schema.intersect([
Schema.const('faiss').description('Faiss'),
Schema.const('redis').description('Redis'),
Schema.const('milvus').description('Milvus'),
Schema.const('luna-vdb').description('lunavdb'),
Schema.const('mongodb').description('MongoDB Atlas')
Schema.const('luna-vdb').description('lunavdb')
])
)
.default(['luna-vdb'])
Expand All @@ -57,14 +52,6 @@ export const Config: Schema<Config> = Schema.intersect([
.default('http://127.0.0.1:19530'),
milvusUsername: Schema.string().default(''),
milvusPassword: Schema.string().role('secret').default('')
}),

Schema.object({
mongodbUrl: Schema.string()
.role('url')
.default('mongodb://localhost:27017'),
mongodbDbName: Schema.string().default('chatluna'),
mongodbCollectionName: Schema.string().default('chatluna_collection')
})
]).i18n({
'zh-CN': require('./locales/zh-CN.schema.yml'),
Expand All @@ -82,8 +69,6 @@ export const usage = `

要查看如何配置 Milvus 数据库,看[这里](https://js.langchain.com/docs/integrations/vectorstores/milvus/)

要查看如何配置 MongoDB 数据库,看[这里](https://js.langchain.com/docs/integrations/vectorstores/mongodb_atlas/)

目前配置 Faiss 数据库安装后可能会导致 koishi 环境不安全,如果安装完成后进行某些操作完成后出现了问题(如,升级 node 版本),开发者不对此负直接责任。
`

Expand Down
4 changes: 0 additions & 4 deletions packages/vector-store-service/src/locales/en-US.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ $inner:
milvusUrl: Milvus URL Address
milvusUsername: Milvus Username
milvusPassword: Milvus Password
- $desc: MongoDB Database Settings
mongodbUrl: MongoDB URL Address
mongodbDbName: MongoDB Database Name
mongodbCollectionName: MongoDB Collection Name
4 changes: 0 additions & 4 deletions packages/vector-store-service/src/locales/zh-CN.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ $inner:
milvusUrl: Milvus url 地址
milvusUsername: Milvus 用户名
milvusPassword: Milvus 密码
- $desc: MongoDB 数据库设置
mongodbUrl: MongoDB url 地址
mongodbDbName: MongoDB 数据库名
mongodbCollectionName: MongoDB 集合名
3 changes: 1 addition & 2 deletions packages/vector-store-service/src/vectorstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Config } from '.'
import { apply as faiss } from './vectorstore/faiss'
import { apply as lunavdb } from './vectorstore/lunavdb'
import { apply as milvus } from './vectorstore/milvus'
import { apply as mongodb } from './vectorstore/mongodb'
import { apply as redis } from './vectorstore/redis' // import end

export async function vectorStore(
Expand All @@ -21,7 +20,7 @@ export async function vectorStore(

const middlewares: VectorStore[] =
// middleware start
[faiss, lunavdb, milvus, mongodb, redis] // middleware end
[faiss, lunavdb, milvus, redis] // middleware end

for (const middleware of middlewares) {
try {
Expand Down
127 changes: 0 additions & 127 deletions packages/vector-store-service/src/vectorstore/mongodb.ts

This file was deleted.

Loading