diff --git a/express/package.json b/express/package.json index 8c31509..a8f8ca7 100644 --- a/express/package.json +++ b/express/package.json @@ -79,7 +79,7 @@ "sqlite3": "^5.1.7", "useragent": "^2.3.0", "validator": "^13.11.0", - "vectordb": "^0.1.4", + "vectordb": "^0.4.9", "xlsx": "^0.18.5" }, "devDependencies": { diff --git a/express/src/utils/lancedb.js b/express/src/utils/lancedb.js index 9ebef8c..58be6b6 100644 --- a/express/src/utils/lancedb.js +++ b/express/src/utils/lancedb.js @@ -10,7 +10,8 @@ import { load } from 'cheerio'; import { BytesOutputParser, StringOutputParser } from '@langchain/core/output_parsers'; import { DataDir } from './const.js'; -import { db, getDbRecord, getDbRecordALL } from './db.js' + +//import { db, getDbRecord, getDbRecordALL } from './db.js' import dotenv from 'dotenv'; dotenv.config(); diff --git a/express/src/utils/llms.js b/express/src/utils/llms.js index bf5de8e..4b06e67 100644 --- a/express/src/utils/llms.js +++ b/express/src/utils/llms.js @@ -16,9 +16,8 @@ import { SystemMessage, HumanMessage, AIMessage } from "@langchain/core/messages import { ChatMessageHistory } from "langchain/stores/message/in_memory"; import { ChatGoogleGenerativeAI } from "@langchain/google-genai"; import { HarmBlockThreshold, HarmCategory } from "@google/generative-ai"; -import { ChatBaiduWenxin } from "@langchain/community/chat_models/baiduwenxin"; +//import { ChatBaiduWenxin } from "@langchain/community/chat_models/baiduwenxin"; -import { TavilySearchResults } from "@langchain/community/tools/tavily_search"; import { MemoryVectorStore } from "langchain/vectorstores/memory"; import { createRetrieverTool } from "langchain/agents/toolkits"; import { pull } from "langchain/hub"; @@ -51,9 +50,6 @@ import { DataDir } from './const.js'; import { db, getDbRecord, getDbRecordALL } from './db.js' import { getLLMSSetting, log, isFile, formatDateString, enableDir, getNanoid, writeFile } from './utils.js' -import { LanceDB } from "@langchain/community/vectorstores/lancedb"; -import { connect } from "vectordb"; - import { createEmbeddingsFromList, getWebsiteUrlContext, formatMessage, rephraseInput, retrieveContext } from './lancedb.js'; //.ENV @@ -525,6 +521,7 @@ let ChatBaiduWenxinModel = null } export async function initChatBookBaiduWenxinStream(res, datasetId) { + /* getLLMSSettingData = await getLLMSSetting(datasetId); const BAIDU_API_KEY = getLLMSSettingData.OPENAI_API_KEY ?? "1AWXpm1Cd8lbxmAaFoPR0dNx"; const BAIDU_SECRET_KEY = getLLMSSettingData.OPENAI_API_BASE ?? "TQy5sT9Mz4xKn0tR8h7W6LxPWIUNnXqq"; @@ -548,6 +545,7 @@ let ChatBaiduWenxinModel = null res.write("Not set API_KEY"); res.end(); } + */ } export async function chatChatBaiduWenxin(res, userId, question, history, template, appId) {