@lobehub/chat 1.114.3 → 1.114.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/scripts/docker-pr-comment.js +89 -0
- package/.github/workflows/docker-database.yml +21 -0
- package/.github/workflows/release.yml +7 -5
- package/.github/workflows/test.yml +9 -7
- package/CHANGELOG.md +25 -0
- package/Dockerfile.database +1 -1
- package/changelog/v1.json +9 -0
- package/codecov.yml +30 -2
- package/docs/development/database-schema.dbml +14 -0
- package/drizzle.config.ts +2 -2
- package/package.json +5 -5
- package/packages/const/src/index.ts +2 -0
- package/{src/utils → packages/const/src/settings}/genUserLLMConfig.test.ts +1 -1
- package/{src/utils → packages/const/src/settings}/genUserLLMConfig.ts +1 -1
- package/packages/const/src/settings/index.ts +0 -2
- package/packages/const/src/settings/llm.ts +1 -1
- package/{src → packages}/database/migrations/0028_oauth_handoffs.sql +1 -1
- package/{src → packages}/database/migrations/0029_add_apikey_manage.sql +1 -1
- package/packages/database/package.json +24 -0
- package/{src/database → packages/database/src}/client/db.ts +2 -2
- package/{src/database → packages/database/src}/core/db-adaptor.ts +3 -3
- package/{src/database → packages/database/src}/core/dbForTest.ts +1 -1
- package/{src/database → packages/database/src}/core/electron.ts +3 -3
- package/{src/database/client → packages/database/src/core}/migrations.json +12 -2
- package/{src/database → packages/database/src}/core/web-server.ts +2 -3
- package/{src/database → packages/database/src}/models/__tests__/_test_template.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/_util.ts +3 -3
- package/{src/database → packages/database/src}/models/__tests__/agent.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/aiModel.test.ts +1 -1
- package/{src/database → packages/database/src}/models/__tests__/aiProvider.test.ts +1 -1
- package/{src/database → packages/database/src}/models/__tests__/asyncTask.test.ts +1 -1
- package/{src/database → packages/database/src}/models/__tests__/chunk.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/file.test.ts +1 -1
- package/{src/database → packages/database/src}/models/__tests__/generation.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/generationBatch.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/generationTopic.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/knowledgeBase.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/message.test.ts +2 -2
- package/{src/database → packages/database/src}/models/__tests__/plugin.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/session.test.ts +2 -2
- package/{src/database → packages/database/src}/models/__tests__/sessionGroup.test.ts +1 -2
- package/{src/database → packages/database/src}/models/__tests__/topic.test.ts +1 -2
- package/{src/database → packages/database/src}/models/_template.ts +1 -2
- package/{src/database → packages/database/src}/models/agent.ts +2 -2
- package/{src/database → packages/database/src}/models/aiModel.ts +1 -1
- package/{src/database → packages/database/src}/models/aiProvider.ts +1 -1
- package/{src/database → packages/database/src}/models/apiKey.ts +1 -1
- package/{src/database → packages/database/src}/models/asyncTask.ts +1 -1
- package/{src/database → packages/database/src}/models/chunk.ts +1 -1
- package/{src/database → packages/database/src}/models/document.ts +1 -1
- package/{src/database → packages/database/src}/models/drizzleMigration.ts +1 -1
- package/{src/database → packages/database/src}/models/embedding.ts +1 -1
- package/{src/database → packages/database/src}/models/file.ts +1 -1
- package/{src/database → packages/database/src}/models/generation.ts +1 -1
- package/{src/database → packages/database/src}/models/generationBatch.ts +1 -1
- package/{src/database → packages/database/src}/models/generationTopic.ts +1 -1
- package/{src/database → packages/database/src}/models/knowledgeBase.ts +1 -1
- package/{src/database → packages/database/src}/models/message.ts +3 -3
- package/{src/database → packages/database/src}/models/oauthHandoff.ts +1 -1
- package/{src/database → packages/database/src}/models/plugin.ts +1 -1
- package/{src/database → packages/database/src}/models/session.ts +3 -3
- package/{src/database → packages/database/src}/models/sessionGroup.ts +2 -2
- package/{src/database → packages/database/src}/models/thread.ts +1 -1
- package/{src/database → packages/database/src}/models/topic.ts +3 -3
- package/{src/database → packages/database/src}/models/user.ts +1 -1
- package/{src/database → packages/database/src}/repositories/aiInfra/index.ts +4 -3
- package/{src/database → packages/database/src}/repositories/dataExporter/index.ts +2 -2
- package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/index.test.ts +2 -2
- package/{src/database → packages/database/src}/repositories/dataImporter/deprecated/index.ts +6 -5
- package/{src/database → packages/database/src}/repositories/dataImporter/index.ts +2 -2
- package/{src/database → packages/database/src}/repositories/tableViewer/index.test.ts +1 -1
- package/{src/database → packages/database/src}/repositories/tableViewer/index.ts +2 -1
- package/{src/database → packages/database/src}/schemas/agent.ts +1 -1
- package/{src/database → packages/database/src}/schemas/aiInfra.ts +3 -2
- package/{src/database → packages/database/src}/schemas/document.ts +2 -2
- package/{src/database → packages/database/src}/schemas/file.ts +1 -1
- package/{src/database → packages/database/src}/schemas/generation.ts +1 -1
- package/{src/database → packages/database/src}/schemas/message.ts +1 -1
- package/{src/database → packages/database/src}/schemas/ragEvals.ts +1 -1
- package/{src/database → packages/database/src}/schemas/relations.ts +1 -2
- package/{src/database → packages/database/src}/schemas/session.ts +1 -2
- package/{src/database → packages/database/src}/schemas/topic.ts +2 -2
- package/{src/database → packages/database/src}/server/models/__tests__/adapter.test.ts +5 -4
- package/{src/database → packages/database/src}/server/models/__tests__/nextauth.test.ts +4 -4
- package/{src/database → packages/database/src}/server/models/__tests__/user.test.ts +1 -2
- package/{src/database → packages/database/src}/server/models/ragEval/dataset.ts +3 -3
- package/{src/database → packages/database/src}/server/models/ragEval/datasetRecord.ts +3 -3
- package/{src/database → packages/database/src}/server/models/ragEval/evaluation.ts +3 -3
- package/{src/database → packages/database/src}/server/models/ragEval/evaluationRecord.ts +2 -2
- package/{src/database → packages/database/src}/utils/idGenerator.ts +4 -1
- package/{vitest.config.server.ts → packages/database/vitest.config.ts} +8 -7
- package/packages/model-runtime/package.json +1 -0
- package/packages/model-runtime/src/bfl/createImage.test.ts +4 -4
- package/packages/model-runtime/src/bfl/createImage.ts +1 -1
- package/packages/model-runtime/src/google/index.test.ts +1 -1
- package/packages/model-runtime/src/google/index.ts +1 -3
- package/packages/model-runtime/src/ollama/index.ts +3 -2
- package/packages/model-runtime/src/utils/anthropicHelpers.test.ts +2 -3
- package/packages/model-runtime/src/utils/anthropicHelpers.ts +1 -2
- package/packages/model-runtime/src/utils/openaiCompatibleFactory/index.ts +1 -1
- package/packages/model-runtime/src/utils/openaiHelpers.test.ts +2 -3
- package/packages/model-runtime/src/utils/openaiHelpers.ts +2 -2
- package/packages/model-runtime/src/utils/streams/bedrock/claude.ts +1 -2
- package/packages/model-runtime/src/utils/streams/bedrock/llama.test.ts +1 -2
- package/packages/model-runtime/src/utils/streams/bedrock/llama.ts +1 -2
- package/packages/model-runtime/src/utils/streams/google-ai.test.ts +1 -2
- package/packages/model-runtime/src/utils/streams/google-ai.ts +1 -1
- package/packages/model-runtime/src/utils/streams/ollama.test.ts +1 -2
- package/packages/model-runtime/src/utils/streams/ollama.ts +1 -1
- package/packages/model-runtime/src/utils/streams/protocol.ts +2 -2
- package/packages/model-runtime/src/utils/streams/vertex-ai.test.ts +1 -2
- package/packages/model-runtime/src/utils/streams/vertex-ai.ts +1 -1
- package/packages/model-runtime/vitest.config.ts +2 -0
- package/packages/types/src/index.ts +5 -0
- package/packages/utils/package.json +17 -0
- package/{src/utils → packages/utils/src}/client/cookie.test.ts +1 -3
- package/{src/utils → packages/utils/src}/client/cookie.ts +1 -1
- package/{src/utils → packages/utils/src}/client/parserPlaceholder.test.ts +2 -2
- package/{src/utils → packages/utils/src}/client/parserPlaceholder.ts +77 -73
- package/{src/utils → packages/utils/src}/client/topic.test.ts +1 -1
- package/{src/utils → packages/utils/src}/compressImage.test.ts +2 -0
- package/{src/utils → packages/utils/src}/fetch/__tests__/fetchSSE.test.ts +3 -4
- package/{src/utils → packages/utils/src}/fetch/fetchSSE.ts +1 -1
- package/{src/utils → packages/utils/src}/getFallbackModelProperty.test.ts +1 -1
- package/packages/utils/src/index.ts +5 -0
- package/{src/utils → packages/utils/src}/locale.ts +2 -1
- package/{src/utils → packages/utils/src}/merge.test.ts +1 -3
- package/{src/utils → packages/utils/src}/parseModels.ts +3 -2
- package/{src/utils → packages/utils/src}/platform.test.ts +1 -1
- package/{src/utils → packages/utils/src}/platform.ts +1 -1
- package/{src/utils → packages/utils/src}/sanitizeUTF8.test.ts +2 -0
- package/{src/utils → packages/utils/src}/server/__tests__/geo.test.ts +1 -1
- package/{src/utils → packages/utils/src}/server/xor.test.ts +1 -2
- package/{src/utils → packages/utils/src}/url.test.ts +1 -1
- package/packages/utils/tests/setup.ts +10 -0
- package/packages/utils/vitest.config.ts +16 -0
- package/scripts/dbmlWorkflow/index.ts +1 -1
- package/scripts/migrateClientDB/compile-migrations.ts +2 -2
- package/scripts/migrateServerDB/index.ts +2 -2
- package/src/app/[variants]/(main)/repos/[id]/evals/dataset/CreateDataset/CreateForm.tsx +1 -1
- package/src/app/[variants]/(main)/repos/[id]/evals/dataset/DatasetDetail/index.tsx +1 -1
- package/src/app/[variants]/(main)/repos/[id]/evals/dataset/DatasetList/Item.tsx +1 -2
- package/src/app/[variants]/(main)/repos/[id]/evals/dataset/DatasetList/index.tsx +1 -2
- package/src/app/[variants]/(main)/repos/[id]/evals/evaluation/CreateEvaluation/CreateForm.tsx +1 -1
- package/src/app/[variants]/(main)/repos/[id]/evals/evaluation/EvaluationList/index.tsx +1 -1
- package/src/features/AgentSetting/store/index.ts +1 -2
- package/src/server/routers/async/ragEval.ts +1 -1
- package/src/server/routers/lambda/ragEval.ts +9 -9
- package/src/services/config.ts +1 -1
- package/src/services/ragEval.ts +4 -3
- package/src/store/knowledgeBase/slices/ragEval/actions/dataset.ts +6 -6
- package/src/store/knowledgeBase/slices/ragEval/actions/evaluation.ts +1 -1
- package/src/store/serverConfig/store.ts +1 -1
- package/src/utils/client/switchLang.test.ts +2 -2
- package/src/utils/client/switchLang.ts +2 -3
- package/tests/setup.ts +0 -11
- package/tsconfig.json +2 -0
- package/vitest.config.ts +6 -2
- /package/{src → packages}/database/migrations/0000_init.sql +0 -0
- /package/{src → packages}/database/migrations/0001_add_client_id.sql +0 -0
- /package/{src → packages}/database/migrations/0002_amusing_puma.sql +0 -0
- /package/{src → packages}/database/migrations/0003_naive_echo.sql +0 -0
- /package/{src → packages}/database/migrations/0004_add_next_auth.sql +0 -0
- /package/{src → packages}/database/migrations/0005_pgvector.sql +0 -0
- /package/{src → packages}/database/migrations/0006_add_knowledge_base.sql +0 -0
- /package/{src → packages}/database/migrations/0007_fix_embedding_table.sql +0 -0
- /package/{src → packages}/database/migrations/0008_add_rag_evals.sql +0 -0
- /package/{src → packages}/database/migrations/0009_remove_unused_user_tables.sql +0 -0
- /package/{src → packages}/database/migrations/0010_add_accessed_at_and_clean_tables.sql +0 -0
- /package/{src → packages}/database/migrations/0011_add_topic_history_summary.sql +0 -0
- /package/{src → packages}/database/migrations/0012_add_thread.sql +0 -0
- /package/{src → packages}/database/migrations/0013_add_ai_infra.sql +0 -0
- /package/{src → packages}/database/migrations/0014_add_message_reasoning.sql +0 -0
- /package/{src → packages}/database/migrations/0015_add_message_search_metadata.sql +0 -0
- /package/{src → packages}/database/migrations/0016_add_message_index.sql +0 -0
- /package/{src → packages}/database/migrations/0017_add_user_id_to_tables.sql +0 -0
- /package/{src → packages}/database/migrations/0018_add_client_id_for_entities.sql +0 -0
- /package/{src → packages}/database/migrations/0019_add_hotkey_user_settings.sql +0 -0
- /package/{src → packages}/database/migrations/0020_add_oidc.sql +0 -0
- /package/{src → packages}/database/migrations/0021_add_agent_opening_settings.sql +0 -0
- /package/{src → packages}/database/migrations/0022_add_documents.sql +0 -0
- /package/{src → packages}/database/migrations/0023_remove_param_and_doubao.sql +0 -0
- /package/{src → packages}/database/migrations/0024_add_rbac_tables.sql +0 -0
- /package/{src → packages}/database/migrations/0025_add_provider_config.sql +0 -0
- /package/{src → packages}/database/migrations/0026_add_autovacuum_tuning.sql +0 -0
- /package/{src → packages}/database/migrations/0027_ai_image.sql +0 -0
- /package/{src → packages}/database/migrations/meta/0000_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0001_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0002_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0003_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0004_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0005_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0006_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0007_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0008_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0009_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0010_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0011_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0012_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0013_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0014_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0015_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0016_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0017_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0018_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0019_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0020_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0021_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0022_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0023_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0024_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0025_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0026_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0027_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0028_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/0029_snapshot.json +0 -0
- /package/{src → packages}/database/migrations/meta/_journal.json +0 -0
- /package/{src/database → packages/database/src}/client/db.test.ts +0 -0
- /package/{src/database → packages/database/src}/client/pglite.ts +0 -0
- /package/{src/database → packages/database/src}/client/pglite.worker.ts +0 -0
- /package/{src/database → packages/database/src}/client/type.ts +0 -0
- /package/{src/database → packages/database/src}/models/__tests__/fixtures/embedding.ts +0 -0
- /package/{src/database → packages/database/src}/repositories/aiInfra/index.test.ts +0 -0
- /package/{src/database → packages/database/src}/repositories/dataExporter/index.test.ts +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/fixtures/agents.json +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/fixtures/agentsToSessions.json +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/fixtures/topic.json +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/fixtures/userSettings.json +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/fixtures/with-client-id.json +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/deprecated/__tests__/fixtures/messages.json +0 -0
- /package/{src/database → packages/database/src}/repositories/dataImporter/deprecated/__tests__/index.test.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/_helpers.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/apiKey.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/asyncTask.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/index.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/nextauth.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/oidc.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/rag.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/rbac.ts +0 -0
- /package/{src/database → packages/database/src}/schemas/user.ts +0 -0
- /package/{src/database → packages/database/src}/server/index.ts +0 -0
- /package/{src/database → packages/database/src}/server/models/ragEval/index.ts +0 -0
- /package/{src/database → packages/database/src}/type.ts +0 -0
- /package/{src/database → packages/database/src}/utils/genWhere.ts +0 -0
- /package/{src/database → packages/database/src}/utils/idGenerator.test.ts +0 -0
- /package/{tests → packages/database/tests}/setup-db.ts +0 -0
- /package/{src/utils → packages/types/src}/zustand.ts +0 -0
- /package/{src/utils → packages/utils/src}/__snapshots__/parseModels.test.ts.snap +0 -0
- /package/{src/utils → packages/utils/src}/_deprecated/__snapshots__/parseModels.test.ts.snap +0 -0
- /package/{src/utils → packages/utils/src}/_deprecated/parseModels.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/_deprecated/parseModels.ts +0 -0
- /package/{src/utils → packages/utils/src}/apiKey.ts +0 -0
- /package/{src/utils → packages/utils/src}/basePath.ts +0 -0
- /package/{src/utils → packages/utils/src}/client/GlobalAgentContextManager.ts +0 -0
- /package/{src/utils → packages/utils/src}/client/downloadFile.ts +0 -0
- /package/{src/utils → packages/utils/src}/client/exportFile.ts +0 -0
- /package/{src/utils → packages/utils/src}/client/topic.ts +0 -0
- /package/{src/utils → packages/utils/src}/client/xor-obfuscation.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/client/xor-obfuscation.ts +0 -0
- /package/{src/utils → packages/utils/src}/clientIP.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/clientIP.ts +0 -0
- /package/{src/utils → packages/utils/src}/clipboard.ts +0 -0
- /package/{src/utils → packages/utils/src}/colorUtils.ts +0 -0
- /package/{src/utils → packages/utils/src}/compass.ts +0 -0
- /package/{src/utils → packages/utils/src}/compressImage.ts +0 -0
- /package/{src/utils → packages/utils/src}/difference.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/difference.ts +0 -0
- /package/{src/utils → packages/utils/src}/electron/desktopRemoteRPCFetch.ts +0 -0
- /package/{src/utils → packages/utils/src}/env.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/__tests__/parseError.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/fetchEventSource/index.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/fetchEventSource/parse.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/headers.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/index.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/parseError.ts +0 -0
- /package/{src/utils → packages/utils/src}/fetch/request.ts +0 -0
- /package/{src/utils → packages/utils/src}/format.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/format.ts +0 -0
- /package/{src/utils → packages/utils/src}/genOG.ts +0 -0
- /package/{src/utils → packages/utils/src}/getFallbackModelProperty.ts +0 -0
- /package/{src/utils → packages/utils/src}/imageToBase64.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/imageToBase64.ts +0 -0
- /package/{src/utils → packages/utils/src}/isChunkingUnsupported.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/isChunkingUnsupported.ts +0 -0
- /package/{src/utils → packages/utils/src}/keyboard.ts +0 -0
- /package/{src/utils → packages/utils/src}/localStorage.ts +0 -0
- /package/{src/utils → packages/utils/src}/locale.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/merge.ts +0 -0
- /package/{src/utils → packages/utils/src}/number.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/number.ts +0 -0
- /package/{src/utils → packages/utils/src}/object.ts +0 -0
- /package/{src/utils → packages/utils/src}/parseMarkdown.ts +0 -0
- /package/{src/utils → packages/utils/src}/parseModels.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/pricing.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/pricing.ts +0 -0
- /package/{src/utils → packages/utils/src}/promptTemplate.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/promptTemplate.ts +0 -0
- /package/{src/utils → packages/utils/src}/safeParseJSON.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/safeParseJSON.ts +0 -0
- /package/{src/utils → packages/utils/src}/sanitizeUTF8.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/__tests__/auth.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/auth.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/correctOIDCUrl.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/geo.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/pageProps.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/responsive.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/routeVariants.ts +0 -0
- /package/{src/utils → packages/utils/src}/server/xor.ts +0 -0
- /package/{src/utils → packages/utils/src}/sleep.ts +0 -0
- /package/{src/utils → packages/utils/src}/storeDebug.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/storeDebug.ts +0 -0
- /package/{src/utils → packages/utils/src}/time.test.ts +0 -0
- /package/{src/utils → packages/utils/src}/time.ts +0 -0
- /package/{src/utils → packages/utils/src}/tokenizer/client.ts +0 -0
- /package/{src/utils → packages/utils/src}/tokenizer/estimated.ts +0 -0
- /package/{src/utils → packages/utils/src}/tokenizer/index.ts +0 -0
- /package/{src/utils → packages/utils/src}/tokenizer/server.ts +0 -0
- /package/{src/utils → packages/utils/src}/tokenizer/tokenizer.worker.ts +0 -0
- /package/{src/utils → packages/utils/src}/toolCall.ts +0 -0
- /package/{src/utils → packages/utils/src}/toolManifest.ts +0 -0
- /package/{src/utils → packages/utils/src}/trace.ts +0 -0
- /package/{src/utils → packages/utils/src}/units.ts +0 -0
- /package/{src/utils → packages/utils/src}/uploadFIle.ts +0 -0
- /package/{src/utils → packages/utils/src}/url.ts +0 -0
- /package/{src/utils → packages/utils/src}/uuid.ts +0 -0
@@ -2,10 +2,10 @@
|
|
2
2
|
import { eq, inArray } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '@/database/type';
|
6
5
|
import { FilesTabs, SortType } from '@/types/files';
|
7
6
|
|
8
7
|
import { files, globalFiles, knowledgeBaseFiles, knowledgeBases, users } from '../../schemas';
|
8
|
+
import { LobeChatDatabase } from '../../type';
|
9
9
|
import { FileModel } from '../file';
|
10
10
|
import { getTestDB } from './_util';
|
11
11
|
|
@@ -2,8 +2,7 @@
|
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '@/
|
6
|
-
import { AsyncTaskStatus } from '@/types/asyncTask';
|
5
|
+
import { LobeChatDatabase } from '../../type';import { AsyncTaskStatus } from '@/types/asyncTask';
|
7
6
|
import { FileSource } from '@/types/files';
|
8
7
|
import { ImageGenerationAsset } from '@/types/generation';
|
9
8
|
|
@@ -2,8 +2,7 @@
|
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '@/
|
6
|
-
import { AsyncTaskStatus } from '@/types/asyncTask';
|
5
|
+
import { LobeChatDatabase } from '../../type';import { AsyncTaskStatus } from '@/types/asyncTask';
|
7
6
|
import { GenerationConfig } from '@/types/generation';
|
8
7
|
|
9
8
|
import {
|
@@ -2,8 +2,7 @@
|
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '@/
|
6
|
-
import { FileService } from '@/server/services/file';
|
5
|
+
import { LobeChatDatabase } from '../../type';import { FileService } from '@/server/services/file';
|
7
6
|
import { ImageGenerationTopic } from '@/types/generation';
|
8
7
|
|
9
8
|
import { generationBatches, generationTopics, generations, users } from '../../schemas';
|
@@ -2,8 +2,7 @@
|
|
2
2
|
import { and, eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '@/
|
6
|
-
import { sleep } from '@/utils/sleep';
|
5
|
+
import { LobeChatDatabase } from '../../type';import { sleep } from '@/utils/sleep';
|
7
6
|
|
8
7
|
import {
|
9
8
|
NewKnowledgeBase,
|
@@ -2,11 +2,10 @@ import dayjs from 'dayjs';
|
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { getTestDB } from '@/database/models/__tests__/_util';
|
6
|
-
import { LobeChatDatabase } from '@/database/type';
|
7
5
|
import { MessageItem } from '@/types/message';
|
8
6
|
import { uuid } from '@/utils/uuid';
|
9
7
|
|
8
|
+
import { getTestDB } from '../../models/__tests__/_util';
|
10
9
|
import {
|
11
10
|
chunks,
|
12
11
|
embeddings,
|
@@ -23,6 +22,7 @@ import {
|
|
23
22
|
topics,
|
24
23
|
users,
|
25
24
|
} from '../../schemas';
|
25
|
+
import { LobeChatDatabase } from '../../type';
|
26
26
|
import { MessageModel } from '../message';
|
27
27
|
import { codeEmbedding } from './fixtures/embedding';
|
28
28
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeChatDatabase } from '
|
5
|
-
|
4
|
+
import { LobeChatDatabase } from '../../type';
|
6
5
|
import { NewInstalledPlugin, userInstalledPlugins, users } from '../../schemas';
|
7
6
|
import { PluginModel } from '../plugin';
|
8
7
|
import { getTestDB } from './_util';
|
@@ -2,8 +2,6 @@ import { and, eq, inArray } from 'drizzle-orm';
|
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
4
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
5
|
-
import { LobeChatDatabase } from '@/database/type';
|
6
|
-
import { idGenerator } from '@/database/utils/idGenerator';
|
7
5
|
|
8
6
|
import {
|
9
7
|
NewSession,
|
@@ -16,6 +14,8 @@ import {
|
|
16
14
|
topics,
|
17
15
|
users,
|
18
16
|
} from '../../schemas';
|
17
|
+
import { LobeChatDatabase } from '../../type';
|
18
|
+
import { idGenerator } from '../../utils/idGenerator';
|
19
19
|
import { SessionModel } from '../session';
|
20
20
|
import { getTestDB } from './_util';
|
21
21
|
|
@@ -2,9 +2,8 @@
|
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '@/database/type';
|
6
|
-
|
7
5
|
import { sessionGroups, users } from '../../schemas';
|
6
|
+
import { LobeChatDatabase } from '../../type';
|
8
7
|
import { SessionGroupModel } from '../sessionGroup';
|
9
8
|
import { getTestDB } from './_util';
|
10
9
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { eq, inArray } from 'drizzle-orm';
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeChatDatabase } from '
|
5
|
-
|
4
|
+
import { LobeChatDatabase } from '../../type';
|
6
5
|
import { messages, sessions, topics, users } from '../../schemas';
|
7
6
|
import { CreateTopicParams, TopicModel } from '../topic';
|
8
7
|
import { getTestDB } from './_util';
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { and, desc, eq } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '@/database/type';
|
4
|
-
|
5
3
|
import { NewSessionGroup, SessionGroupItem, sessionGroups } from '../schemas';
|
4
|
+
import { LobeChatDatabase } from '../type';
|
6
5
|
|
7
6
|
export class TemplateModel {
|
8
7
|
private userId: string;
|
@@ -7,8 +7,8 @@ import {
|
|
7
7
|
agentsToSessions,
|
8
8
|
files,
|
9
9
|
knowledgeBases,
|
10
|
-
} from '
|
11
|
-
import { LobeChatDatabase } from '
|
10
|
+
} from '../schemas';
|
11
|
+
import { LobeChatDatabase } from '../type';
|
12
12
|
|
13
13
|
export class AgentModel {
|
14
14
|
private userId: string;
|
@@ -3,7 +3,7 @@ import { and, asc, desc, eq } from 'drizzle-orm';
|
|
3
3
|
import { isEmpty } from 'lodash-es';
|
4
4
|
|
5
5
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
6
|
-
import { LobeChatDatabase } from '
|
6
|
+
import { LobeChatDatabase } from '../type';
|
7
7
|
import {
|
8
8
|
AiProviderDetailItem,
|
9
9
|
AiProviderListItem,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { and, desc, eq } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
4
|
import { generateApiKey, isApiKeyExpired, validateApiKeyFormat } from '@/utils/apiKey';
|
5
5
|
|
6
6
|
import { ApiKeyItem, NewApiKeyItem, apiKeys } from '../schemas';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { and, asc, cosineDistance, count, desc, eq, inArray, isNull, sql } from 'drizzle-orm';
|
2
2
|
import { chunk } from 'lodash-es';
|
3
3
|
|
4
|
-
import { LobeChatDatabase } from '
|
4
|
+
import { LobeChatDatabase } from '../type';
|
5
5
|
import { ChunkMetadata, FileChunk } from '@/types/chunk';
|
6
6
|
|
7
7
|
import {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { and, asc, count, desc, eq, ilike, inArray, like, notExists, or, sum } from 'drizzle-orm';
|
2
2
|
import type { PgTransaction } from 'drizzle-orm/pg-core';
|
3
3
|
|
4
|
-
import { LobeChatDatabase, Transaction } from '
|
4
|
+
import { LobeChatDatabase, Transaction } from '../type';
|
5
5
|
import { FilesTabs, QueryFileListParams, SortType } from '@/types/files';
|
6
6
|
|
7
7
|
import {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import debug from 'debug';
|
2
2
|
import { and, eq } from 'drizzle-orm';
|
3
3
|
|
4
|
-
import { LobeChatDatabase, Transaction } from '
|
4
|
+
import { LobeChatDatabase, Transaction } from '../type';
|
5
5
|
import { FileService } from '@/server/services/file';
|
6
6
|
import { AsyncTaskError, AsyncTaskStatus } from '@/types/asyncTask';
|
7
7
|
import { FileSource } from '@/types/files';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import debug from 'debug';
|
2
2
|
import { and, eq } from 'drizzle-orm';
|
3
3
|
|
4
|
-
import { LobeChatDatabase } from '
|
4
|
+
import { LobeChatDatabase } from '../type';
|
5
5
|
import { FileService } from '@/server/services/file';
|
6
6
|
import { Generation, GenerationAsset, GenerationBatch, GenerationConfig } from '@/types/generation';
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { and, desc, eq } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
4
|
import { FileService } from '@/server/services/file';
|
5
5
|
import { GenerationAsset, ImageGenerationTopic } from '@/types/generation';
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { and, desc, eq, inArray } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
4
|
import { KnowledgeBaseItem } from '@/types/knowledgeBase';
|
5
5
|
|
6
6
|
import { NewKnowledgeBase, knowledgeBaseFiles, knowledgeBases } from '../schemas';
|
@@ -2,14 +2,14 @@ import type { HeatmapsProps } from '@lobehub/charts';
|
|
2
2
|
import dayjs from 'dayjs';
|
3
3
|
import { and, asc, count, desc, eq, gt, inArray, isNotNull, isNull, like, sql } from 'drizzle-orm';
|
4
4
|
|
5
|
-
import { LobeChatDatabase } from '
|
5
|
+
import { LobeChatDatabase } from '../type';
|
6
6
|
import {
|
7
7
|
genEndDateWhere,
|
8
8
|
genRangeWhere,
|
9
9
|
genStartDateWhere,
|
10
10
|
genWhere,
|
11
|
-
} from '
|
12
|
-
import { idGenerator } from '
|
11
|
+
} from '../utils/genWhere';
|
12
|
+
import { idGenerator } from '../utils/idGenerator';
|
13
13
|
import {
|
14
14
|
ChatFileItem,
|
15
15
|
ChatImageItem,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { and, desc, eq } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
4
|
import { LobeTool } from '@/types/tool';
|
5
5
|
|
6
6
|
import { InstalledPluginItem, NewInstalledPlugin, userInstalledPlugins } from '../schemas';
|
@@ -18,14 +18,14 @@ import type { PartialDeep } from 'type-fest';
|
|
18
18
|
import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
|
19
19
|
import { INBOX_SESSION_ID } from '@/const/session';
|
20
20
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
21
|
-
import { LobeChatDatabase } from '
|
21
|
+
import { LobeChatDatabase } from '../type';
|
22
22
|
import {
|
23
23
|
genEndDateWhere,
|
24
24
|
genRangeWhere,
|
25
25
|
genStartDateWhere,
|
26
26
|
genWhere,
|
27
|
-
} from '
|
28
|
-
import { idGenerator } from '
|
27
|
+
} from '../utils/genWhere';
|
28
|
+
import { idGenerator } from '../utils/idGenerator';
|
29
29
|
import { LobeAgentConfig } from '@/types/agent';
|
30
30
|
import { ChatSessionList, LobeAgentSession, SessionRankItem } from '@/types/session';
|
31
31
|
import { merge } from '@/utils/merge';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { and, asc, desc, eq } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
4
|
-
import { idGenerator } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
|
+
import { idGenerator } from '../utils/idGenerator';
|
5
5
|
|
6
6
|
import { SessionGroupItem, sessionGroups } from '../schemas';
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { and, desc, eq } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
4
|
import { CreateThreadParams, ThreadStatus } from '@/types/topic';
|
5
5
|
|
6
6
|
import { ThreadItem, threads } from '../schemas';
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { and, count, desc, eq, gt, ilike, inArray, isNull, sql } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import { LobeChatDatabase } from '
|
3
|
+
import { LobeChatDatabase } from '../type';
|
4
4
|
import {
|
5
5
|
genEndDateWhere,
|
6
6
|
genRangeWhere,
|
7
7
|
genStartDateWhere,
|
8
8
|
genWhere,
|
9
|
-
} from '
|
10
|
-
import { idGenerator } from '
|
9
|
+
} from '../utils/genWhere';
|
10
|
+
import { idGenerator } from '../utils/idGenerator';
|
11
11
|
import { MessageItem } from '@/types/message';
|
12
12
|
import { TopicRankItem } from '@/types/topic';
|
13
13
|
|
@@ -4,7 +4,7 @@ import { eq } from 'drizzle-orm';
|
|
4
4
|
import type { AdapterAccount } from 'next-auth/adapters';
|
5
5
|
import type { PartialDeep } from 'type-fest';
|
6
6
|
|
7
|
-
import { LobeChatDatabase } from '
|
7
|
+
import { LobeChatDatabase } from '../type';
|
8
8
|
import { UserGuide, UserPreference } from '@/types/user';
|
9
9
|
import { UserKeyVaults, UserSettings } from '@/types/user/settings';
|
10
10
|
import { merge } from '@/utils/merge';
|
@@ -2,9 +2,6 @@ import { isEmpty } from 'lodash-es';
|
|
2
2
|
import pMap from 'p-map';
|
3
3
|
|
4
4
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
5
|
-
import { AiModelModel } from '@/database/models/aiModel';
|
6
|
-
import { AiProviderModel } from '@/database/models/aiProvider';
|
7
|
-
import { LobeChatDatabase } from '@/database/type';
|
8
5
|
import {
|
9
6
|
AIChatModelCard,
|
10
7
|
AiModelSourceEnum,
|
@@ -20,6 +17,10 @@ import {
|
|
20
17
|
import { ProviderConfig } from '@/types/user/settings';
|
21
18
|
import { merge, mergeArrayById } from '@/utils/merge';
|
22
19
|
|
20
|
+
import { AiModelModel } from '../../models/aiModel';
|
21
|
+
import { AiProviderModel } from '../../models/aiProvider';
|
22
|
+
import { LobeChatDatabase } from '../../type';
|
23
|
+
|
23
24
|
type DecryptUserKeyVaults = (encryptKeyVaultsStr: string | null) => Promise<any>;
|
24
25
|
|
25
26
|
export class AiInfraRepos {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { and, eq, inArray } from 'drizzle-orm';
|
2
2
|
import pMap from 'p-map';
|
3
3
|
|
4
|
-
import * as EXPORT_TABLES from '
|
5
|
-
import { LobeChatDatabase } from '
|
4
|
+
import * as EXPORT_TABLES from '../../schemas';
|
5
|
+
import { LobeChatDatabase } from '../../type';
|
6
6
|
|
7
7
|
interface BaseTableConfig {
|
8
8
|
table: keyof typeof EXPORT_TABLES;
|
package/{src/database → packages/database/src}/repositories/dataImporter/__tests__/index.test.ts
RENAMED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { eq, inArray } from 'drizzle-orm';
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { getTestDB } from '@/database/models/__tests__/_util';
|
5
|
-
import * as Schema from '@/database/schemas';
|
6
4
|
import { ImportPgDataStructure } from '@/types/export';
|
7
5
|
|
6
|
+
import { getTestDB } from '../../../models/__tests__/_util';
|
7
|
+
import * as Schema from '../../../schemas';
|
8
8
|
import { DataImporterRepos } from '../index';
|
9
9
|
import agentsData from './fixtures/agents.json';
|
10
10
|
import agentsToSessionsData from './fixtures/agentsToSessions.json';
|
package/{src/database → packages/database/src}/repositories/dataImporter/deprecated/index.ts
RENAMED
@@ -1,5 +1,9 @@
|
|
1
1
|
import { and, eq, inArray, sql } from 'drizzle-orm';
|
2
2
|
|
3
|
+
import { ImportResult } from '@/services/import/_deprecated';
|
4
|
+
import { ImporterEntryData } from '@/types/importer';
|
5
|
+
import { sanitizeUTF8 } from '@/utils/sanitizeUTF8';
|
6
|
+
|
3
7
|
import {
|
4
8
|
agents,
|
5
9
|
agentsToSessions,
|
@@ -9,11 +13,8 @@ import {
|
|
9
13
|
sessionGroups,
|
10
14
|
sessions,
|
11
15
|
topics,
|
12
|
-
} from '
|
13
|
-
import { LobeChatDatabase } from '
|
14
|
-
import { ImportResult } from '@/services/import/_deprecated';
|
15
|
-
import { ImporterEntryData } from '@/types/importer';
|
16
|
-
import { sanitizeUTF8 } from '@/utils/sanitizeUTF8';
|
16
|
+
} from '../../../schemas';
|
17
|
+
import { LobeChatDatabase } from '../../../type';
|
17
18
|
|
18
19
|
export class DeprecatedDataImporterRepos {
|
19
20
|
private userId: string;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { and, eq, inArray } from 'drizzle-orm';
|
2
2
|
|
3
|
-
import * as EXPORT_TABLES from '@/database/schemas';
|
4
|
-
import { LobeChatDatabase } from '@/database/type';
|
5
3
|
import { ImportPgDataStructure } from '@/types/export';
|
6
4
|
import { ImportResultData, ImporterEntryData } from '@/types/importer';
|
7
5
|
import { uuid } from '@/utils/uuid';
|
8
6
|
|
7
|
+
import * as EXPORT_TABLES from '../../schemas';
|
8
|
+
import { LobeChatDatabase } from '../../type';
|
9
9
|
import { DeprecatedDataImporterRepos } from './deprecated';
|
10
10
|
|
11
11
|
interface ImportResult {
|
@@ -23,7 +23,7 @@ describe('TableViewerRepo', () => {
|
|
23
23
|
it('should return all tables with counts', async () => {
|
24
24
|
const result = await repo.getAllTables();
|
25
25
|
|
26
|
-
expect(result.length).toEqual(
|
26
|
+
expect(result.length).toEqual(60);
|
27
27
|
expect(result[0]).toEqual({ name: 'agents', count: 0, type: 'BASE TABLE' });
|
28
28
|
});
|
29
29
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { sql } from 'drizzle-orm';
|
2
2
|
import pMap from 'p-map';
|
3
3
|
|
4
|
-
import { LobeChatDatabase } from '@/database/type';
|
5
4
|
import {
|
6
5
|
FilterCondition,
|
7
6
|
PaginationParams,
|
@@ -9,6 +8,8 @@ import {
|
|
9
8
|
TableColumnInfo,
|
10
9
|
} from '@/types/tableViewer';
|
11
10
|
|
11
|
+
import { LobeChatDatabase } from '../../type';
|
12
|
+
|
12
13
|
export class TableViewerRepo {
|
13
14
|
private userId: string;
|
14
15
|
private db: LobeChatDatabase;
|
@@ -10,9 +10,9 @@ import {
|
|
10
10
|
} from 'drizzle-orm/pg-core';
|
11
11
|
import { createInsertSchema } from 'drizzle-zod';
|
12
12
|
|
13
|
-
import { idGenerator, randomSlug } from '@/database/utils/idGenerator';
|
14
13
|
import { LobeAgentChatConfig, LobeAgentTTSConfig } from '@/types/agent';
|
15
14
|
|
15
|
+
import { idGenerator, randomSlug } from '../utils/idGenerator';
|
16
16
|
import { timestamps } from './_helpers';
|
17
17
|
import { files, knowledgeBases } from './file';
|
18
18
|
import { users } from './user';
|
@@ -1,10 +1,11 @@
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
2
2
|
import { boolean, integer, jsonb, pgTable, primaryKey, text, varchar } from 'drizzle-orm/pg-core';
|
3
3
|
|
4
|
-
import { timestamps } from '@/database/schemas/_helpers';
|
5
|
-
import { users } from '@/database/schemas/user';
|
6
4
|
import { AiProviderConfig, AiProviderSettings } from '@/types/aiProvider';
|
7
5
|
|
6
|
+
import { timestamps } from './_helpers';
|
7
|
+
import { users } from './user';
|
8
|
+
|
8
9
|
export const aiProviders = pgTable(
|
9
10
|
'ai_providers',
|
10
11
|
{
|
@@ -12,12 +12,12 @@ import {
|
|
12
12
|
} from 'drizzle-orm/pg-core';
|
13
13
|
import { createInsertSchema } from 'drizzle-zod';
|
14
14
|
|
15
|
-
import { chunks } from '@/database/schemas/rag';
|
16
|
-
import { idGenerator } from '@/database/utils/idGenerator';
|
17
15
|
import { LobeDocumentPage } from '@/types/document';
|
18
16
|
|
17
|
+
import { idGenerator } from '../utils/idGenerator';
|
19
18
|
import { createdAt, timestamps } from './_helpers';
|
20
19
|
import { files } from './file';
|
20
|
+
import { chunks } from './rag';
|
21
21
|
import { users } from './user';
|
22
22
|
|
23
23
|
/**
|
@@ -13,9 +13,9 @@ import {
|
|
13
13
|
} from 'drizzle-orm/pg-core';
|
14
14
|
import { createInsertSchema } from 'drizzle-zod';
|
15
15
|
|
16
|
-
import { idGenerator } from '@/database/utils/idGenerator';
|
17
16
|
import { FileSource } from '@/types/files';
|
18
17
|
|
18
|
+
import { idGenerator } from '../utils/idGenerator';
|
19
19
|
import { accessedAt, createdAt, timestamps } from './_helpers';
|
20
20
|
import { asyncTasks } from './asyncTask';
|
21
21
|
import { users } from './user';
|
@@ -2,9 +2,9 @@
|
|
2
2
|
import { integer, jsonb, pgTable, text, uuid, varchar } from 'drizzle-orm/pg-core';
|
3
3
|
import { createInsertSchema } from 'drizzle-zod';
|
4
4
|
|
5
|
-
import { idGenerator } from '@/database/utils/idGenerator';
|
6
5
|
import { ImageGenerationAsset } from '@/types/generation';
|
7
6
|
|
7
|
+
import { idGenerator } from '../utils/idGenerator';
|
8
8
|
import { timestamps } from './_helpers';
|
9
9
|
import { AsyncTaskSelectItem, asyncTasks } from './asyncTask';
|
10
10
|
import { files } from './file';
|
@@ -12,10 +12,10 @@ import {
|
|
12
12
|
} from 'drizzle-orm/pg-core';
|
13
13
|
import { createSelectSchema } from 'drizzle-zod';
|
14
14
|
|
15
|
-
import { idGenerator } from '@/database/utils/idGenerator';
|
16
15
|
import { ModelReasoning } from '@/types/message';
|
17
16
|
import { GroundingSearch } from '@/types/search';
|
18
17
|
|
18
|
+
import { idGenerator } from '../utils/idGenerator';
|
19
19
|
import { timestamps } from './_helpers';
|
20
20
|
import { agents } from './agent';
|
21
21
|
import { files } from './file';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
2
|
+
import { EvalEvaluationStatus } from '@lobechat/types';
|
2
3
|
import { integer, jsonb, pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
3
4
|
|
4
5
|
import { DEFAULT_MODEL } from '@/const/settings';
|
5
|
-
import { EvalEvaluationStatus } from '@/types/eval';
|
6
6
|
|
7
7
|
import { timestamps } from './_helpers';
|
8
8
|
import { knowledgeBases } from './file';
|
@@ -2,8 +2,7 @@
|
|
2
2
|
import { relations } from 'drizzle-orm';
|
3
3
|
import { pgTable, primaryKey, text, uuid, varchar } from 'drizzle-orm/pg-core';
|
4
4
|
|
5
|
-
import { createdAt } from '
|
6
|
-
|
5
|
+
import { createdAt } from './_helpers';
|
7
6
|
import { agents, agentsFiles, agentsKnowledgeBases } from './agent';
|
8
7
|
import { asyncTasks } from './asyncTask';
|
9
8
|
import { documentChunks, documents } from './document';
|
@@ -2,8 +2,7 @@
|
|
2
2
|
import { boolean, integer, pgTable, text, uniqueIndex, varchar } from 'drizzle-orm/pg-core';
|
3
3
|
import { createInsertSchema } from 'drizzle-zod';
|
4
4
|
|
5
|
-
import { idGenerator, randomSlug } from '
|
6
|
-
|
5
|
+
import { idGenerator, randomSlug } from '../utils/idGenerator';
|
7
6
|
import { timestamps } from './_helpers';
|
8
7
|
import { users } from './user';
|
9
8
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
import { boolean, jsonb, pgTable, primaryKey, text, uniqueIndex } from 'drizzle-orm/pg-core';
|
3
3
|
import { createInsertSchema } from 'drizzle-zod';
|
4
4
|
|
5
|
-
import { documents } from '@/database/schemas/document';
|
6
|
-
import { idGenerator } from '@/database/utils/idGenerator';
|
7
5
|
import { ChatTopicMetadata } from '@/types/topic';
|
8
6
|
|
7
|
+
import { idGenerator } from '../utils/idGenerator';
|
9
8
|
import { createdAt, timestamps, timestamptz } from './_helpers';
|
9
|
+
import { documents } from './document';
|
10
10
|
import { sessions } from './session';
|
11
11
|
import { users } from './user';
|
12
12
|
|